This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Remove wait_for_inferior's thread_exec_as_sigtrap parameter.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 9 May 2011 15:30:13 +0100
- Subject: Remove wait_for_inferior's thread_exec_as_sigtrap parameter.
The thread_exec_as_sigtrap parameter of wait_for_inferior
is no longer necessary, since unix targets startup doesn't go
through wait_for_inferior anymore. (fork-child.c:startup_inferior
takes care of handling SIGTRAPs and execs the same itself.)
Applied.
--
Pedro Alves
2011-05-09 Pedro Alves <pedro@codesourcery.com>
gdb/
* inferior.h (wait_for_inferior): Remove `thread_exec_as_sigtrap'
parameter.
* infrun.c (proceed, start_remote): Adjust.
(wait_for_inferior): Remove `thread_exec_as_sigtrap' parameter,
and adjust to not handle it.
* solib-irix.c (irix_solib_create_inferior_hook): Adjust.
* solib-osf.c (osf_solib_create_inferior_hook): Adjust.
* solib-sunos.c (sunos_solib_create_inferior_hook): Adjust.
* solib-svr4.c (svr4_solib_create_inferior_hook): Adjust.
* windows-nat.c (do_initial_windows_stuff): Adjust.
* infcmd.c (attach_command): Adjust.
(notice_new_inferior): Adjust.
---
gdb/infcmd.c | 4 ++--
gdb/inferior.h | 2 +-
gdb/infrun.c | 21 ++++-----------------
gdb/solib-irix.c | 2 +-
gdb/solib-osf.c | 2 +-
gdb/solib-sunos.c | 2 +-
gdb/solib-svr4.c | 2 +-
gdb/windows-nat.c | 2 +-
8 files changed, 12 insertions(+), 25 deletions(-)
Index: src/gdb/inferior.h
===================================================================
--- src.orig/gdb/inferior.h 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/inferior.h 2011-05-09 15:19:09.869463001 +0100
@@ -171,7 +171,7 @@ extern void address_to_signed_pointer (s
struct type *type, gdb_byte *buf,
CORE_ADDR addr);
-extern void wait_for_inferior (int treat_exec_as_sigtrap);
+extern void wait_for_inferior (void);
extern void prepare_for_detach (void);
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2011-05-09 15:13:20.109463002 +0100
+++ src/gdb/infrun.c 2011-05-09 15:19:09.879463001 +0100
@@ -2205,7 +2205,7 @@ proceed (CORE_ADDR addr, enum target_sig
does not support asynchronous execution. */
if (!target_can_async_p ())
{
- wait_for_inferior (0);
+ wait_for_inferior ();
normal_stop ();
}
}
@@ -2236,7 +2236,7 @@ start_remote (int from_tty)
target_open() return to the caller an indication that the target
is currently running and GDB state should be set to the same as
for an async run. */
- wait_for_inferior (0);
+ wait_for_inferior ();
/* Now that the inferior has stopped, do any bookkeeping like
loading shared libraries. We want to do this before normal_stop,
@@ -2604,18 +2604,13 @@ prepare_for_detach (void)
/* Wait for control to return from inferior to debugger.
- If TREAT_EXEC_AS_SIGTRAP is non-zero, then handle EXEC signals
- as if they were SIGTRAP signals. This can be useful during
- the startup sequence on some targets such as HP/UX, where
- we receive an EXEC event instead of the expected SIGTRAP.
-
If inferior gets a signal, we may decide to start it up again
instead of returning. That is why there is a loop in this function.
When this function actually returns it means the inferior
should be left stopped and GDB should read more commands. */
void
-wait_for_inferior (int treat_exec_as_sigtrap)
+wait_for_inferior (void)
{
struct cleanup *old_cleanups;
struct execution_control_state ecss;
@@ -2623,8 +2618,7 @@ wait_for_inferior (int treat_exec_as_sig
if (debug_infrun)
fprintf_unfiltered
- (gdb_stdlog, "infrun: wait_for_inferior (treat_exec_as_sigtrap=%d)\n",
- treat_exec_as_sigtrap);
+ (gdb_stdlog, "infrun: wait_for_inferior ()\n");
old_cleanups =
make_cleanup (delete_step_thread_step_resume_breakpoint_cleanup, NULL);
@@ -2656,13 +2650,6 @@ wait_for_inferior (int treat_exec_as_sig
if (debug_infrun)
print_target_wait_results (waiton_ptid, ecs->ptid, &ecs->ws);
- if (treat_exec_as_sigtrap && ecs->ws.kind == TARGET_WAITKIND_EXECD)
- {
- xfree (ecs->ws.value.execd_pathname);
- ecs->ws.kind = TARGET_WAITKIND_STOPPED;
- ecs->ws.value.sig = TARGET_SIGNAL_TRAP;
- }
-
/* If an error happens while handling the event, propagate GDB's
knowledge of the executing state to the frontend/user running
state. */
Index: src/gdb/solib-irix.c
===================================================================
--- src.orig/gdb/solib-irix.c 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/solib-irix.c 2011-05-09 15:19:09.879463001 +0100
@@ -475,7 +475,7 @@ irix_solib_create_inferior_hook (int fro
do
{
target_resume (pid_to_ptid (-1), 0, tp->suspend.stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP);
Index: src/gdb/solib-osf.c
===================================================================
--- src.orig/gdb/solib-osf.c 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/solib-osf.c 2011-05-09 15:19:09.879463001 +0100
@@ -346,7 +346,7 @@ osf_solib_create_inferior_hook (int from
do
{
target_resume (minus_one_ptid, 0, tp->suspend.stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP);
Index: src/gdb/solib-sunos.c
===================================================================
--- src.orig/gdb/solib-sunos.c 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/solib-sunos.c 2011-05-09 15:19:09.879463001 +0100
@@ -778,7 +778,7 @@ sunos_solib_create_inferior_hook (int fr
do
{
target_resume (pid_to_ptid (-1), 0, tp->suspend.stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP);
inf->control.stop_soon = NO_STOP_QUIETLY;
Index: src/gdb/solib-svr4.c
===================================================================
--- src.orig/gdb/solib-svr4.c 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/solib-svr4.c 2011-05-09 15:19:09.879463001 +0100
@@ -2213,7 +2213,7 @@ svr4_solib_create_inferior_hook (int fro
do
{
target_resume (pid_to_ptid (-1), 0, tp->suspend.stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP);
inf->control.stop_soon = NO_STOP_QUIETLY;
Index: src/gdb/windows-nat.c
===================================================================
--- src.orig/gdb/windows-nat.c 2011-05-09 15:13:19.979463002 +0100
+++ src/gdb/windows-nat.c 2011-05-09 15:19:09.879463001 +0100
@@ -1714,7 +1714,7 @@ do_initial_windows_stuff (struct target_
while (1)
{
stop_after_trap = 1;
- wait_for_inferior (0);
+ wait_for_inferior ();
tp = inferior_thread ();
if (tp->suspend.stop_signal != TARGET_SIGNAL_TRAP)
resume (0, tp->suspend.stop_signal);
Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c 2011-05-09 15:13:20.139463002 +0100
+++ src/gdb/infcmd.c 2011-05-09 15:19:09.879463001 +0100
@@ -2526,7 +2526,7 @@ attach_command (char *args, int from_tty
return;
}
- wait_for_inferior (0);
+ wait_for_inferior ();
}
attach_command_post_wait (args, from_tty, async_exec);
@@ -2590,7 +2590,7 @@ notice_new_inferior (ptid_t ptid, int le
return;
}
else
- wait_for_inferior (0);
+ wait_for_inferior ();
}
async_exec = leave_running;