public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/31452] [gdb/testsuite] FAIL: gdb.python/py-format-address.exp: symbol_filename=on: gdb.format_address, result should have an offset
Date: Tue, 05 Mar 2024 23:38:47 +0000	[thread overview]
Message-ID: <bug-31452-4717-qhrQkXT8dD@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31452-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31452

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/testsuite/gdb.python/py-format-address.c
b/gdb/testsuite/gdb.python/py-format-address.c
index 2a0e9163db5..626bb41a220 100644
--- a/gdb/testsuite/gdb.python/py-format-address.c
+++ b/gdb/testsuite/gdb.python/py-format-address.c
@@ -28,5 +28,6 @@ FUNCTION_NAME (void)
 int
 main (void)
 {
-  return FUNCTION_NAME ();
+  int res = 0;
+  return res + FUNCTION_NAME ();
 }
diff --git a/gdb/testsuite/gdb.python/py-format-address.exp
b/gdb/testsuite/gdb.python/py-format-address.exp
index 8e7cf47e03a..0fd1e63b13f 100644
--- a/gdb/testsuite/gdb.python/py-format-address.exp
+++ b/gdb/testsuite/gdb.python/py-format-address.exp
@@ -40,7 +40,9 @@ if ![runto_main] {
 # for the program space and architecture (these will be selected based
 # on the current inferior).
 set main_addr [get_hexadecimal_valueof "&main" "UNKNOWN"]
-set next_addr [format 0x%x [expr $main_addr + 1]]
+
+gdb_test "next" "$decimal\[ \t\]+return .*"
+set next_addr [get_hexadecimal_valueof {$pc} "UNKNOWN"]

 foreach_with_prefix symbol_filename { on off } {
     gdb_test_no_output "set print symbol-filename ${symbol_filename}"
@@ -56,7 +58,7 @@ foreach_with_prefix symbol_filename { on off } {
        "gdb.format_address, result should have no offset"

     gdb_test "python print(\"Got: \" + gdb.format_address($next_addr))" \
-       "Got: $next_addr <main\\+1${filename_pattern}>" \
+       "Got: $next_addr <main\\+$decimal${filename_pattern}>" \
        "gdb.format_address, result should have an offset"
 }

...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

      reply	other threads:[~2024-03-05 23:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 23:37 [Bug testsuite/31452] New: " vries at gcc dot gnu.org
2024-03-05 23:38 ` vries at gcc dot gnu.org [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=bug-31452-4717-qhrQkXT8dD@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).