From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Speed up gdb.base/tls-dlobj.exp
Date: Sat, 10 Jan 2026 10:52:24 +0100 [thread overview]
Message-ID: <20260110095224.4041403-1-tdevries@suse.de> (raw)
In test-case gdb.base/tls-dlobj.exp we use breakpoints to step through the
executable. The breakpoints are used only once, but they are permanent, so we
end up with 11 breakpoints, 10 of which of the form $srcfile:$n.
The executable loads and unloads shared libraries, triggering solib events in
gdb, which will re-set the breakpoints.
Setting a breakpoint of the form $srcfile:$n triggers a filename search that
iterates over all CUs in all objfiles for which we have debuginfo.
In case glibc debuginfo is installed, and in case we have a slow gdb, for
instance because of building with -O0 and Address Sanitizer, this might become
noticeable.
While it's a good idea to try to speed up this search (see for instance
PR33781), measuring this speed is not the point of this test-case, so fix this
by making the breakpoints temporary.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.base/tls-dlobj.exp | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/testsuite/gdb.base/tls-dlobj.exp b/gdb/testsuite/gdb.base/tls-dlobj.exp
index 68c8b781473..2e1b5014541 100644
--- a/gdb/testsuite/gdb.base/tls-dlobj.exp
+++ b/gdb/testsuite/gdb.base/tls-dlobj.exp
@@ -57,7 +57,7 @@ proc gdb_test_with_xfail { cmd re cond} {
proc do_tests {force_internal_tls} {
clean_restart $::testfile
- if {![runto_main]} {
+ if {![runto main temporary]} {
return
}
@@ -65,7 +65,7 @@ proc do_tests {force_internal_tls} {
gdb_test_no_output "maint set force-internal-tls-address-lookup on"
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-1"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-1"] temporary
gdb_continue_to_breakpoint "main-breakpoint-1"
with_test_prefix "before assignments" {
@@ -100,7 +100,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-2"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-2"] temporary
gdb_continue_to_breakpoint "main-breakpoint-2"
with_test_prefix "at main-breakpoint-2" {
@@ -117,7 +117,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-3"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-3"] temporary
gdb_continue_to_breakpoint "main-breakpoint-3"
# At this point lib2 and lib3 have been unloaded. Also, TLS vars
@@ -137,7 +137,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-4"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-4"] temporary
gdb_continue_to_breakpoint "main-breakpoint-4"
# lib3 has been loaded again; lib2 is the only one not loaded.
@@ -157,7 +157,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-5"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-5"] temporary
gdb_continue_to_breakpoint "main-breakpoint-5"
# lib2 and lib3 are loaded; lib1 and lib4 are not.
@@ -177,7 +177,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-6"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-6"] temporary
gdb_continue_to_breakpoint "main-breakpoint-6"
# lib1, lib3 and lib4 are loaded; lib2 is not loaded.
@@ -197,7 +197,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-7"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-7"] temporary
gdb_continue_to_breakpoint "main-breakpoint-7"
# lib2 and lib3 are loaded; lib1 and lib4 are not.
@@ -217,7 +217,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-8"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-8"] temporary
gdb_continue_to_breakpoint "main-breakpoint-8"
# lib1, lib2, lib3, and lib4 are all loaded.
@@ -236,7 +236,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-9"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-9"] temporary
gdb_continue_to_breakpoint "main-breakpoint-9"
# lib2 is loaded; lib1, lib3, and lib4 are not.
@@ -255,7 +255,7 @@ proc do_tests {force_internal_tls} {
}
}
- gdb_breakpoint [gdb_get_line_number "main-breakpoint-10"]
+ gdb_breakpoint [gdb_get_line_number "main-breakpoint-10"] temporary
gdb_continue_to_breakpoint "main-breakpoint-10"
# lib3 and lib4 are loaded; lib1 and lib2 are not.
base-commit: fa20c3de21cd86a90dfe94328626ce6730df3a63
--
2.51.0
next reply other threads:[~2026-01-10 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-10 9:52 Tom de Vries [this message]
2026-01-14 18:26 ` Kevin Buettner
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=20260110095224.4041403-1-tdevries@suse.de \
--to=tdevries@suse.de \
--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