[ltrace-commits] 16/40: moved DWARF prototype reading to library_get_prototype()

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 58172133867c892dbf3be9016967fda5222bfd32
Author: Dima Kogan <dima at secretsauce.net>
Date:   Wed Apr 23 03:01:20 2014 -0700

    moved DWARF prototype reading to library_get_prototype()
---
 library.c |  4 ++++
 library.h |  8 ++++++++
 output.c  | 13 +++++++++++++
 proc.c    |  9 +--------
 4 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/library.c b/library.c
index 1f425e0..13d8d45 100644
--- a/library.c
+++ b/library.c
@@ -294,6 +294,10 @@ private_library_init(struct library *lib, enum library_type type)
 	lib->symbols = NULL;
 	lib->exported_names = NULL;
 	lib->type = type;
+
+#if defined(HAVE_LIBDW)
+	lib->dwfl = NULL;
+#endif
 }
 
 int
diff --git a/library.h b/library.h
index 9b687b1..82dc048 100644
--- a/library.h
+++ b/library.h
@@ -24,6 +24,10 @@
 
 #include <stdint.h>
 
+#if defined(HAVE_LIBDW)
+# include <elfutils/libdwfl.h>
+#endif
+
 #include "callback.h"
 #include "forward.h"
 #include "sysdep.h"
@@ -170,6 +174,10 @@ struct library {
 
 	struct arch_library_data arch;
 	struct os_library_data os;
+
+#if defined(HAVE_LIBDW)
+	Dwfl *dwfl;
+#endif
 };
 
 /* Init LIB.  */
diff --git a/output.c b/output.c
index 671a5d7..5dcc475 100644
--- a/output.c
+++ b/output.c
@@ -49,6 +49,11 @@
 #include "type.h"
 #include "value.h"
 #include "value_dict.h"
+#include "filter.h"
+
+#if defined(HAVE_LIBDW)
+#include "dwarf_prototypes.h"
+#endif
 
 static struct process *current_proc = NULL;
 static size_t current_depth = 0;
@@ -207,6 +212,14 @@ library_get_prototype(struct library *lib, const char *name)
 			 && lib->type == LT_LIBTYPE_DSO
 			 && snip_period(buf));
 
+#if defined(HAVE_LIBDW)
+		if (lib->protolib == NULL && lib->dwfl != NULL &&
+			(filter_matches_library(options.plt_filter,    lib ) ||
+			 filter_matches_library(options.static_filter, lib ) ||
+			 filter_matches_library(options.export_filter, lib )))
+			import_DWARF_prototypes(lib->protolib, lib, lib->dwfl);
+#endif
+
 		if (lib->protolib == NULL)
 			lib->protolib = protolib_cache_default(&g_protocache,
 							       buf, 0);
diff --git a/proc.c b/proc.c
index 49c0b93..f08f947 100644
--- a/proc.c
+++ b/proc.c
@@ -37,7 +37,6 @@
 #include "proc.h"
 #include "value_dict.h"
 #include "dwarf_prototypes.h"
-#include "filter.h"
 
 #ifndef OS_HAVE_PROCESS_DATA
 int
@@ -947,13 +946,7 @@ proc_add_library(struct process *proc, struct library *lib)
 		}
 	}
 
-	if( dwfl != NULL &&
-		( filter_matches_library(options.plt_filter,	lib ) ||
-		  filter_matches_library(options.static_filter,	lib ) ||
-		  filter_matches_library(options.export_filter,	lib ) ) )
-	{
-		import_DWARF_prototypes( lib->protolib, lib, dwfl );
-	}
+	lib->dwfl = dwfl;
 
 #endif /* defined(HAVE_LIBDW) */
 

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