summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Kogan <dima@secretsauce.net>2014-04-22 04:20:32 -0700
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:25 +0900
commit6630794dd74723c43a940c4dfe69e31c6a79c82c (patch)
treed039a31854c68373a8271c4a35566a28d45b1029
parent41b4b8f3f28e6700aaef3aec1ce63a9d95430448 (diff)
downloadltrace-6630794dd74723c43a940c4dfe69e31c6a79c82c.tar.gz
ltrace-6630794dd74723c43a940c4dfe69e31c6a79c82c.tar.bz2
ltrace-6630794dd74723c43a940c4dfe69e31c6a79c82c.zip
added some optional debug printing
-rw-r--r--dwarf_prototypes.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/dwarf_prototypes.c b/dwarf_prototypes.c
index 36c44b9..87081c8 100644
--- a/dwarf_prototypes.c
+++ b/dwarf_prototypes.c
@@ -28,7 +28,10 @@
#include "options.h"
#include "filter.h"
-#if 0
+
+//#define DUMP_PROTOTYPES
+
+#if 1
#define complain( die, format, ... ) \
fprintf(stderr, "%s() die '%s' @ 0x%lx: " format "\n", \
__func__, dwarf_diename(die), dwarf_dieoffset(die), \
@@ -74,7 +77,9 @@ static bool dump_dwarf_tree(Dwarf_Die* die)
{
return _dump_dwarf_tree( die, 0 );
}
+#endif
+#ifdef DUMP_PROTOTYPES
static bool _dump_ltrace_tree( const struct arg_type_info* info, int indent )
{
if( indent > 7 )
@@ -633,6 +638,11 @@ static bool getPrototype(struct prototype* proto, Dwarf_Die* subroutine)
return false;
}
+#ifdef DUMP_PROTOTYPES
+ fprintf(stderr, "Adding argument:\n");
+ dump_ltrace_tree(arg_type_info);
+#endif
+
next_prototype_argument: ;
int res = dwarf_siblingof(&arg_die, &arg_die);
if( res == 0 ) continue; /* sibling exists */