From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id D65043858D3C; Wed, 19 Oct 2022 15:41:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D65043858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666194114; bh=1FQMUTLY77V/jbXpS0MArpBiAW8IYTi2nB6VoNSZPZ4=; h=From:To:Subject:Date:From; b=AxwuVT5n4c1usfDW8gYYnRBYYT2910IAVO4kVFep6qXGKR0IXOWf3x3jVvJ8OtuSz fBbHw59HnOhvgiRHBoHOy1VyERhQEC6oHSr5b5GswZ/42okEwovhdPxMQ+FRzfqbmr dwM7DRy4Z5/nSkxC7MHRJh2xwPSA0jLMHQ8R3tF0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb] Fix assert in handle_jit_event X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: f34652de0b68c4ee3050828b43a2839b852b5821 X-Git-Newrev: 508ccf9b3e1db355037a4a1c9004efe0d6d3ffbf Message-Id: <20221019154154.D65043858D3C@sourceware.org> Date: Wed, 19 Oct 2022 15:41:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D508ccf9b3e1d= b355037a4a1c9004efe0d6d3ffbf commit 508ccf9b3e1db355037a4a1c9004efe0d6d3ffbf Author: Tom de Vries Date: Wed Oct 19 17:41:47 2022 +0200 [gdb] Fix assert in handle_jit_event =20 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=3D--strip-all $ make check RUNTESTFLAGS=3D"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 !=3D nullptr' failed.^M ... =20 Fix this by handling the jit_bp_sym.objfile->separate_debug_objfile_backlink !=3D nullptr case in handle_jit_event. =20 Tested on x86_64-linux. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29277 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 =3D lookup_minimal_symbol_by_pc (address= ); gdb_assert (jit_bp_sym.objfile !=3D nullptr); - jit_event_handler (gdbarch, jit_bp_sym.objfile); + objfile *objfile =3D jit_bp_sym.objfile; + if (objfile->separate_debug_objfile_backlink) + objfile =3D objfile->separate_debug_objfile_backlink; + jit_event_handler (gdbarch, objfile); =20 target_terminal::inferior (); }