From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 3/4] [gdb/testsuite] Fix end_sequence addresses
Date: Mon, 8 Apr 2024 14:04:44 +0200 [thread overview]
Message-ID: <20240408120445.12544-3-tdevries@suse.de> (raw)
In-Reply-To: <20240408120445.12544-1-tdevries@suse.de>
I noticed in test-case gdb.reverse/map-to-same-line.exp, that the end of main:
...
00000000004102c4 <end_of_sequence>:
4102c4: 52800000 mov w0, #0x0 // #0
4102c8: 9100c3ff add sp, sp, #0x30
4102cc: d65f03c0 ret
...
is not described by the line table:
...
File name Line number Starting address View Stmt
...
map-to-same-line.c 54 0x4102ac x
map-to-same-line.c - 0x4102c4
...
Fix this by ending the line table at $main_end.
Likewise in a few other test-cases, found using:
...
$ find gdb/testsuite/ -type f \
| xargs grep -B1 DW_LNE_end_sequence \
| grep set_address \
| egrep -v "_end|_len"
...
Tested on aarch64-linux.
---
gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp | 2 +-
| 2 +-
| 2 +-
| 2 +-
gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp | 7 +++++--
gdb/testsuite/gdb.dwarf2/dw2-lines.exp | 2 +-
gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp | 4 +++-
gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl | 2 +-
gdb/testsuite/gdb.reverse/map-to-same-line.c | 1 -
gdb/testsuite/gdb.reverse/map-to-same-line.exp | 3 ++-
10 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp
index 1880f4cb7fb..5d6e13a9ae0 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp
@@ -70,7 +70,7 @@ Dwarf::assemble $asm_file {
line [line_for bar_label]
DW_LNS_copy
- DW_LNE_set_address bar_label_2
+ DW_LNE_set_address $bar_end
DW_LNE_end_sequence
}
}
--git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
index 6d12e968f41..1f30c5c3316 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp
@@ -146,7 +146,7 @@ proc do_test { start_label func_name tag } {
DW_LNS_advance_line 1
DW_LNS_copy
- DW_LNE_set_address line_label_7
+ DW_LNE_set_address "$main_start + $main_len"
DW_LNE_end_sequence
}
}
--git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
index 6a5f7d6dd76..68f1fc83859 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp
@@ -134,7 +134,7 @@ Dwarf::assemble $asm_file {
DW_LNS_advance_line 1
DW_LNS_copy
- DW_LNE_set_address line_label_7
+ DW_LNE_set_address "$main_start + $main_len"
DW_LNE_end_sequence
}
}
--git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
index b3db154db25..1b8d136e70e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp
@@ -123,7 +123,7 @@ Dwarf::assemble $asm_file {
DW_LNS_negate_stmt
DW_LNS_copy
- DW_LNE_set_address line_label_7
+ DW_LNE_set_address "$main_start + $main_len"
DW_LNE_end_sequence
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
index 603a616930a..c510de42037 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
@@ -27,6 +27,9 @@ Dwarf::assemble $asm_file {
declare_labels Llines
global srcdir subdir srcfile
+ get_func_info bar1
+ get_func_info bar2
+
cu {} {
compile_unit {
{language @DW_LANG_C}
@@ -69,7 +72,7 @@ Dwarf::assemble $asm_file {
line 33
DW_LNS_copy
- DW_LNE_set_address bar1_label_5
+ DW_LNE_set_address $bar1_end
DW_LNE_end_sequence
@@ -91,7 +94,7 @@ Dwarf::assemble $asm_file {
line 47
DW_LNS_copy
- DW_LNE_set_address bar2_label_5
+ DW_LNE_set_address $bar2_end
DW_LNE_end_sequence
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
index 5fd6ae04d38..85d5e9c8afb 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp
@@ -104,7 +104,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} {
line [line_for bar_label_4]
DW_LNS_copy
- DW_LNE_set_address bar_label_5
+ DW_LNE_set_address "$main_start + $main_len"
DW_LNE_end_sequence
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
index 671e3e634ac..5a0705fc613 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
@@ -30,6 +30,8 @@ Dwarf::assemble $asm_file {
set DW_LNE_lo_usr 0x80
set DW_LNE_hi_usr 0xff
+ get_func_info main
+
cu {} {
compile_unit {
{language @DW_LANG_C}
@@ -54,7 +56,7 @@ Dwarf::assemble $asm_file {
DW_LNE_user 2 $DW_LNE_hi_usr
DW_LNS_copy
- DW_LNE_set_address main_label_2
+ DW_LNE_set_address $main_end
DW_LNE_end_sequence
}
}
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
index 968378620a0..5817b2b0f53 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl
@@ -110,7 +110,7 @@ Dwarf::assemble $asm_file {
DW_LNS_negate_stmt
DW_LNS_copy
- DW_LNE_set_address line_label_7
+ DW_LNE_set_address "$func_start + $func_len"
DW_LNE_end_sequence
}
}
diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c
index 45e7ffb0f06..7185955f40a 100644
--- a/gdb/testsuite/gdb.reverse/map-to-same-line.c
+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c
@@ -53,6 +53,5 @@ main (void)
asm ("main_return: .globl main_return");
k = j; f3 = f2; str_3 = str_2; /* TAG: main return */
- asm ("end_of_sequence: .globl end_of_sequence");
return 0; /* TAG: main return */
}
diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp
index b556e7cb676..067fe012702 100644
--- a/gdb/testsuite/gdb.reverse/map-to-same-line.exp
+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp
@@ -100,7 +100,8 @@ Dwarf::assemble $asm_file {
DW_LNE_set_address main_return
line [gdb_get_line_number "TAG: main return"]
DW_LNS_copy
- DW_LNE_set_address end_of_sequence
+
+ DW_LNE_set_address $main_end
DW_LNE_end_sequence
}
}
--
2.35.3
next prev parent reply other threads:[~2024-04-08 12:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 12:04 [PATCH v2 1/4] [gdb/testsuite] Require address update for DW_LNE_end_sequence Tom de Vries
2024-04-08 12:04 ` [PATCH v2 2/4] [gdb/testsuite] Require address update for DW_LNS_copy Tom de Vries
2024-04-08 12:04 ` Tom de Vries [this message]
2024-04-24 17:45 ` [PATCH v2 3/4] [gdb/testsuite] Fix end_sequence addresses Carl Love
2024-04-24 18:07 ` Carl Love
2024-04-24 18:28 ` Carl Love
2024-04-24 21:07 ` Tom de Vries
2024-04-25 17:05 ` Carl Love
2024-04-25 20:46 ` Tom de Vries
2024-04-08 12:04 ` [PATCH v2 4/4] [gdb/testsuite] Require DW_LNE_end_sequence Tom de Vries
2024-04-17 10:58 ` [PATCH v2 1/4] [gdb/testsuite] Require address update for DW_LNE_end_sequence Tom de Vries
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=20240408120445.12544-3-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).