From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 3/7] Minor fixes to make gdb.objc tests pass
Date: Sun, 16 Nov 2025 18:27:02 -0700 [thread overview]
Message-ID: <20251117012752.2657208-4-tom@tromey.com> (raw)
In-Reply-To: <20251117012752.2657208-1-tom@tromey.com>
Once the gdb.objc tests compile, you can see that they do not pass.
The issue is primarily that they are over-strict about line numbers.
This fixes the problem by replacing these line numbers with $decimal.
---
gdb/testsuite/gdb.objc/basicclass.exp | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/gdb/testsuite/gdb.objc/basicclass.exp b/gdb/testsuite/gdb.objc/basicclass.exp
index d1fb64a42de..2be5b2e83ef 100644
--- a/gdb/testsuite/gdb.objc/basicclass.exp
+++ b/gdb/testsuite/gdb.objc/basicclass.exp
@@ -89,36 +89,36 @@ do_objc_tests
gdb_test "set breakpoint pending off" "" "set breakpoint pending"
gdb_test "break doIt" \
- "Breakpoint.*at.* file .*$srcfile, line.29.*" \
+ "Breakpoint.*at.* file .*$srcfile, line $decimal.*" \
"breakpoint method"
gdb_test "break takeArg:" \
- "Breakpoint.*at.* file .*$srcfile, line.34.*" \
+ "Breakpoint.*at.* file .*$srcfile, line $decimal.*" \
"breakpoint method with colon"
gdb_test "break newWithArg:" \
- "Breakpoint.*at.* file .*$srcfile, line.22.*" \
+ "Breakpoint.*at.* file .*$srcfile, line $decimal.*" \
"breakpoint class method with colon"
#
# Continue until breakpoint (test re-setting breakpoint)
#
gdb_test continue \
- "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:34.*" \
+ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:$decimal.*" \
"continue until method breakpoint"
#
# Test resetting breakpoints when re-running program
#
gdb_run_cmd
-gdb_test "" "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*" "resetting breakpoints when rerunning"
+gdb_test "" "Breakpoint .+,.*main .*argc.*argv.* at .*$srcfile:.*" "resetting breakpoints when rerunning"
#
# Continue until breakpoint (test re-setting breakpoint)
#
gdb_test continue \
- "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:34.*" \
- "continue until method breakpoint"
+ "Continuing\\..*Breakpoint .+, -.BasicClass takeArg:. \\(self=.*, _cmd=.*, arg=.*\\) at .*$srcfile:$decimal.*" \
+ "continue until method breakpoint again"
#
# Test printing objects
@@ -139,7 +139,7 @@ gdb_test "print \*self" \
# Break in a category
#
gdb_test "break hiddenMethod" \
- "Breakpoint.*at.* file .*$srcfile, line.61." \
+ "Breakpoint.*at.* file .*$srcfile, line $decimal." \
"breakpoint in category method"
@@ -147,7 +147,7 @@ gdb_test "break hiddenMethod" \
# Continue until breakpoint (test re-setting category breakpoint)
#
gdb_test continue \
- "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass\\(Private\\) hiddenMethod. \\(self=.*, _cmd=.*\\) at .*$srcfile:61.*" \
+ "Continuing\\..*Breakpoint \[0-9\]+, -.BasicClass\\(Private\\) hiddenMethod. \\(self=.*, _cmd=.*\\) at .*$srcfile:$decimal.*" \
"continue until category method"
#
--
2.49.0
next prev parent reply other threads:[~2025-11-17 1:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 1:26 [PATCH 0/7] Objective-C fixes Tom Tromey
2025-11-17 1:27 ` [PATCH 1/7] Reformat gdb.objc tests Tom Tromey
2025-11-17 1:27 ` [PATCH 2/7] Make the gdb.objc tests compile Tom Tromey
2025-11-17 10:09 ` Matt Rice
2025-11-18 0:51 ` Tom Tromey
2025-11-18 1:12 ` Matt Rice
2025-12-02 16:20 ` Tom Tromey
2025-12-03 15:24 ` Matt Rice
2025-11-17 1:27 ` Tom Tromey [this message]
2025-11-17 1:27 ` [PATCH 4/7] Rename lookup_struct_typedef Tom Tromey
2025-11-17 1:27 ` [PATCH 5/7] Remove a couple Objective-C expression helpers Tom Tromey
2025-11-17 1:27 ` [PATCH 6/7] Avoid crash with "NSString" literals Tom Tromey
2025-11-17 1:27 ` [PATCH 7/7] Rewrite the @selector code Tom Tromey
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=20251117012752.2657208-4-tom@tromey.com \
--to=tom@tromey.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