From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cGRIH9t/gWEHIQAAWB0awg (envelope-from ) for ; Tue, 02 Nov 2021 14:13:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 7C0A41F0C1; Tue, 2 Nov 2021 14:13:47 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=unavailable 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 2745B1E940 for ; Tue, 2 Nov 2021 14:13:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 76D433858000 for ; Tue, 2 Nov 2021 18:13:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76D433858000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635876826; bh=83f097Twpx36vzzXXDtoz/qDgFhIN2zko0TdGTsC7i4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=oW69UUfDySLyhWgDO6jAigv9jsZneXoAKS65AB16hfmyc51veuuoul1ty5lra4KPI jQUZgZo3wpabYiNQ6BM78/tdUBhDTyJWeJQ3k+bXD3WYyTjt+ZzG1LQ0FTHslr5h5S 6IOG1VNSvr3x2jJoq0m8dtqSbJYthL3aL0FjhnEk= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 416853858C27 for ; Tue, 2 Nov 2021 18:13:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 416853858C27 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 5A8231FD29; Tue, 2 Nov 2021 18:13:27 +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 4072D13E9E; Tue, 2 Nov 2021 18:13:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8g+JDsd/gWEuHAAAMHmgww (envelope-from ); Tue, 02 Nov 2021 18:13:27 +0000 Subject: Re: [PATCH][gdb/tdep, rs6000] Don't skip system call in skip_prologue To: Simon Marchi , gdb-patches@sourceware.org References: <20211102113302.GA7990@delia.home> <79e1d5a7-1f41-9bb4-85b2-433c282a8254@simark.ca> Message-ID: <078020f9-9f2f-3c52-8625-ff426cb8536f@suse.de> Date: Tue, 2 Nov 2021 19:13:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <79e1d5a7-1f41-9bb4-85b2-433c282a8254@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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" On 11/2/21 5:26 PM, Simon Marchi wrote: > On 2021-11-02 7:33 a.m., Tom de Vries via Gdb-patches wrote: >> 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. */ >> > > > The explanation makes sense, but I think a powerpc maintainer should ack the > patch. > The only mention I found in gdb/MAINTAINERS related to powerpc is Kevin, and he approved it. > And I think it would be useful to paste the "disassembly /r" of the _exit > function in the commit message, showing where the breakpoint used to be > placed, and where it is placed now. Ack, good suggestion, done and committed. Thanks, - Tom