public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb] Fix assert in handle_jit_event
@ 2022-10-19 15:41 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-10-19 15:41 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=508ccf9b3e1db355037a4a1c9004efe0d6d3ffbf

commit 508ccf9b3e1db355037a4a1c9004efe0d6d3ffbf
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Oct 19 17:41:47 2022 +0200

    [gdb] Fix assert in handle_jit_event
    
    With the cc-with-tweaks.sh patch submitted here (
    https://sourceware.org/pipermail/gdb-patches/2022-October/192586.html ) we run
    with:
    ...
    $ export STRIP_ARGS_STRIP_DEBUG=--strip-all
    $ make check RUNTESTFLAGS="gdb.base/jit-reader.exp \
        --target_board cc-with-gnu-debuglink"
    ...
    into the following assert:
    ...
    (gdb) run ^M
    Starting program: jit-reader ^M
    gdb/jit.c:1247: internal-error: jit_event_handler: \
      Assertion `jiter->jiter_data != nullptr' failed.^M
    ...
    
    Fix this by handling the
    jit_bp_sym.objfile->separate_debug_objfile_backlink != nullptr case in
    handle_jit_event.
    
    Tested on x86_64-linux.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29277

Diff:
---
 gdb/breakpoint.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index eb4dedf3f10..0eace4f9f03 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5679,7 +5679,10 @@ handle_jit_event (CORE_ADDR address)
      function needs to be updated too.  */
   bound_minimal_symbol jit_bp_sym = lookup_minimal_symbol_by_pc (address);
   gdb_assert (jit_bp_sym.objfile != nullptr);
-  jit_event_handler (gdbarch, jit_bp_sym.objfile);
+  objfile *objfile = jit_bp_sym.objfile;
+  if (objfile->separate_debug_objfile_backlink)
+    objfile = objfile->separate_debug_objfile_backlink;
+  jit_event_handler (gdbarch, objfile);
 
   target_terminal::inferior ();
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-19 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 15:41 [binutils-gdb] [gdb] Fix assert in handle_jit_event Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).