This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Make inf_ttrace_wait() properly report exec events
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Thu, 21 Jul 2005 12:36:26 +0200 (CEST)
- Subject: [commit] Make inf_ttrace_wait() properly report exec events
I don't think this really has any effect given the fact that follow
exec is disabled, but this should prepare the way for re-enabling it
again.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* inf-ttrace.c (inf_ttrace_wait): Properly report TTEVT_EXEC
events as TARGET_WAITKIND_EXECD.
(inf_ttrace_detach): Reorder local variables.
Index: inf-ttrace.c
===================================================================
RCS file: /cvs/src/src/gdb/inf-ttrace.c,v
retrieving revision 1.12
diff -u -p -r1.12 inf-ttrace.c
--- inf-ttrace.c 20 Jul 2005 13:25:28 -0000 1.12
+++ inf-ttrace.c 21 Jul 2005 10:33:13 -0000
@@ -758,8 +758,8 @@ inf_ttrace_attach (char *args, int from_
static void
inf_ttrace_detach (char *args, int from_tty)
{
- int sig = 0;
pid_t pid = ptid_get_pid (inferior_ptid);
+ int sig = 0;
if (from_tty)
{
@@ -894,9 +894,14 @@ inf_ttrace_wait (ptid_t ptid, struct tar
#endif
case TTEVT_EXEC:
- /* Make it look like a breakpoint. */
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = TARGET_SIGNAL_TRAP;
+ ourstatus->kind = TARGET_WAITKIND_EXECD;
+ ourstatus->value.execd_pathname =
+ xmalloc (tts.tts_u.tts_exec.tts_pathlen + 1);
+ if (ttrace (TT_PROC_GET_PATHNAME, tts.tts_pid, 0,
+ (uintptr_t)ourstatus->value.execd_pathname,
+ tts.tts_u.tts_exec.tts_pathlen, 0) == -1)
+ perror_with_name (("ttrace"));
+ ourstatus->value.execd_pathname[tts.tts_u.tts_exec.tts_pathlen] = 0;
break;
case TTEVT_EXIT: