This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [1/7] infrun cleanup: remove TREAT_EXEC_AS_SIGTRAP
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 7 Dec 2008 01:16:47 +0100 (CET)
- Subject: [rfc] [1/7] infrun cleanup: remove TREAT_EXEC_AS_SIGTRAP
Hello,
now that wait_for_inferior is never called with a non-zero
TREAT_EXEC_AS_SIGTRAP argument any more, it is time to remove
the code handling this situation.
Bye,
Ulrich
ChangeLog:
* inferior.h (wait_for_inferior): Remove TREAT_EXEC_AS_SIGTRAP
argument.
* infrun.c (wait_for_inferior): Remove TREAT_EXEC_AS_SIGTRAP
argument and code handling it.
* infrun.c (proceed): Update call to wait_for_inferior.
(start_remote): Likewise.
* infcmd.c (attach_command): Likewise.
* solib-irix.c (irix_solib_create_inferior_hook): Likewise.
* solib-osf.c (osf_solib_create_inferior_hook): Likewise.
* solib-sunos.c (sunos_solib_create_inferior_hook): Likewise.
* solib-svr4.c (svr4_solib_create_inferior_hook): Likewise.
* win32-nat.c (do_initial_win32_stuff): Likewise.
Index: gdb-head/gdb/infcmd.c
===================================================================
--- gdb-head.orig/gdb/infcmd.c
+++ gdb-head/gdb/infcmd.c
@@ -2328,7 +2328,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);
Index: gdb-head/gdb/solib-irix.c
===================================================================
--- gdb-head.orig/gdb/solib-irix.c
+++ gdb-head/gdb/solib-irix.c
@@ -447,7 +447,7 @@ irix_solib_create_inferior_hook (void)
do
{
target_resume (pid_to_ptid (-1), 0, tp->stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
Index: gdb-head/gdb/solib-osf.c
===================================================================
--- gdb-head.orig/gdb/solib-osf.c
+++ gdb-head/gdb/solib-osf.c
@@ -344,7 +344,7 @@ osf_solib_create_inferior_hook (void)
do
{
target_resume (minus_one_ptid, 0, tp->stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
Index: gdb-head/gdb/solib-sunos.c
===================================================================
--- gdb-head.orig/gdb/solib-sunos.c
+++ gdb-head/gdb/solib-sunos.c
@@ -772,7 +772,7 @@ sunos_solib_create_inferior_hook (void)
do
{
target_resume (pid_to_ptid (-1), 0, tp->stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
inf->stop_soon = NO_STOP_QUIETLY;
Index: gdb-head/gdb/solib-svr4.c
===================================================================
--- gdb-head.orig/gdb/solib-svr4.c
+++ gdb-head/gdb/solib-svr4.c
@@ -1601,7 +1601,7 @@ svr4_solib_create_inferior_hook (void)
do
{
target_resume (pid_to_ptid (-1), 0, tp->stop_signal);
- wait_for_inferior (0);
+ wait_for_inferior ();
}
while (tp->stop_signal != TARGET_SIGNAL_TRAP);
inf->stop_soon = NO_STOP_QUIETLY;
Index: gdb-head/gdb/win32-nat.c
===================================================================
--- gdb-head.orig/gdb/win32-nat.c
+++ gdb-head/gdb/win32-nat.c
@@ -1563,7 +1563,7 @@ do_initial_win32_stuff (DWORD pid, int a
while (1)
{
stop_after_trap = 1;
- wait_for_inferior (0);
+ wait_for_inferior ();
tp = inferior_thread ();
if (tp->stop_signal != TARGET_SIGNAL_TRAP)
resume (0, tp->stop_signal);
Index: gdb-head/gdb/inferior.h
===================================================================
--- gdb-head.orig/gdb/inferior.h
+++ gdb-head/gdb/inferior.h
@@ -155,7 +155,7 @@ extern CORE_ADDR signed_pointer_to_addre
extern void address_to_signed_pointer (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 fetch_inferior_event (void *);
Index: gdb-head/gdb/infrun.c
===================================================================
--- gdb-head.orig/gdb/infrun.c
+++ gdb-head/gdb/infrun.c
@@ -1460,7 +1460,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 ();
}
}
@@ -1491,7 +1491,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,
@@ -1740,27 +1740,20 @@ delete_step_thread_step_resume_breakpoin
/* 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;
struct execution_control_state *ecs;
if (debug_infrun)
- fprintf_unfiltered
- (gdb_stdlog, "infrun: wait_for_inferior (treat_exec_as_sigtrap=%d)\n",
- treat_exec_as_sigtrap);
+ fprintf_unfiltered (gdb_stdlog, "infrun: wait_for_inferior\n");
old_cleanups =
make_cleanup (delete_step_thread_step_resume_breakpoint_cleanup, NULL);
@@ -1788,13 +1781,6 @@ wait_for_inferior (int treat_exec_as_sig
else
ecs->ptid = target_wait (waiton_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;
- }
-
/* Now figure out what to do with the result of the result. */
handle_inferior_event (ecs);
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com