[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[committed] Add dump_die



Hi,

Add dump_die debug function, that we can easily call during a debug session:
...
(gdb) call dump_die (die)
 5b X 0 0 short int base_type
...

Committed to trunk.

Thanks,
- Tom

Add dump_die

2019-11-30  Tom de Vries  <tdevries@suse.de>

	* dwz.c (USED): Define.
	(dump_die): New function.

---
 dwz.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dwz.c b/dwz.c
index d417c94..f68a81c 100644
--- a/dwz.c
+++ b/dwz.c
@@ -119,9 +119,11 @@
 #if defined __GNUC__
 # define FORCE_INLINE __attribute__((always_inline))
 # define UNUSED __attribute__((unused))
+# define USED __attribute__((used))
 #else
 # define FORCE_INLINE
 # define UNUSED
+# define USED
 #endif
 
 #define obstack_chunk_alloc     malloc
@@ -4172,6 +4174,13 @@ dump_die_with_indent (int indent, dw_die_ref die)
   fprintf (stderr, "\n");
 }
 
+/* Dump DIE to stderr.  */
+void USED
+dump_die (dw_die_ref die)
+{
+  dump_die_with_indent (0, die);
+}
+
 /* Dump DIE tree at tree depth DEPTH.  */
 static void
 dump_dies (int depth, dw_die_ref die)