From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KA+PJQcigWH1FQAAWB0awg (envelope-from ) for ; Tue, 02 Nov 2021 07:33:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 84D361F0C1; Tue, 2 Nov 2021 07:33:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6E04E1ECEB for ; Tue, 2 Nov 2021 07:33:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D5D2385840D for ; Tue, 2 Nov 2021 11:33:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D5D2385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635852805; bh=78XIJ3/ho/FqLz9A7ARYG6Xrt99eI4UePNJveJ7yedE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=KiExnVI8zn9BbvnCDImvC7mm4DXBpF6hkctwWHSrBGNkXR+uHiM+2cm4cVWzxIGb1 m5qXyAWwdUxTH90cifK7rmcBxCzrR9GzDp/zpuBTtdoC+MytpqPmLO5y/Dd1/MLj0t wARvF33L+4bClTuIX8FX/qlzdYVLPZDXZ3UprK7c= 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 To: gdb-patches@sourceware.org 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-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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Ulrich Weigand Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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. */