public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix regression in stabs debug info
@ 2023-04-04 17:59 Thiago Jung Bauermann
  2023-04-04 17:59 ` [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c Thiago Jung Bauermann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thiago Jung Bauermann @ 2023-04-04 17:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

This fixes the regression I reported last week¹. It turned out to be a
simple change.

One thing that surprised my was that the testcase used the stabs debug
format. I don't think it's a good format to use anymore, so there's an
additional patch to change the testcase to let the assembler choose the
preferred debug format.

Regression-tested on native aarch64-linux.

¹ https://inbox.sourceware.org/gdb-patches/871ql6dhf4.fsf@linaro.org/

Thiago Jung Bauermann (2):
  gdb: Fix reading of partial symtabs in dbxread.c
  gdb/testsuite: Default to assembler's preferred debug format in
    asm-source.exp

 gdb/dbxread.c                        | 6 +++---
 gdb/testsuite/gdb.asm/asm-source.exp | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)


base-commit: d466f7492eccccb0f3c0936c12b5b140e139e353

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c
  2023-04-04 17:59 [PATCH 0/2] Fix regression in stabs debug info Thiago Jung Bauermann
@ 2023-04-04 17:59 ` Thiago Jung Bauermann
  2023-04-04 17:59 ` [PATCH 2/2] gdb/testsuite: Default to assembler's preferred debug format in asm-source.exp Thiago Jung Bauermann
  2023-04-04 18:32 ` [PATCH 0/2] Fix regression in stabs debug info Tom Tromey
  2 siblings, 0 replies; 5+ messages in thread
From: Thiago Jung Bauermann @ 2023-04-04 17:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

After commit 9675da25357c ("Use unrelocated_addr in minimal symbols"),
aarch64-linux started failing gdb.asm/asm-source.exp:

Running /home/thiago.bauermann/src/binutils-gdb/gdb/testsuite/gdb.asm/asm-source.exp ...
PASS: gdb.asm/asm-source.exp: f at main
PASS: gdb.asm/asm-source.exp: n at main
PASS: gdb.asm/asm-source.exp: next over macro
FAIL: gdb.asm/asm-source.exp: step into foo2
PASS: gdb.asm/asm-source.exp: info target
PASS: gdb.asm/asm-source.exp: info symbol
PASS: gdb.asm/asm-source.exp: list
PASS: gdb.asm/asm-source.exp: search
FAIL: gdb.asm/asm-source.exp: f in foo2
FAIL: gdb.asm/asm-source.exp: n in foo2 (the program exited)
FAIL: gdb.asm/asm-source.exp: bt ALL in foo2
FAIL: gdb.asm/asm-source.exp: bt 2 in foo2
PASS: gdb.asm/asm-source.exp: s 2
PASS: gdb.asm/asm-source.exp: n 2
FAIL: gdb.asm/asm-source.exp: bt 3 in foo3
PASS: gdb.asm/asm-source.exp: info source asmsrc1.s
FAIL: gdb.asm/asm-source.exp: finish from foo3 (the program is no longer running)
FAIL: gdb.asm/asm-source.exp: info source asmsrc2.s
PASS: gdb.asm/asm-source.exp: info sources
FAIL: gdb.asm/asm-source.exp: info line
FAIL: gdb.asm/asm-source.exp: next over foo3 (the program is no longer running)
FAIL: gdb.asm/asm-source.exp: return from foo2
PASS: gdb.asm/asm-source.exp: look at global variable
PASS: gdb.asm/asm-source.exp: x/i &globalvar
PASS: gdb.asm/asm-source.exp: disassem &globalvar, (int *) &globalvar+1
PASS: gdb.asm/asm-source.exp: look at static variable
PASS: gdb.asm/asm-source.exp: x/i &staticvar
PASS: gdb.asm/asm-source.exp: disassem &staticvar, (int *) &staticvar+1
PASS: gdb.asm/asm-source.exp: look at static function

The problem is simple: a pair of parentheses was removed from the
expression calculating text_end and thus text_size was only added if
lowest_text_address wasn't equal to -1.

