From 7c10cb38ccb86a0e56fff32bb348aa4b34e17e10 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Thu, 12 Jan 2023 16:20:12 +0100 Subject: accel/tcg: Add debuginfo support Add libdw-based functions for loading and querying debuginfo. Load debuginfo from the system and the linux-user loaders. This is useful for the upcoming perf support, which can then put human-readable guest symbols instead of raw guest PCs into perfmap and jitdump files. Signed-off-by: Ilya Leoshkevich Message-Id: <20230112152013.125680-3-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- hw/core/loader.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/core/loader.c') diff --git a/hw/core/loader.c b/hw/core/loader.c index 0548830733..55dbe2e199 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -61,6 +61,7 @@ #include "hw/boards.h" #include "qemu/cutils.h" #include "sysemu/runstate.h" +#include "accel/tcg/debuginfo.h" #include @@ -503,6 +504,10 @@ ssize_t load_elf_ram_sym(const char *filename, clear_lsb, data_swab, as, load_rom, sym_cb); } + if (ret != ELF_LOAD_FAILED) { + debuginfo_report_elf(filename, fd, 0); + } + fail: close(fd); return ret; -- cgit 1.4.1