* infrun.c (pending_follow): Remove execd_pathname member.
authorPedro Alves <palves@redhat.com>
Sun, 17 May 2009 16:31:21 +0000 (16:31 +0000)
committerPedro Alves <palves@redhat.com>
Sun, 17 May 2009 16:31:21 +0000 (16:31 +0000)
(resume): No longer handle TARGET_WAITKIND_EXECD pending follow.
(handle_inferior_event): When handling a TARGET_WAITKIND_EXECD
event, don't copy `execd_pathname' to pending_follow, use the
event copy instead.  Release `execd_pathname' once done with
handling the event.

gdb/ChangeLog
gdb/infrun.c

index bc18ad4a996ef5772a42664cd56320f581dbf306..528fbef093cf314b8bb8e353faa698a88034013f 100644 (file)
@@ -1,3 +1,12 @@
+2009-05-17  Pedro Alves  <pedro@codesourcery.com>
+
+       * infrun.c (pending_follow): Remove execd_pathname member.
+       (resume): No longer handle TARGET_WAITKIND_EXECD pending follow.
+       (handle_inferior_event): When handling a TARGET_WAITKIND_EXECD
+       event, don't copy `execd_pathname' to pending_follow, use the
+       event copy instead.  Release `execd_pathname' once done with
+       handling the event.
+
 2009-05-17  Hui Zhu  <teawater@gmail.com>
 
        * i386-tdep.c (i386_process_record): Make it extern.
index 903f31c6a259f481ad49702e92ade51249fa2a8e..526112fc0731f92ea372fad2966b83df8fa649c0 100644 (file)
@@ -268,7 +268,6 @@ static struct
     ptid_t child_pid;
   }
   fork_event;
-  char *execd_pathname;
 }
 pending_follow;
 
@@ -1078,11 +1077,6 @@ a command like `return' or `jump' to continue execution."));
       pc = regcache_read_pc (regcache);
       break;
 
-    case TARGET_WAITKIND_EXECD:
-      /* follow_exec is called as soon as the exec event is seen. */
-      pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
-      break;
-
     default:
       break;
     }
@@ -2444,9 +2438,6 @@ handle_inferior_event (struct execution_control_state *ecs)
     case TARGET_WAITKIND_EXECD:
       if (debug_infrun)
         fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECD\n");
-      pending_follow.execd_pathname =
-       savestring (ecs->ws.value.execd_pathname,
-                   strlen (ecs->ws.value.execd_pathname));
 
       if (!ptid_equal (ecs->ptid, inferior_ptid))
        {
@@ -2459,12 +2450,16 @@ handle_inferior_event (struct execution_control_state *ecs)
       /* This causes the eventpoints and symbol table to be reset.
          Must do this now, before trying to determine whether to
          stop.  */
-      follow_exec (inferior_ptid, pending_follow.execd_pathname);
-      xfree (pending_follow.execd_pathname);
+      follow_exec (inferior_ptid, ecs->ws.value.execd_pathname);
 
       ecs->event_thread->stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
       ecs->random_signal = !bpstat_explains_signal (ecs->event_thread->stop_bpstat);
 
+      /* Note that this may be referenced from inside
+        bpstat_stop_status above, through inferior_has_execd.  */
+      xfree (ecs->ws.value.execd_pathname);
+      ecs->ws.value.execd_pathname = NULL;
+
       /* If no catchpoint triggered for this, then keep going.  */
       if (ecs->random_signal)
        {
This page took 0.034398 seconds and 4 git commands to generate.