mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-26 07:19:16 +08:00
Read Ada main name from executable, not inferior
An upstream bug report points out this bug: if the user switches from one Ada executable to another without "kill"ing the inferior, then the "start" command will fail. What happens here is that the Ada "main" name is found in a constant string in the executable. But, if the inferior is running, then the process_stratum target reads from the inferior memory. This patch fixes the problem by changing the main name code to set trust-readonly-sections, causing the target stack to read from the executable instead. I looked briefly at changing GNAT to emit DW_AT_main_subprogram instead, but this looks to be pretty involved. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25811
This commit is contained in:
@ -116,10 +116,9 @@ static struct target_ops *the_debug_target;
|
||||
|
||||
static struct cmd_list_element *targetlist = NULL;
|
||||
|
||||
/* True if we should trust readonly sections from the
|
||||
executable when reading memory. */
|
||||
/* See target.h. */
|
||||
|
||||
static bool trust_readonly = false;
|
||||
bool trust_readonly = false;
|
||||
|
||||
/* Nonzero if we should show true memory content including
|
||||
memory breakpoint inserted by gdb. */
|
||||
|
Reference in New Issue
Block a user