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>
This commit is contained in:
Ilya Leoshkevich 2023-01-12 16:20:12 +01:00 committed by Richard Henderson
parent da91c19202
commit 7c10cb38cc
7 changed files with 191 additions and 0 deletions

View file

@ -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;