diff options
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 7ab98df..8978c8a 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1,6 +1,6 @@ /* Memory-access and commands for "inferior" process, for GDB. - Copyright (C) 1986-2024 Free Software Foundation, Inc. + Copyright (C) 1986-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -224,14 +224,11 @@ strip_bg_char (const char *args, int *bg_char_p) return make_unique_xstrdup (args); } -/* Common actions to take after creating any sort of inferior, by any - means (running, attaching, connecting, et cetera). The target - should be stopped. */ +/* See inferior.h. */ void -post_create_inferior (int from_tty) +post_create_inferior (int from_tty, bool set_pspace_solib_ops) { - /* Be sure we own the terminal in case write operations are performed. */ target_terminal::ours_for_output (); @@ -261,6 +258,10 @@ post_create_inferior (int from_tty) throw; } + if (set_pspace_solib_ops) + current_program_space->set_solib_ops + (gdbarch_make_solib_ops (current_inferior ()->arch ())); + if (current_program_space->exec_bfd ()) { const unsigned solib_add_generation @@ -482,7 +483,7 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how) /* Pass zero for FROM_TTY, because at this point the "run" command has done its thing; now we are setting up the running program. */ - post_create_inferior (0); + post_create_inferior (0, true); /* Queue a pending event so that the program stops immediately. */ if (run_how == RUN_STOP_AT_FIRST_INSN) @@ -2506,7 +2507,7 @@ setup_inferior (int from_tty) /* Take any necessary post-attaching actions for this platform. */ target_post_attach (inferior_ptid.pid ()); - post_create_inferior (from_tty); + post_create_inferior (from_tty, true); } /* What to do after the first program stops after attaching. */ @@ -3080,9 +3081,7 @@ use \"set args\" without arguments.\n\ \n\ To start the inferior without using a shell, use \"set startup-with-shell off\"." -void _initialize_infcmd (); -void -_initialize_infcmd () +INIT_GDB_FILE (infcmd) { static struct cmd_list_element *info_proc_cmdlist; struct cmd_list_element *c = nullptr; |