* [PATCH] [gdb/testsuite] Speed up gdb.base/tls-dlobj.exp
@ 2026-01-10 9:52 Tom de Vries
2026-01-14 18:26 ` Kevin Buettner
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2026-01-10 9:52 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] [gdb/testsuite] Speed up gdb.base/tls-dlobj.exp
2026-01-10 9:52 [PATCH] [gdb/testsuite] Speed up gdb.base/tls-dlobj.exp Tom de Vries
@ 2026-01-14 18:26 ` Kevin Buettner
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Buettner @ 2026-01-14 18:26 UTC (permalink / raw)
To: gdb-patches
On Sat, 10 Jan 2026 10:52:24 +0100
Tom de Vries <tdevries@suse.de> wrote:
> 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.
I like this better than the earlier approach.
Approved-by: Kevin Buettner <kevinb@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-14 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-10 9:52 [PATCH] [gdb/testsuite] Speed up gdb.base/tls-dlobj.exp Tom de Vries
2026-01-14 18:26 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox