From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WfV8CA+P8mnTZgQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 19:06:55 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=j0c3k45C; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1D82D1E0CA; Wed, 29 Apr 2026 19:06:55 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 693DE1E0B1 for ; Wed, 29 Apr 2026 19:06:53 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 143654358A45 for ; Wed, 29 Apr 2026 23:06:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 143654358A45 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=j0c3k45C Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) by sourceware.org (Postfix) with ESMTPS id 280894358A53 for ; Wed, 29 Apr 2026 23:05:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 280894358A53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 280894358A53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::a36 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503947; cv=none; b=UTYXhDQm5z31ABeoNEkU8LhyCMHVNA2z4Ys5FL0C/wiDRtrJhqGvCs22u0gxAGkW/Ssm8kIyiRT85QM2QXNzAAAcczIH0PcRQ//8zB08e9b2kB2m3JWqgNmSDPd7GAZzfsEu3Azdu/hW0kVtEg/wmO5QURZ2Db88JKrlULdS7lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503947; c=relaxed/simple; bh=BFnczcJVvynyEo9K+ZZTAhMKiwsUnEqB4BSEeFk1wAg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TuW6dfUbhdCwWVDbnLLdHY2yrOk250FNSCZOoT4fPs2ewgYyY8DCSBkXn0Z/N/pgO5R8XyeMsanLdNoQpbIZunJexlHiYs+S88crbZZq2QafC6pilkN1lm5zAAmFwAeAG6Zy3vxF0JkpGsot1SyMlAHJlEZRTX5Ome1eVIlKs7A= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 280894358A53 Received: by mail-vk1-xa36.google.com with SMTP id 71dfb90a1353d-56e91f17a99so191157e0c.3 for ; Wed, 29 Apr 2026 16:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777503946; x=1778108746; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=QPKhlyNtYF20UvsXpxmalPiE965kFbn5215hkFZXu0A=; b=j0c3k45CgFh2P3hRJsDG8HZxOZ9c0idsuzptLp3kIqAT6VS/pLGY+lAOS2e30x5724 9gzp6sI7kJQcly8z3UUezjq43DPRRC6WhxNnCg2I05EVxl1y0sU6gjksr7Rcl5PpREEQ YOSTZ4thN6e/hrXLsuzkPL2PnkGgQCX2VdQWln2GV3ml8xEl+geiLYzJ/hF5moDCoj8/ WSB8OP7FckCHQRSpX3HwlOViZ8RJHg9TT234jwlWcawsa9c9v0HY0kuy6LD4pCIilXEq lFJkCCulBETiELexICxmRPiYg6PwGxbCDg+aIaMYtnw3t7HyfpHK9Zh4qvucPUS/t4pB jT1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777503946; x=1778108746; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=QPKhlyNtYF20UvsXpxmalPiE965kFbn5215hkFZXu0A=; b=bigPBtZiRVDpxQJ2l+k3vlEsE7ezjXrDEoLHBD3P5oBJ7n6vBSkdYRUlG66vMMhbu3 CzACu7wjicCSxXcX7EPUsKx/pwf3C2samIpqQOVtSWa+mD2ExSpfAVQLCdDqzIfsLPxN 6HrJxa33j4PNaXtK4jPFAo32CcrSWx8fg0os0mO65sc0Z4wxsWY0YhE8lLN3dp5gOWc4 MLPNsoBDoqbFah49lFcxHV7sV3LbOz+fq3osygL2De7lwK0CpO3IWVrKn7uYRZ9Np8LY auF5Q8wjHhWW7fJihrtUQ282dwjSXDcYVnXEl5DbiivqcubGiMKERJJ1Tg6HqTQ7zDo6 IvqA== X-Gm-Message-State: AOJu0Yy4swLQ1qSays0KKv4L24VhTCtRVJ+vN9PlJCVSy2SVP+kQL6kN NFh55KdppMbQ7K1m/hEl7Ow6h+WPlv7BgygeZAqdokLN1DFDsQNE3bk+phzkovKcgkTL75yqNsf JKaJa X-Gm-Gg: AeBDiev+I0YZRHhdKYJgcZh0lUPaj4P/OY7Pn/kHLGmXGpZihWXAB8a7XItemMAUcbp OhwcTq61BrGraEFlqX8hCYmDB6+Kne29A3I0jJd8liRxpLZO8eSDeTKA0LA+fNM2QCUvRysi1g1 gKb5kNeXVGP14eV0lpXdqiJltXiSoIywlhC+Q3vTfADzfXgN9Nu57ZZTujKc/ZGzXEryGJYBR9d dT2SVtQzqVk05f2pTvHHv9SfvC4pp4YFcICKzuJmlwO6a9eyirEQHUnNNQVHV+M6xGrH4OCMIrH UVCHFwlP8iaCItv5wMqEIE9/ZniARsK2rUltqqN44UD/9tQoy1SRTB/oHPPYSu6h1aLRgc+uEzu yDapJW9Hcds+0Q351icFdHbeoLmH+rvge2i0xUSa+zP2VlguYYDK9vjEyaRIOYn9wTyfkDYB5R5 Zv52D8QvKmkAhlmWBL3UQel/olTEFIhsPhBqJRbaUfY8Wh X-Received: by 2002:a05:6122:e266:b0:56f:1bbb:83d6 with SMTP id 71dfb90a1353d-573c966b5a9mr87971e0c.10.1777503946419; Wed, 29 Apr 2026 16:05:46 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-573b6b7d905sm2053822e0c.1.2026.04.29.16.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 16:05:45 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 19/37] GDB: testsuite: DWARF: Don't return -1 from top-level (manual) Date: Wed, 29 Apr 2026 20:04:10 -0300 Message-ID: <20260429230432.60487-20-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org> References: <20260429230432.60487-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This patch manually changes "return -1" statements that weren't caught by the sed command. These return statements fall into one of these criteria: - misaligned line, which is then fixed by this patch; - return at top level but inside block such as save_vars, with_test_prefix, foreach, gdb_test_multiple. Some weren't changed because they didn't meet the criteria above, or weren't trivial to check. --- .../gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp | 2 +- gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 2 +- gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp | 2 +- gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp | 2 +- gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp | 4 ++-- gdb/testsuite/gdb.dwarf2/gdb-index.exp | 2 +- gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp | 2 +- gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp | 2 +- gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp | 2 +- gdb/testsuite/gdb.dwarf2/loclists-start-end.exp | 2 +- gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp | 2 +- gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp | 2 +- gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp index 250f479e0274..9432415fdd0d 100644 --- a/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp +++ b/gdb/testsuite/gdb.dwarf2/debug-aranges-duplicate-offset-warning.exp @@ -59,11 +59,11 @@ Dwarf::assemble $asm_file { save_vars { GDBFLAGS } { append GDBFLAGS " -iex \"maint set dwarf synchronous on\"" if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } } set readnow_p [readnow] diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp index fa3bf5f4b3e0..1be466f513c7 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp @@ -23,11 +23,11 @@ load_lib dwarf.exp require dwarf2_support standard_testfile .c -dw.S if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { - return -1 + return } # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp index 7f9f9464aaf5..e6859159c291 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp @@ -44,11 +44,11 @@ set command "$objcopy_program -N block_start -N block_end -N break_at ${binfile} verbose -log "Executing: $command" set result [catch {exec {*}$command} output] verbose "result is $result" verbose "output is $output" if {$result != 0} { - return -1 + return } gdb_load ${binfile_stripped} if {![runto "*${break_at}"]} { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp index 294e7c8bf45f..8032f71c7d9c 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp @@ -93,11 +93,11 @@ gdb_test "frame" ".*main \\\(\\\) at \[^\r\n\]*:$prologue_end_line\r\n.*" with_test_prefix "ignore-prologue-end" { clean_restart $::testfile gdb_test_no_output "maintenance set ignore-prologue-end-flag on" if {![runto_main]} { - return -1 + return } # If we ignore the prologue-end flag, we should stop at the first statement # of main which assigns m. set prologue_end_line [gdb_get_line_number "main assign m"] diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp index 6d3bf29c1b10..94afa35f5588 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp @@ -25,16 +25,16 @@ standard_testfile main.c # First check whether we can actually handle the non-symlink case. with_test_prefix non-symlink { if { [prepare_for_testing "failed to prepare" "${testfile}" \ [list ${srcfile}]] } { - return -1 + return } if { [ensure_gdb_index $binfile] == -1 } { untested "error adding gdb index" - return -1 + return } } # Regenerate exec without index. if { [prepare_for_testing "failed to prepare" "${testfile}" \ diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp index 456d7266c599..6ff1209ad1b6 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp @@ -115,11 +115,11 @@ gdb_test_multiple $cmd $test { } -re "(Psymtabs|Cooked).*${gdb_prompt} $" { lassign [local_add_gdb_index $binfile] binfile_with_index host_binfile_with_index set testfile_with_index [file tail $binfile_with_index] if { ${binfile_with_index} == "" } { - return -1 + return } } -re ".*${gdb_prompt} $" { fail "unrecognized symbol reader" } diff --git a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp index f2a244791d16..edfcb8842d10 100644 --- a/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp +++ b/gdb/testsuite/gdb.dwarf2/loc-sec-offset.exp @@ -95,11 +95,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp index a822f0c2f2e9..e2bacbcb8dc0 100644 --- a/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp +++ b/gdb/testsuite/gdb.dwarf2/loclists-multiple-cus.exp @@ -122,11 +122,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp index b80639b32ddd..bc64b7adabd4 100644 --- a/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp +++ b/gdb/testsuite/gdb.dwarf2/loclists-sec-offset.exp @@ -210,11 +210,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp index f40d6fd8ec5c..c8d9f123625f 100644 --- a/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp +++ b/gdb/testsuite/gdb.dwarf2/loclists-start-end.exp @@ -113,11 +113,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } if { ![runto_main] } { return } diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp index d005c8b907cc..e48eb39f3a59 100644 --- a/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp +++ b/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp @@ -90,11 +90,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } # Sanity checks to make sure GDB slurped the symbols correctly. gdb_test "p/x &foo" " = 0x3000" } diff --git a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp index bbfc9e35c646..6207e31b9d0f 100644 --- a/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp +++ b/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp @@ -129,11 +129,11 @@ foreach_with_prefix is_64 {false true} { } } if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } # Sanity checks to make sure GDB slurped the symbols correctly. gdb_test "p/x &foo" " = 0x4000" gdb_test "p/x &bar" " = 0x5000" diff --git a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp index 4218dd119470..28a2fd7ad58c 100644 --- a/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp +++ b/gdb/testsuite/gdb.dwarf2/struct-with-sig-2.exp @@ -122,11 +122,11 @@ Dwarf::assemble $asm_file { save_vars { GDBFLAGS } { append GDBFLAGS " -iex \"maint set dwarf synchronous on\"" if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile $asm_file] {nodebug}] } { - return -1 + return } } set re "DWARF Error: .debug_types section not supported in dwz file" gdb_assert { [regexp $re $gdb_file_cmd_msg] } "Dwarf Error message"