From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1A8283858D39 for ; Tue, 2 Nov 2021 11:33:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A8283858D39 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-out1.suse.de (Postfix) with ESMTPS id 4C1B821952; Tue, 2 Nov 2021 11:33:06 +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 2AC7A13C8A; Tue, 2 Nov 2021 11:33:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8aljCfIhgWGWSgAAMHmgww (envelope-from ); Tue, 02 Nov 2021 11:33:06 +0000 Date: Tue, 2 Nov 2021 12:33:04 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Ulrich Weigand , Kevin Buettner , Carl Love Subject: [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue Message-ID: <20211102113302.GA7990@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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 02 Nov 2021 11:33:09 -0000 Hi, I ran into a case where a breakpoint on _exit never triggered, because it was set past the end of the _exit prologue, past the end of the exit_group system call (which does not return). Fix this by treating system calls the same as branches in skip_prologue: by default, don't skip. Tested on ppc64le-linux, on a power 8 machine. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28527 Any comments? Thanks, - Tom [gdb/tdep, rs6000] Don't skip system call in skip_prologue --- gdb/rs6000-tdep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 78b4fd1a913..4830ed22593 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2137,6 +2137,12 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, /* Never skip branches. */ break; + /* Test based on opcode and mask values of + powerpc_opcodes[svc..svcla] in opcodes/ppc-opc.c. */ + if ((op & 0xffff0000) == 0x44000000) + /* Never skip system calls. */ + break; + if (num_skip_non_prologue_insns++ > max_skip_non_prologue_insns) /* Do not scan too many insns, scanning insns is expensive with remote targets. */