From: Dima Kogan Date: Wed, 23 Apr 2014 07:06:45 +0000 (-0700) Subject: I now import functions using their linkage name X-Git-Tag: accepted/tizen/common/20140822.152031~74 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fltrace.git;a=commitdiff_plain;h=5d34088f4bd07ff1e91826ca981c10f54748e76f I now import functions using their linkage name This is required for C++ methods --- diff --git a/dwarf_prototypes.c b/dwarf_prototypes.c index 0ab05b8..9f03384 100644 --- a/dwarf_prototypes.c +++ b/dwarf_prototypes.c @@ -700,7 +700,20 @@ static bool process_die_compileunit(struct protolib* plib, struct library* lib, while (1) { if (dwarf_tag(&die) == DW_TAG_subprogram) { - const char* function_name = dwarf_diename(&die); + + // I use the linkage function name if there is one, otherwise the + // plain name + const char* function_name = NULL; + Dwarf_Attribute attr; + if (dwarf_attr(&die, DW_AT_linkage_name, &attr) != NULL) + function_name = dwarf_formstring(&attr); + if (function_name == NULL) + function_name = dwarf_diename(&die); + if (function_name == NULL) { + complain(&die, "Function has no name. Not importing" ); + goto next_prototype; + } + complain(&die, "subroutine_type: 0x%02x; function '%s'", dwarf_tag(&die), function_name);