inlinecall

Print call sites of an inline function
git clone git://git.margiolis.net/inlinecall.git
Log | Files | Refs | README | LICENSE

commit 49d9cd99a0f022bf469f2bfdb6ac2ff8f5a6c09d
parent 8e355b2580c619c3e57c5b17e84c9a71a931d640
Author: Christos Margiolis <christos@margiolis.net>
Date:   Sat,  4 Mar 2023 03:38:12 +0200

remove call to dwarf_next_types_section()

Diffstat:
Minlinecall.c | 33+++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/inlinecall.c b/inlinecall.c @@ -423,25 +423,22 @@ main(int argc, char *argv[]) if (elf_errno() != 0) warnx("elf_nextscn(): %s", elf_errmsg(-1)); - do { - while ((res = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, - NULL, &error)) == DW_DLV_OK) { - die = NULL; - TAILQ_INIT(&head); - while (dwarf_siblingof(dbg, die, &die, &error) == - DW_DLV_OK) { - srcfiles = NULL; - if (dwarf_srcfiles(die, &srcfiles, &nfiles, - &error) != DW_DLV_OK) - warnx("%s", dwarf_errmsg(error)); - parse_die(dbg, die, 0, F_SUBPROGRAM); - } - dwarf_dealloc(dbg, die, DW_DLA_DIE); - dump_results(); + while ((res = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, + &error)) == DW_DLV_OK) { + die = NULL; + TAILQ_INIT(&head); + while (dwarf_siblingof(dbg, die, &die, &error) == DW_DLV_OK) { + srcfiles = NULL; + if (dwarf_srcfiles(die, &srcfiles, &nfiles, &error) != + DW_DLV_OK) + warnx("%s", dwarf_errmsg(error)); + parse_die(dbg, die, 0, F_SUBPROGRAM); } - if (res == DW_DLV_ERROR) - warnx("%s", dwarf_errmsg(error)); - } while (dwarf_next_types_section(dbg, &error) == DW_DLV_OK); + dwarf_dealloc(dbg, die, DW_DLA_DIE); + dump_results(); + } + if (res == DW_DLV_ERROR) + warnx("%s", dwarf_errmsg(error)); free(ei.sl); elf_end(ei.elf);