2012-10-26 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_SIGNALLED>: Remove comment.
This commit is contained in:
parent
47b1906506
commit
940c3c0683
|
@ -1,3 +1,9 @@
|
||||||
|
2012-10-26 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* infrun.c (handle_inferior_event): Merge handling of
|
||||||
|
TARGET_WAITKIND_EXITED and TARGET_WAITKIND_SIGNALLED into a single
|
||||||
|
switch case.
|
||||||
|
|
||||||
2012-10-26 Pedro Alves <palves@redhat.com>
|
2012-10-26 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_SIGNALLED>:
|
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_SIGNALLED>:
|
||||||
|
|
37
gdb/infrun.c
37
gdb/infrun.c
|
@ -3370,15 +3370,25 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case TARGET_WAITKIND_EXITED:
|
case TARGET_WAITKIND_EXITED:
|
||||||
|
case TARGET_WAITKIND_SIGNALLED:
|
||||||
if (debug_infrun)
|
if (debug_infrun)
|
||||||
fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXITED\n");
|
{
|
||||||
|
if (ecs->ws.kind == TARGET_WAITKIND_EXITED)
|
||||||
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
"infrun: TARGET_WAITKIND_EXITED\n");
|
||||||
|
else
|
||||||
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
|
"infrun: TARGET_WAITKIND_SIGNALLED\n");
|
||||||
|
}
|
||||||
|
|
||||||
inferior_ptid = ecs->ptid;
|
inferior_ptid = ecs->ptid;
|
||||||
set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
|
set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
|
||||||
set_current_program_space (current_inferior ()->pspace);
|
set_current_program_space (current_inferior ()->pspace);
|
||||||
handle_vfork_child_exec_or_exit (0);
|
handle_vfork_child_exec_or_exit (0);
|
||||||
target_terminal_ours (); /* Must do this before mourn anyway. */
|
target_terminal_ours (); /* Must do this before mourn anyway. */
|
||||||
print_exited_reason (ecs->ws.value.integer);
|
|
||||||
|
|
||||||
|
if (ecs->ws.kind == TARGET_WAITKIND_EXITED)
|
||||||
|
{
|
||||||
/* Record the exit code in the convenience variable $_exitcode, so
|
/* Record the exit code in the convenience variable $_exitcode, so
|
||||||
that the user can inspect this again later. */
|
that the user can inspect this again later. */
|
||||||
set_internalvar_integer (lookup_internalvar ("_exitcode"),
|
set_internalvar_integer (lookup_internalvar ("_exitcode"),
|
||||||
|
@ -3388,6 +3398,11 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
current_inferior ()->has_exit_code = 1;
|
current_inferior ()->has_exit_code = 1;
|
||||||
current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer;
|
current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer;
|
||||||
|
|
||||||
|
print_exited_reason (ecs->ws.value.integer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
print_signal_exited_reason (ecs->ws.value.sig);
|
||||||
|
|
||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
target_mourn_inferior ();
|
target_mourn_inferior ();
|
||||||
singlestep_breakpoints_inserted_p = 0;
|
singlestep_breakpoints_inserted_p = 0;
|
||||||
|
@ -3396,24 +3411,6 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
stop_stepping (ecs);
|
stop_stepping (ecs);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case TARGET_WAITKIND_SIGNALLED:
|
|
||||||
if (debug_infrun)
|
|
||||||
fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SIGNALLED\n");
|
|
||||||
inferior_ptid = ecs->ptid;
|
|
||||||
set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
|
|
||||||
set_current_program_space (current_inferior ()->pspace);
|
|
||||||
handle_vfork_child_exec_or_exit (0);
|
|
||||||
stop_print_frame = 0;
|
|
||||||
target_terminal_ours (); /* Must do this before mourn anyway. */
|
|
||||||
|
|
||||||
target_mourn_inferior ();
|
|
||||||
|
|
||||||
print_signal_exited_reason (ecs->ws.value.sig);
|
|
||||||
singlestep_breakpoints_inserted_p = 0;
|
|
||||||
cancel_single_step_breakpoints ();
|
|
||||||
stop_stepping (ecs);
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* The following are the only cases in which we keep going;
|
/* The following are the only cases in which we keep going;
|
||||||
the above cases end in a continue or goto. */
|
the above cases end in a continue or goto. */
|
||||||
case TARGET_WAITKIND_FORKED:
|
case TARGET_WAITKIND_FORKED:
|
||||||
|
|
Loading…
Reference in New Issue