emit to indicate where a breakpoint should be placed to break in a function
past its prologue.
+* New commands
+
+maintenance set ignore-prologue-end-flag on|off
+maintenance show ignore-prologue-end-flag
+ This setting, which is off by default, controls whether GDB ignores the
+ PROLOGUE-END flag from the line-table when skipping prologue. This can be
+ used to force GDB to use prologue analyzers if the line-table is constructed
+ from erroneous debug information.
+
* Changed commands
maintenance info line-table
flush-symbol-cache} is deprecated in favor of @code{maint flush
symbol-cache}..
+@kindex maint set ignore-prologue-end-flag
+@cindex prologue-end
+@item maint set ignore-prologue-end-flag [on|off]
+Enable or disable the use of the @samp{PROLOGUE-END} flag from the line-table.
+When @samp{off} (the default), @value{GDBN} uses the @samp{PROLOGUE-END} flag
+to place breakpoints past the end of a function prologue. When @samp{on},
+@value{GDBN} ignores the flag and relies on prologue analyzers to skip function
+prologues.
+
+@kindex maint show ignore-prologue-end-flag
+@item maint show ignore-prologue-end-flag
+Show whether @value{GDBN} will ignore the @samp{PROLOGUE-END} flag.
+
@end table
@node Altering
};
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 *
/* 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);
&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);
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.*"
+}