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 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 Cc: Ulrich Weigand References: <20211102113302.GA7990@delia.home> <79e1d5a7-1f41-9bb4-85b2-433c282a8254@simark.ca> From: Tom de Vries 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-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, 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 18:13:30 -0000 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