public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Guinevere Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Cc: Guinevere Larsen <blarsen@redhat.com>
Subject: [PATCH 1/2] gdb/testsuite: fix gdb.threads/threadcrash.exp on 32-bit arm targets
Date: Thu,  1 Feb 2024 16:58:12 +0100	[thread overview]
Message-ID: <20240201155812.1189388-3-blarsen@redhat.com> (raw)
In-Reply-To: <20240201155812.1189388-2-blarsen@redhat.com>

There are 2 issues with the test gdb.threads/threadcrash.exp on arm
targets, both relating to issues in how the targets handles gcores. The
first is that the test fails to cout the number of threads in the
inferior and the second is that GDB can't properly backtrace from a
gcore.

The first error is fixed on this commit by getting the convenience
variable _inferior_thread_count as opposed to calculating it based on
the output of "info threads"

For the second, this test just emits a single xfail referring back to PR
corefiles/31294, which tracks the issues with gcores in 32-bit arm
targets.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31294
---
 gdb/testsuite/gdb.threads/threadcrash.exp | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index d3e3494cbea..362c4c5879d 100644
--- a/gdb/testsuite/gdb.threads/threadcrash.exp
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -27,12 +27,9 @@
 proc test_thread_count {} {
     set thread_count 0
 
-    gdb_test_multiple "info threads" "getting thread count" -lbl {
-	-re "\(Thread\|LWP\)" {
-	    incr thread_count
-	    exp_continue
-	}
-	-re "$::gdb_prompt " {
+    gdb_test_multiple "print \$_inferior_thread_count" "getting thread count" {
+	-re ".* = (\[0-9]+).*" {
+	    set thread_count $expect_out(1,string)
 	    gdb_assert {$thread_count == 7}
 	}
     }
@@ -230,4 +227,8 @@ test_live_inferior
 
 test_corefile
 
-test_gcore
+if { [is_aarch32_target] } {
+    xfail "gcore tests fail on 32-bit arm, see PR corefiles/31294"
+} else {
+    test_gcore
+}
-- 
2.43.0


  reply	other threads:[~2024-02-02  9:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 15:58 [PATCH 0/2] Fixes to gdb.threads/threadcrash.exp Guinevere Larsen
2024-02-01 15:58 ` Guinevere Larsen [this message]
2024-02-02 12:04   ` [PATCH 1/2] gdb/testsuite: fix gdb.threads/threadcrash.exp on 32-bit arm targets Tom de Vries
2024-02-01 15:58 ` [PATCH 2/2] gdb/testsuite: reduce gdb.threads/threadcrash.exp reliance on libc symbols Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201155812.1189388-3-blarsen@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).