aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorLancelot SIX <lancelot.six@amd.com>2022-04-01 11:59:29 +0100
committerLancelot SIX <lancelot.six@amd.com>2022-04-04 23:03:32 +0100
commit6109f7a39eb956a4121875630895669cece178e8 (patch)
tree9ed947e4bf5a59faa744137f4ccbf58bcf60d71f /gdb/testsuite
parentcc96ae7f8839bd63a943751d52af94db3b956c1f (diff)
downloadgdb-6109f7a39eb956a4121875630895669cece178e8.zip
gdb-6109f7a39eb956a4121875630895669cece178e8.tar.gz
gdb-6109f7a39eb956a4121875630895669cece178e8.tar.bz2
gdb: Add maint set ignore-prologue-end-flag
The previous patch added support for the DWARF prologue-end flag in line table. This flag can be used by DWARF producers to indicate where to place breakpoints past a function prologue. However, this takes precedence over prologue analyzers. So if we have to debug a program with erroneous debug information, the overall debugging experience will be degraded. This commit proposes to add a maintenance command to instruct GDB to ignore the prologue_end flag. Tested on x86_64-gnu-linux. Change-Id: Idda6d1b96ba887f4af555b43d9923261b9cc6f82
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
index 0de13ae..b5f8bcc 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-prologue-end.exp
@@ -89,3 +89,17 @@ if ![runto_main] {
set prologue_end_line [gdb_get_line_number "main assign o"]
gdb_test "frame" ".*main \\\(\\\) at \[^\r\n\]*:$prologue_end_line\r\n.*"
+
+with_test_prefix "ignore-prologue-end" {
+ clean_restart $binfile
+ gdb_test_no_output "maintenance set ignore-prologue-end-flag on"
+
+ if ![runto_main] {
+ return -1
+ }
+
+ # If we ignore the prologue-end flag, we should stop at the first statement
+ # of main which assigns m.
+ set prologue_end_line [gdb_get_line_number "main assign m"]
+ gdb_test "frame" ".*main \\\(\\\) at \[^\r\n\]*:$prologue_end_line\r\n.*"
+}