Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/4] [gdb/testsuite] Speed up gdb.python/py-rbreak.exp
Date: Wed, 16 Sep 2026 11:52:43 +0200	[thread overview]
Message-ID: <20260916095243.3040533-5-tdevries@suse.de> (raw)
In-Reply-To: <20260916095243.3040533-1-tdevries@suse.de>

I noticed that gdb.python/py-rbreak.exp does:
...
if {![runto_main]} {
    return
}

gdb_test_no_output "nosharedlibrary"
...

Speed up the test-case by not running to main.

This breaks the gdb.lookup_symbol("efunc1") call, which requires a current
frame, so use lookup_global_symbol instead.

Also remove the nosharedlibrary command.  No longer running to main means we
no longer load symbols for shared libraries, so the nosharedlibrary that drops
those symbols is no longer required.
---
 gdb/testsuite/gdb.python/py-rbreak.exp | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-rbreak.exp b/gdb/testsuite/gdb.python/py-rbreak.exp
index 395a603ef4e..a1ca7d4283d 100644
--- a/gdb/testsuite/gdb.python/py-rbreak.exp
+++ b/gdb/testsuite/gdb.python/py-rbreak.exp
@@ -26,12 +26,6 @@ if {[prepare_for_testing "failed to prepare" ${testfile} [list $srcfile $srcfile
     return 1
 }
 
-if {![runto_main]} {
-    return
-}
-
-gdb_test_no_output "nosharedlibrary"
-
 gdb_py_test_silent_cmd {py sl = gdb.rbreak("",minsyms=False)} \
     "get all function breakpoints" 0
 set min_breakpoints 11
@@ -65,9 +59,9 @@ gdb_py_test_silent_cmd {py sl = gdb.rbreak("func1",minsyms=True)} \
 gdb_test "py print(len(sl))" "2" \
     "check number of returned breakpoints is 2"
 
-gdb_py_test_silent_cmd {python sym = gdb.lookup_symbol("efunc1")} \
+gdb_py_test_silent_cmd {python sym = gdb.lookup_global_symbol("efunc1")} \
     "find a symbol in objfile" 1
-gdb_py_test_silent_cmd {python symtab = sym[0].symtab} \
+gdb_py_test_silent_cmd {python symtab = sym.symtab} \
     "get backing symbol table" 1
 gdb_py_test_silent_cmd \
     [subst_vars \
-- 
2.51.0


      parent reply	other threads:[~2026-09-16  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  9:52 [PATCH 0/4] [gdb/testsuite] Fixes in gdb.python/py-rbreak.exp Tom de Vries
2026-09-16  9:52 ` [PATCH 1/4] [gdb/testsuite] Use strict regexp " Tom de Vries
2026-09-16  9:52 ` [PATCH 2/4] [gdb/testsuite] Make gdb.python/py-rbreak.exp more readable Tom de Vries
2026-09-16  9:52 ` [PATCH 3/4] [gdb/testsuite] Fix test name in gdb.python/py-rbreak.exp Tom de Vries
2026-09-16  9:52 ` Tom de Vries [this message]

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=20260916095243.3040533-5-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