aboutsummaryrefslogtreecommitdiff
path: root/hw/core/loader.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-01-12 16:20:12 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-01-16 10:14:12 -1000
commit7c10cb38ccb86a0e56fff32bb348aa4b34e17e10 (patch)
tree56788d06412a4ffaaf1b42ae6531671415ba6181 /hw/core/loader.c
parentda91c19202420d61e3316f5a9d4c2d66bfbaff04 (diff)
downloadqemu-7c10cb38ccb86a0e56fff32bb348aa4b34e17e10.zip
qemu-7c10cb38ccb86a0e56fff32bb348aa4b34e17e10.tar.gz
qemu-7c10cb38ccb86a0e56fff32bb348aa4b34e17e10.tar.bz2
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 <iii@linux.ibm.com> Message-Id: <20230112152013.125680-3-iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/core/loader.c')
-rw-r--r--hw/core/loader.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 0548830..55dbe2e 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 <zlib.h>
@@ -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;