This patch restores the previous behaviour and fixes the testcase.
Tested on native aarch64-linux.
---
 gdb/dbxread.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index f7c44c14ae2e..73371edd8412 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1950,9 +1950,9 @@ read_dbx_symtab (minimal_symbol_reader &reader,
 	 is.  */
       unrelocated_addr text_end
 	= (unrelocated_addr
-	   (lowest_text_address == (unrelocated_addr) -1
-	    ? text_addr
-	    : CORE_ADDR (lowest_text_address)
+	   ((lowest_text_address == (unrelocated_addr) -1
+	     ? text_addr
+	     : CORE_ADDR (lowest_text_address))
 	    + text_size));
 
       dbx_end_psymtab (objfile, partial_symtabs,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] gdb/testsuite: Default to assembler's preferred debug format in asm-source.exp
  2023-04-04 17:59 [PATCH 0/2] Fix regression in stabs debug info Thiago Jung Bauermann
  2023-04-04 17:59 ` [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c Thiago Jung Bauermann
@ 2023-04-04 17:59 ` Thiago Jung Bauermann
  2023-04-04 18:32 ` [PATCH 0/2] Fix regression in stabs debug info Tom Tromey
  2 siblings, 0 replies; 5+ messages in thread
From: Thiago Jung Bauermann @ 2023-04-04 17:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thiago Jung Bauermann

The stabs debug format is obsolete and there's no reason to think that
toolchains still have good support for it. Therefore, if a specific debug
format wasn't set in asm-source.exp then leave it to the assembler to
decide which one to use.
---
 gdb/testsuite/gdb.asm/asm-source.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 41bb3d1e677f..af852b731f5e 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -212,7 +212,7 @@ if { [string equal ${asm-flags} ""] } {
 }
 
 if { [string equal ${debug-flags} ""] } {
-    set debug-flags "-gstabs"
+    set debug-flags "-g"
 }
 
 # Allow the target board to override the debug flags.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix regression in stabs debug info
  2023-04-04 17:59 [PATCH 0/2] Fix regression in stabs debug info Thiago Jung Bauermann
  2023-04-04 17:59 ` [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c Thiago Jung Bauermann
  2023-04-04 17:59 ` [PATCH 2/2] gdb/testsuite: Default to assembler's preferred debug format in asm-source.exp Thiago Jung Bauermann
@ 2023-04-04 18:32 ` Tom Tromey
  2023-04-05 20:32   ` Thiago Jung Bauermann
  2 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2023-04-04 18:32 UTC (permalink / raw)
  To: Thiago Jung Bauermann via Gdb-patches; +Cc: Thiago Jung Bauermann

>>>>> "Thiago" == Thiago Jung Bauermann via Gdb-patches <gdb-patches@sourceware.org> writes:

Thiago> This fixes the regression I reported last week¹. It turned out to be a
Thiago> simple change.

Thiago> One thing that surprised my was that the testcase used the stabs debug
Thiago> format. I don't think it's a good format to use anymore, so there's an
Thiago> additional patch to change the testcase to let the assembler choose the
Thiago> preferred debug format.

Thank you.  These are ok.

Reviewed-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix regression in stabs debug info
  2023-04-04 18:32 ` [PATCH 0/2] Fix regression in stabs debug info Tom Tromey
@ 2023-04-05 20:32   ` Thiago Jung Bauermann
  0 siblings, 0 replies; 5+ messages in thread
From: Thiago Jung Bauermann @ 2023-04-05 20:32 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Thiago Jung Bauermann via Gdb-patches


Tom Tromey <tom@tromey.com> writes:

>>>>>> "Thiago" == Thiago Jung Bauermann via Gdb-patches <gdb-patches@sourceware.org>
> writes:
>
> Thiago> This fixes the regression I reported last week¹. It turned out to be a
> Thiago> simple change.
>
> Thiago> One thing that surprised my was that the testcase used the stabs debug
> Thiago> format. I don't think it's a good format to use anymore, so there's an
> Thiago> additional patch to change the testcase to let the assembler choose the
> Thiago> preferred debug format.
>
> Thank you.  These are ok.
>
> Reviewed-By: Tom Tromey <tom@tromey.com>

Pushed. Thanks!

-- 
Thiago

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-05 20:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 17:59 [PATCH 0/2] Fix regression in stabs debug info Thiago Jung Bauermann
2023-04-04 17:59 ` [PATCH 1/2] gdb: Fix reading of partial symtabs in dbxread.c Thiago Jung Bauermann
2023-04-04 17:59 ` [PATCH 2/2] gdb/testsuite: Default to assembler's preferred debug format in asm-source.exp Thiago Jung Bauermann
2023-04-04 18:32 ` [PATCH 0/2] Fix regression in stabs debug info Tom Tromey
2023-04-05 20:32   ` Thiago Jung Bauermann

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).