diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-11-21 14:36:36 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-12-02 14:40:24 -0500 |
commit | f8baaa2b0bfe410f41cf1ca5c87ae78ca59587e5 (patch) | |
tree | 999c9ee2d3f91efc54317d2ff7a3e1670b508ee3 | |
parent | e26d0dab1018d9ed6eaf3ab127ce9928cd8ac271 (diff) | |
download | gdb-f8baaa2b0bfe410f41cf1ca5c87ae78ca59587e5.zip gdb-f8baaa2b0bfe410f41cf1ca5c87ae78ca59587e5.tar.gz gdb-f8baaa2b0bfe410f41cf1ca5c87ae78ca59587e5.tar.bz2 |
gdb: add some debug statements to solib-svr4.c
Add a few debug statements that were useful to me when debugging why the
glibc probes interface wasn't getting used.
Change-Id: Ic20744f9fc80a90f196896b0829949411620c540
-rw-r--r-- | gdb/solib-svr4.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 0fe6c23..63baaf8 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -2168,6 +2168,9 @@ svr4_create_probe_breakpoints (svr4_info *info, struct gdbarch *gdbarch, { CORE_ADDR address = p->get_relocated_address (objfile); + solib_debug_printf ("name=%s, addr=%s", probe_info[i].name, + paddress (gdbarch, address)); + create_solib_event_breakpoint (gdbarch, address); register_solib_event_probe (info, objfile, p, address, action); } @@ -2185,6 +2188,9 @@ svr4_find_and_create_probe_breakpoints (svr4_info *info, struct obj_section *os, bool with_prefix) { + SOLIB_SCOPED_DEBUG_START_END ("objfile=%s, with_prefix=%d", + os->objfile->original_name, with_prefix); + std::vector<probe *> probes[NUM_PROBES]; for (int i = 0; i < NUM_PROBES; i++) @@ -2204,6 +2210,7 @@ svr4_find_and_create_probe_breakpoints (svr4_info *info, } probes[i] = find_probes_in_objfile (os->objfile, "rtld", name); + solib_debug_printf ("probe=%s, num found=%zu", name, probes[i].size ()); /* Ensure at least one probe for the current name was found. */ if (probes[i].empty ()) @@ -2256,6 +2263,7 @@ svr4_find_and_create_probe_breakpoints (svr4_info *info, } /* All probes found. Now create them. */ + solib_debug_printf ("using probes interface"); svr4_create_probe_breakpoints (info, gdbarch, probes, os->objfile); return true; } @@ -2281,7 +2289,11 @@ svr4_create_solib_event_breakpoints (svr4_info *info, struct gdbarch *gdbarch, if (os == nullptr || (!svr4_find_and_create_probe_breakpoints (info, gdbarch, os, false) && !svr4_find_and_create_probe_breakpoints (info, gdbarch, os, true))) - create_solib_event_breakpoint (gdbarch, address); + { + solib_debug_printf ("falling back to r_brk breakpoint: addr=%s", + paddress (gdbarch, address)); + create_solib_event_breakpoint (gdbarch, address); + } } /* Helper function for gdb_bfd_lookup_symbol. */ |