From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Remove ignoring leading exec events code.
Date: Fri, 14 Mar 2008 09:12:00 -0000 [thread overview]
Message-ID: <200803141212.31845.vladimir@codesourcery.com> (raw)
GDB has some code to handle a case where target reports more
that one exec event when execing. However, it turns out that
all target say that exactly one event is reported, and
therefore that code is of no use. The comments for that code
is dated 2002-12-05 and mentions HP-UX, which I presume had this
bug fixed. Even if some new target appears with the same bug,
as the comment say, it's better to handle this in target_wait,
not in the generic infrun code.
OK?
- Volodya
* fork-child.c (startup_inferior): Do not set
inferior_ignoring_leading_exec_events.
* inf-child.c (inf_child_reported_exec_events_per_exec_call): Remove.
(inf_child_target): Do not set to_reported_exec_events_per_exec_call.
* infrun.c (inferior_ignoring_leading_exec_events): Remove.
(handle_inferior_event): Remove code for ignoring leading exec
events.
* target.c (update_current_target): Do not inherit, or default,
to_reported_exec_events_per_exec_call.
(debug_to_reported_exec_events_per_exec_call): Remove.
(setup_target_debug): Do not set to_reported_exec_events_per_exec_call.
* target.h (target_reported_exec_events_per_exec_call): Remove.
(struct target): Remove the to_reported_exec_events_per_exec_call
field.
---
gdb/fork-child.c | 3 ---
gdb/inf-child.c | 10 ----------
gdb/infrun.c | 19 -------------------
gdb/target.c | 19 -------------------
gdb/target.h | 7 -------
5 files changed, 0 insertions(+), 58 deletions(-)
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index c8e7683..7aff110 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -426,9 +426,6 @@ startup_inferior (int ntraps)
init_wait_for_inferior ();
- inferior_ignoring_leading_exec_events =
- target_reported_exec_events_per_exec_call () - 1;
-
while (1)
{
/* Make wait_for_inferior be quiet. */
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index ae11871..8da25f4 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -145,14 +145,6 @@ inf_child_remove_exec_catchpoint (int pid)
}
static int
-inf_child_reported_exec_events_per_exec_call (void)
-{
- /* This version of Unix doesn't support notification of exec
- events. */
- return 1;
-}
-
-static int
inf_child_can_run (void)
{
return 1;
@@ -195,8 +187,6 @@ inf_child_target (void)
t->to_follow_fork = inf_child_follow_fork;
t->to_insert_exec_catchpoint = inf_child_insert_exec_catchpoint;
t->to_remove_exec_catchpoint = inf_child_remove_exec_catchpoint;
- t->to_reported_exec_events_per_exec_call =
- inf_child_reported_exec_events_per_exec_call;
t->to_can_run = inf_child_can_run;
t->to_pid_to_exec_file = inf_child_pid_to_exec_file;
t->to_stratum = process_stratum;
diff --git a/gdb/infrun.c b/gdb/infrun.c
index f51a7ad..1ba3e07 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -82,8 +82,6 @@ static int prepare_to_proceed (int);
void _initialize_infrun (void);
-int inferior_ignoring_leading_exec_events = 0;
-
/* When set, stop the 'step' command if we enter a function which has
no line number information. The normal behavior is that we step
over such function. */
@@ -1493,23 +1491,6 @@ handle_inferior_event (struct execution_control_state *ecs)
fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECD\n");
stop_signal = TARGET_SIGNAL_TRAP;
- /* NOTE drow/2002-12-05: This code should be pushed down into the
- target_wait function. Until then following vfork on HP/UX 10.20
- is probably broken by this. Of course, it's broken anyway. */
- /* Is this a target which reports multiple exec events per actual
- call to exec()? (HP-UX using ptrace does, for example.) If so,
- ignore all but the last one. Just resume the exec'r, and wait
- for the next exec event. */
- if (inferior_ignoring_leading_exec_events)
- {
- inferior_ignoring_leading_exec_events--;
- target_resume (ecs->ptid, 0, TARGET_SIGNAL_0);
- prepare_to_wait (ecs);
- return;
- }
- inferior_ignoring_leading_exec_events =
- target_reported_exec_events_per_exec_call () - 1;
-
pending_follow.execd_pathname =
savestring (ecs->ws.value.execd_pathname,
strlen (ecs->ws.value.execd_pathname));
diff --git a/gdb/target.c b/gdb/target.c
index 9d2f1fd..4168c05 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -439,7 +439,6 @@ update_current_target (void)
/* Do not inherit to_follow_fork. */
INHERIT (to_insert_exec_catchpoint, t);
INHERIT (to_remove_exec_catchpoint, t);
- INHERIT (to_reported_exec_events_per_exec_call, t);
INHERIT (to_has_exited, t);
INHERIT (to_mourn_inferior, t);
INHERIT (to_can_run, t);
@@ -599,9 +598,6 @@ update_current_target (void)
de_fault (to_remove_exec_catchpoint,
(int (*) (int))
tcomplain);
- de_fault (to_reported_exec_events_per_exec_call,
- (int (*) (void))
- return_one);
de_fault (to_has_exited,
(int (*) (int, int, int *))
return_zero);
@@ -2636,20 +2632,6 @@ debug_to_remove_exec_catchpoint (int pid)
}
static int
-debug_to_reported_exec_events_per_exec_call (void)
-{
- int reported_exec_events;
-
- reported_exec_events = debug_target.to_reported_exec_events_per_exec_call ();
-
- fprintf_unfiltered (gdb_stdlog,
- "target_reported_exec_events_per_exec_call () = %d\n",
- reported_exec_events);
-
- return reported_exec_events;
-}
-
-static int
debug_to_has_exited (int pid, int wait_status, int *exit_status)
{
int has_exited;
@@ -2786,7 +2768,6 @@ setup_target_debug (void)
current_target.to_remove_vfork_catchpoint = debug_to_remove_vfork_catchpoint;
current_target.to_insert_exec_catchpoint = debug_to_insert_exec_catchpoint;
current_target.to_remove_exec_catchpoint = debug_to_remove_exec_catchpoint;
- current_target.to_reported_exec_events_per_exec_call = debug_to_reported_exec_events_per_exec_call;
current_target.to_has_exited = debug_to_has_exited;
current_target.to_mourn_inferior = debug_to_mourn_inferior;
current_target.to_can_run = debug_to_can_run;
diff --git a/gdb/target.h b/gdb/target.h
index 9a34244..5a5acbe 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -841,13 +841,6 @@ int target_follow_fork (int follow_child);
#define target_remove_exec_catchpoint(pid) \
(*current_target.to_remove_exec_catchpoint) (pid)
-/* Returns the number of exec events that are reported when a process
- invokes a flavor of the exec() system call on this target, if exec
- events are being reported. */
-
-#define target_reported_exec_events_per_exec_call() \
- (*current_target.to_reported_exec_events_per_exec_call) ()
-
/* Returns TRUE if PID has exited. And, also sets EXIT_STATUS to the
exit code of PID, if any. */
--
1.5.3.5
next reply other threads:[~2008-03-14 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 9:12 Vladimir Prus [this message]
2008-03-14 18:06 ` Daniel Jacobowitz
2008-03-17 18:28 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200803141212.31845.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox