libctf: make ctf_bfdopen_ctfsect a debugger entry point
authorNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:46 +0000 (16:32 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:49 +0000 (16:32 +0000)
This makes it possible to use LIBCTF_DEBUG to debug things that happen
before the ctf_bfdopen_internal call that ctf_bfdopen_ctfsect eventually
thunks down to (symtab/strtab lookup, archive opening, etc).

This is not important for ctf_open callers, since ctf_fdopen already
calls libctf_init_debug, but ctf_bfdopen_ctfsect is a public entry point
that can be called directly (e.g. objdump and readelf both do so).

libctf/ChangeLog
2021-03-25  Nick Alcock  <nick.alcock@oracle.com>

* ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging.

libctf/ChangeLog
libctf/ctf-open-bfd.c

index a9e76ecd7cae88132f13bbda636aaf195dc1dc96..32268f87f5fe3b96f578c157ec68237dbc02d0fb 100644 (file)
@@ -1,3 +1,7 @@
+2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging.
+
 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
 
        PR libctf/27628
index 84e4af6a73a94e514291d46f97f7a7eb4b6d2c7d..950864118fc3722815d1abdbff44fc202247e320 100644 (file)
@@ -99,6 +99,8 @@ ctf_bfdopen_ctfsect (struct bfd *abfd _libctf_unused_,
   char *strtab_alloc = NULL;
   int symsect_endianness = -1;
 
+  libctf_init_debug();
+
 #ifdef HAVE_BFD_ELF
   ctf_sect_t symsect, strsect;
   Elf_Internal_Shdr *symhdr;