[ltrace-commits] 12/40: I now import functions using their linkage name

Petr Machata pmachata-guest at moszumanska.debian.org
Sun May 11 22:38:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

pmachata-guest pushed a commit to branch master
in repository ltrace.

commit 6773484535c06e46fccc4639ed4d76133454c82f
Author: Dima Kogan <dima at secretsauce.net>
Date:   Wed Apr 23 00:06:45 2014 -0700

    I now import functions using their linkage name
    
    This is required for C++ methods
---
 dwarf_prototypes.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git



More information about the ltrace-commits mailing list