Message ID | 20250118080826.24861-1-tdevries@suse.de |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B5A73857823 for <patchwork@sourceware.org>; Sat, 18 Jan 2025 08:08:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B5A73857823 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EkrcYfm0; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=QgB0oo4P; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=EkrcYfm0; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=QgB0oo4P X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id DF8583857823 for <gdb-patches@sourceware.org>; Sat, 18 Jan 2025 08:08:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF8583857823 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF8583857823 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737187699; cv=none; b=lO5r3uM4nktOcpsECVM7X3IsfEqAUl/ouy0OQpdFq3CESJflfCu1uSNDZ1fiPmV/ZWh+gPOxC5RpPL0TG8UmbxWI3MuceI1a8EepNU1tgo5Euk9aL/2Vp7qaYQ1Jh6Z/gYnuMv95TtdlCuJEotRvgvzmlf28JlLnKTLEpg8nSeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737187699; c=relaxed/simple; bh=qanRjdm//TTyugt2IoLfy3dpgOlSGwWH9j1svEIVJpI=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=NNnJBdyzHaAk7V68SlPq/vq3xnQ3b7yKzO6ywdNqGDOvH7KCdRjC3ATdWrqz3Az9a9KyJKw4m31L5Gco/Ukb90w3x1HxHgmcrqZsV3tYdsY4+h+maEhdwVgBpgMLTYmsv8dUcL9dlS9kT1lAlo8PDosPMTIziq9fqGiHmLH8KtY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF8583857823 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AA9ED211A1 for <gdb-patches@sourceware.org>; Sat, 18 Jan 2025 08:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1737187697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Y0PFrMnKhQ0sz4Dr6WlUqWVHlFVq3btsvQaVPP4GYSI=; b=EkrcYfm06Wui7MfIvVMyj9MPt2KpfTk4w4RyT24E7tQv+Ym67fdlPpNzHFD16KRkKLg4UA 0XWkoy2/crZ6uiVqsZcBpPIW+lNUQ9JcB/5id0hfPO1FzVjfXqvxIosVp20SrdAnXglBjF 6juxhbesUmEoNOzYo0s6UQmeXKhzQr8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1737187697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Y0PFrMnKhQ0sz4Dr6WlUqWVHlFVq3btsvQaVPP4GYSI=; b=QgB0oo4PTJ8wO7b4oemP3ECNe1SdUOVqlM0IYJFDr2shfeLxRbhC9nmxcfOIAgFTjWX9tL 5IAyflOzxk/ze+CQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=EkrcYfm0; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=QgB0oo4P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1737187697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Y0PFrMnKhQ0sz4Dr6WlUqWVHlFVq3btsvQaVPP4GYSI=; b=EkrcYfm06Wui7MfIvVMyj9MPt2KpfTk4w4RyT24E7tQv+Ym67fdlPpNzHFD16KRkKLg4UA 0XWkoy2/crZ6uiVqsZcBpPIW+lNUQ9JcB/5id0hfPO1FzVjfXqvxIosVp20SrdAnXglBjF 6juxhbesUmEoNOzYo0s6UQmeXKhzQr8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1737187697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Y0PFrMnKhQ0sz4Dr6WlUqWVHlFVq3btsvQaVPP4GYSI=; b=QgB0oo4PTJ8wO7b4oemP3ECNe1SdUOVqlM0IYJFDr2shfeLxRbhC9nmxcfOIAgFTjWX9tL 5IAyflOzxk/ze+CQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 92A471373B for <gdb-patches@sourceware.org>; Sat, 18 Jan 2025 08:08:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id T6JcInFhi2fQNwAAD6G6ig (envelope-from <tdevries@suse.de>) for <gdb-patches@sourceware.org>; Sat, 18 Jan 2025 08:08:17 +0000 From: Tom de Vries <tdevries@suse.de> To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix gdb.base/branch-to-self.exp on arm-linux Date: Sat, 18 Jan 2025 09:08:26 +0100 Message-ID: <20250118080826.24861-1-tdevries@suse.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA9ED211A1 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:dkim] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Status: No, score=-12.4 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.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
[gdb/testsuite] Fix gdb.base/branch-to-self.exp on arm-linux
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
linaro-tcwg-bot/tcwg_gdb_check--master-arm | success | Test passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Test passed |
Commit Message
Tom de Vries
Jan. 18, 2025, 8:08 a.m. UTC
On arm-linux (ubuntu 24.04 with gcc 13.3.0) with target board unix/-marm and test-case gdb.base/branch-to-self.exp I run into: ... (gdb) continue^M Continuing.^M ^M Breakpoint 2, main () at branch-to-self.c:38^M 38 for (;;); /* loop-line */^M (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint si^M 0x0040058c 38 for (;;); /* loop-line */^M (gdb) FAIL: $exp: single-step: si ... In contrast, on the same machine but with debian testing and gcc 14.2.0 we have: ... (gdb) continue^M Continuing.^M ^M Breakpoint 2, main () at branch-to-self.c:38^M 38 for (;;); /* loop-line */^M (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint si^M ^M Breakpoint 2, main () at branch-to-self.c:38^M 38 for (;;); /* loop-line */^M (gdb) PASS: $exp: single-step: stepi ... The difference is in the instruction(s) generated for the loop. In the passing case, we have: ... 588: eafffffe b 588 <main+0x24> ... and in the failing case: ... 588: e320f000 nop {0} 58c: eafffffd b 588 <main+0x24> ... The purpose of this part of test-case is to: - generate a branch instruction that jumps to itself, and - set a breakpoint on it, and check that stepi-ing from that breakpoint triggers the breakpoint again. As we can see, in the failing case we failed to generate a branch instruction that jumps to itself, and consequently we cannot expect to hit the breakpoint again after issuing a single si. Fix this by issue stepi until we hit the breakpoint. Tested on arm-linux. --- gdb/testsuite/gdb.base/branch-to-self.exp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) base-commit: 26dd9cb647140db87a5a530fd9f044d356e081de
Comments
Hello Tom, Tom de Vries <tdevries@suse.de> writes: > On arm-linux (ubuntu 24.04 with gcc 13.3.0) with target board unix/-marm and > test-case gdb.base/branch-to-self.exp I run into: > ... > (gdb) continue^M > Continuing.^M > ^M > Breakpoint 2, main () at branch-to-self.c:38^M > 38 for (;;); /* loop-line */^M > (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint > si^M > 0x0040058c 38 for (;;); /* loop-line */^M > (gdb) FAIL: $exp: single-step: si > ... > > In contrast, on the same machine but with debian testing and gcc 14.2.0 we have: > ... > (gdb) continue^M > Continuing.^M > ^M > Breakpoint 2, main () at branch-to-self.c:38^M > 38 for (;;); /* loop-line */^M > (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint > si^M > ^M > Breakpoint 2, main () at branch-to-self.c:38^M > 38 for (;;); /* loop-line */^M > (gdb) PASS: $exp: single-step: stepi > ... > > The difference is in the instruction(s) generated for the loop. > > In the passing case, we have: > ... > 588: eafffffe b 588 <main+0x24> > ... > and in the failing case: > ... > 588: e320f000 nop {0} > 58c: eafffffd b 588 <main+0x24> > ... > > The purpose of this part of test-case is to: > - generate a branch instruction that jumps to itself, and > - set a breakpoint on it, and check that stepi-ing from that breakpoint > triggers the breakpoint again. > > As we can see, in the failing case we failed to generate a branch instruction > that jumps to itself, and consequently we cannot expect to hit the breakpoint > again after issuing a single si. > > Fix this by issue stepi until we hit the breakpoint. > > Tested on arm-linux. > --- > gdb/testsuite/gdb.base/branch-to-self.exp | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) Thank you for fixing the problem! Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org> -- Thiago
On 1/22/25 00:32, Thiago Jung Bauermann wrote: > Hello Tom, > > Tom de Vries <tdevries@suse.de> writes: > >> On arm-linux (ubuntu 24.04 with gcc 13.3.0) with target board unix/-marm and >> test-case gdb.base/branch-to-self.exp I run into: >> ... >> (gdb) continue^M >> Continuing.^M >> ^M >> Breakpoint 2, main () at branch-to-self.c:38^M >> 38 for (;;); /* loop-line */^M >> (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint >> si^M >> 0x0040058c 38 for (;;); /* loop-line */^M >> (gdb) FAIL: $exp: single-step: si >> ... >> >> In contrast, on the same machine but with debian testing and gcc 14.2.0 we have: >> ... >> (gdb) continue^M >> Continuing.^M >> ^M >> Breakpoint 2, main () at branch-to-self.c:38^M >> 38 for (;;); /* loop-line */^M >> (gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint >> si^M >> ^M >> Breakpoint 2, main () at branch-to-self.c:38^M >> 38 for (;;); /* loop-line */^M >> (gdb) PASS: $exp: single-step: stepi >> ... >> >> The difference is in the instruction(s) generated for the loop. >> >> In the passing case, we have: >> ... >> 588: eafffffe b 588 <main+0x24> >> ... >> and in the failing case: >> ... >> 588: e320f000 nop {0} >> 58c: eafffffd b 588 <main+0x24> >> ... >> >> The purpose of this part of test-case is to: >> - generate a branch instruction that jumps to itself, and >> - set a breakpoint on it, and check that stepi-ing from that breakpoint >> triggers the breakpoint again. >> >> As we can see, in the failing case we failed to generate a branch instruction >> that jumps to itself, and consequently we cannot expect to hit the breakpoint >> again after issuing a single si. >> >> Fix this by issue stepi until we hit the breakpoint. >> >> Tested on arm-linux. >> --- >> gdb/testsuite/gdb.base/branch-to-self.exp | 17 ++++++++++++++++- >> 1 file changed, 16 insertions(+), 1 deletion(-) > > Thank you for fixing the problem! > Hi Thiago, thanks for the review. I've pushed this. Thanks, - Tom > Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org> > > -- > Thiago
diff --git a/gdb/testsuite/gdb.base/branch-to-self.exp b/gdb/testsuite/gdb.base/branch-to-self.exp index 9b4f7467498..71859d71e0d 100644 --- a/gdb/testsuite/gdb.base/branch-to-self.exp +++ b/gdb/testsuite/gdb.base/branch-to-self.exp @@ -35,7 +35,22 @@ with_test_prefix "single-step" { gdb_test "break ${testfile}.c:${line_num}" "Breakpoint .*" \ "set breakpoint" gdb_continue_to_breakpoint "hit breakpoint" - gdb_test "si" ".*${testfile}.c:${line_num}.*" + + set stepi_count 1 + gdb_test_multiple "stepi" "" { + -re -wrap ".*${testfile}.c:${line_num}.*" { + pass $gdb_test_name + } + -re -wrap "" { + if { $stepi_count == 10 } { + fail $gdb_test_name + } else { + incr stepi_count + send_gdb "stepi\n" + exp_continue + } + } + } } with_test_prefix "break-cond" {