From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A2B193856089 for ; Wed, 12 Oct 2022 14:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2B193856089 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 48E861F85D for ; Wed, 12 Oct 2022 14:52:41 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3242613A5C for ; Wed, 12 Oct 2022 14:52:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1cZQCrnURmNXLgAAMHmgww (envelope-from ) for ; Wed, 12 Oct 2022 14:52:41 +0000 Date: Wed, 12 Oct 2022 16:52:39 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb] Fix assert in handle_jit_event Message-ID: <20221012145238.GA3706@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2022 14:53:14 -0000 Hi, 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 Any comments? Thanks, - Tom [gdb] Fix assert in handle_jit_event --- gdb/breakpoint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index e9aee6315fa..902a9baa3e0 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5685,7 +5685,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 (); }