This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch] Dump unknown dwarf lne records
- From: Tristan Gingold <gingold at adacore dot com>
- To: binutils Development <binutils at sourceware dot org>
- Date: Wed, 4 May 2011 13:09:56 +0200
- Subject: [Patch] Dump unknown dwarf lne records
Hi,
small patch to dump the unhandled lne records in dwarf.c. Can be useful to manually decode them.
Ok for trunk ?
Tristan.
binutils/
2011-05-04 Tristan Gingold <gingold@adacore.com>
* dwarf.c (process_extended_line_op): Dump unknown records.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index b240af6..5102aec 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -376,14 +376,22 @@ process_extended_line_op (unsigned char *data, int is_stmt)
break;
default:
- if (op_code >= DW_LNE_lo_user
- /* The test against DW_LNW_hi_user is redundant due to
- the limited range of the unsigned char data type used
- for op_code. */
- /*&& op_code <= DW_LNE_hi_user*/)
- printf (_("user defined: length %d\n"), len - bytes_read);
- else
- printf (_("UNKNOWN: length %d\n"), len - bytes_read);
+ {
+ unsigned int rlen = len - bytes_read - 1;
+
+ if (op_code >= DW_LNE_lo_user
+ /* The test against DW_LNW_hi_user is redundant due to
+ the limited range of the unsigned char data type used
+ for op_code. */
+ /*&& op_code <= DW_LNE_hi_user*/)
+ printf (_("user defined: "));
+ else
+ printf (_("UNKNOWN: "));
+ printf (_("length %d ["), rlen);
+ for (; rlen; rlen--)
+ printf (" %02x", *data++);
+ printf ("]\n");
+ }
break;
}