diff options
author | Lancelot SIX <lancelot.six@amd.com> | 2022-04-01 11:59:29 +0100 |
---|---|---|
committer | Lancelot SIX <lancelot.six@amd.com> | 2022-04-04 23:03:32 +0100 |
commit | 6109f7a39eb956a4121875630895669cece178e8 (patch) | |
tree | 9ed947e4bf5a59faa744137f4ccbf58bcf60d71f /gdb/symtab.c | |
parent | cc96ae7f8839bd63a943751d52af94db3b956c1f (diff) | |
download | binutils-gdb-6109f7a39eb956a4121875630895669cece178e8.tar.gz |
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/symtab.c')
-rw-r--r-- | gdb/symtab.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 57a55a5e0e8..4204423cb25 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -288,6 +288,10 @@ static const char *const multiple_symbols_modes[] = }; static const char *multiple_symbols_mode = multiple_symbols_all; +/* When TRUE, ignore the prologue-end flag in linetable_entry when searching + for the SAL past a function prologue. */ +static bool ignore_prologue_end_flag = false; + /* Read-only accessor to AUTO_SELECT_MODE. */ const char * @@ -3941,7 +3945,7 @@ skip_prologue_sal (struct symtab_and_line *sal) /* Check if the compiler explicitly indicated where a breakpoint should be placed to skip the prologue. */ - if (skip) + if (!ignore_prologue_end_flag && skip) { gdb::optional<CORE_ADDR> linetable_pc = skip_prologue_using_linetable (pc); @@ -7113,6 +7117,19 @@ If zero then the symbol cache is disabled."), &maintenance_set_cmdlist, &maintenance_show_cmdlist); + add_setshow_boolean_cmd ("ignore-prologue-end-flag", no_class, + &ignore_prologue_end_flag, + _("Set if the PROLOGUE-END flag is ignored."), + _("Show if the PROLOGUE-END flag is ignored."), + _("\ +The PROLOGUE-END flag from the line-table entries is used to place \ +breakpoints past the prologue of functions. Disabeling its use use forces \ +the use of prologue scanners."), + nullptr, nullptr, + &maintenance_set_cmdlist, + &maintenance_show_cmdlist); + + add_cmd ("symbol-cache", class_maintenance, maintenance_print_symbol_cache, _("Dump the symbol cache for each program space."), &maintenanceprintlist); |