libctf: dump header offsets into the debugging output
authorNick Alcock <nick.alcock@oracle.com>
Wed, 19 Jun 2019 11:23:38 +0000 (12:23 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 21 Jun 2019 12:04:02 +0000 (13:04 +0100)
This is an essential first piece of info needed to debug both libctf
writing and reading problems, and we weren't recording it anywhere!

(This is a short-term fix: fairly soon, we will record all of this in a
form that outlives ctf_bufopen, and then ctf_dump() will be able to dump
it like it can everything else.)

libctf/
* ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
output.

libctf/ChangeLog
libctf/ctf-open.c

index 9fd9e6617a51f0247fd327f2c954f360dd70af03..9ff7cd4146bb3e58e9592eeb00a129475710e78f 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-19  Nick Alcock <nick.alcock@oracle.com>
+
+       * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
+       output.
+
 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
 
        * ctf-subr.c (_PAGESIZE): Remove.
index b0d3ef6205577a7f19d345bf6e5b0222a0a7bacf..df735acb4085ce6bf14828b9bbcbf6ec50a9ce44 100644 (file)
@@ -1275,6 +1275,9 @@ ctf_bufopen (const ctf_sect_t *ctfsect, const ctf_sect_t *symsect,
   if (foreign_endian)
     flip_header (&hp);
 
+  ctf_dprintf ("header offsets: %x/%x/%x/%x/%x/%x/%x\n",
+              hp.cth_lbloff, hp.cth_objtoff, hp.cth_funcoff, hp.cth_varoff,
+              hp.cth_typeoff, hp.cth_stroff, hp.cth_strlen);
   hdrsz = sizeof (ctf_header_t);
 
   size = hp.cth_stroff + hp.cth_strlen;