diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-11-28 04:31:25 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-11-28 04:31:25 +0000 |
commit | 16c381f0589cead48e7e707c6584ec8629601aad (patch) | |
tree | 8e21dbf7ca0c4b2c178c17f8393b3582824af375 /gdb/infcmd.c | |
parent | f0df11bdc9986db64dfef6d534cad93926889bd0 (diff) | |
download | gdb-16c381f0589cead48e7e707c6584ec8629601aad.zip gdb-16c381f0589cead48e7e707c6584ec8629601aad.tar.gz gdb-16c381f0589cead48e7e707c6584ec8629601aad.tar.bz2 |
gdb/
Rename and move inferior_thread_state and inferior_status.
* gdbthread.h (struct thread_control_state): New struct, move fields
step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
trap_expected, proceed_to_finish, in_infcall, step_over_calls,
stop_step and stop_bpstat here from struct thread_info.
(struct thread_suspend_state): New struct, move field stop_signal here
from struct thread_info.
(struct thread_info): Move the fields above from this struct.
* inferior.h: Move the inferior_thread_state and inferior_status
declarations comment to their definitions at infrun.c.
(struct inferior_control_state): New struct, move field stop_soon from
struct inferior here.
(struct inferior_suspend_state): New empty struct.
(struct inferior): New fields control and suspend. Move out field
stop_soon.
* infrun.c (struct inferior_thread_state): Rename to ...
(infcall_suspend_state): ... here. Replace field stop_signal by
fields thread_suspend and inferior_suspend.
(save_inferior_thread_state): Rename to ...
(save_infcall_suspend_state): ... here. New variable inf. Update the
code for new fields.
(restore_inferior_thread_state): Rename to ...
(restore_infcall_suspend_state): ... here. New variable inf. Update
the code for new fields.
(do_restore_inferior_thread_state_cleanup): Rename to ...
(do_restore_infcall_suspend_state_cleanup): ... here.
(make_cleanup_restore_inferior_thread_state): Rename to ...
(make_cleanup_restore_infcall_suspend_state): ... here.
(discard_inferior_thread_state): Rename to ...
(discard_infcall_suspend_state): ... here.
(get_inferior_thread_state_regcache): Rename to ...
(get_infcall_suspend_state_regcache): ... here.
(struct inferior_status): Rename to ...
(struct infcall_control_state): ... here. Replace fields
step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
trap_expected, proceed_to_finish, in_infcall, step_over_calls,
stop_step, stop_bpstat and stop_soon by fields thread_control and
inferior_control.
(save_inferior_status): Rename to ...
(save_infcall_control_state): ... here. Update the code for new
fields.
(restore_inferior_status): Rename to ...
(restore_infcall_control_state): ... here. Update the code for new
fields.
(do_restore_inferior_status_cleanup): Rename to ...
(do_restore_infcall_control_state_cleanup): ... here.
(make_cleanup_restore_inferior_status): Rename to ...
(make_cleanup_restore_infcall_control_state): ... here.
(discard_inferior_status): Rename to ...
(discard_infcall_control_state): ... here.
* alpha-tdep.c, breakpoint.c, dummy-frame.c, dummy-frame.h,
exceptions.c, fbsd-nat.c, gdbthread.h, infcall.c, infcmd.c,
inferior.c, inferior.h, infrun.c, linux-nat.c, mi/mi-interp.c,
mips-tdep.c, procfs.c, solib-irix.c, solib-osf.c, solib-spu.c,
solib-sunos.c, solib-svr4.c, thread.c, windows-nat.c: Update all the
references to the moved fields and renamed functions.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index c4cdb06..9664468 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -753,7 +753,7 @@ Can't resume all threads and specify proceed count simultaneously.")); tp = find_thread_ptid (last_ptid); } if (tp != NULL) - bs = tp->stop_bpstat; + bs = tp->control.stop_bpstat; while ((stat = bpstat_num (&bs, &num)) != 0) if (stat > 0) @@ -885,7 +885,7 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) else tp = NULL; - if (!tp || !tp->stop_step || !tp->step_multi) + if (!tp || !tp->control.stop_step || !tp->step_multi) { /* If we stopped for some reason that is not stepping there are no further steps to make. */ @@ -935,7 +935,7 @@ step_1_continuation (void *args) struct thread_info *tp; tp = inferior_thread (); - if (tp->step_multi && tp->stop_step) + if (tp->step_multi && tp->control.stop_step) { /* There are more steps to make, and we did stop due to ending a stepping range. Do another step. */ @@ -993,18 +993,19 @@ step_once (int skip_subroutines, int single_inst, int count, int thread) pc = get_frame_pc (frame); find_pc_line_pc_range (pc, - &tp->step_range_start, &tp->step_range_end); + &tp->control.step_range_start, + &tp->control.step_range_end); /* If we have no line info, switch to stepi mode. */ - if (tp->step_range_end == 0 && step_stop_if_no_debug) - tp->step_range_start = tp->step_range_end = 1; - else if (tp->step_range_end == 0) + if (tp->control.step_range_end == 0 && step_stop_if_no_debug) + tp->control.step_range_start = tp->control.step_range_end = 1; + else if (tp->control.step_range_end == 0) { char *name; if (find_pc_partial_function (pc, &name, - &tp->step_range_start, - &tp->step_range_end) == 0) + &tp->control.step_range_start, + &tp->control.step_range_end) == 0) error (_("Cannot find bounds of current function")); target_terminal_ours (); @@ -1016,16 +1017,16 @@ which has no line number information.\n"), name); else { /* Say we are stepping, but stop after one insn whatever it does. */ - tp->step_range_start = tp->step_range_end = 1; + tp->control.step_range_start = tp->control.step_range_end = 1; if (!skip_subroutines) /* It is stepi. Don't step over function calls, not even to functions lacking line numbers. */ - tp->step_over_calls = STEP_OVER_NONE; + tp->control.step_over_calls = STEP_OVER_NONE; } if (skip_subroutines) - tp->step_over_calls = STEP_OVER_ALL; + tp->control.step_over_calls = STEP_OVER_ALL; tp->step_multi = (count > 1); proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); @@ -1255,18 +1256,18 @@ until_next_command (int from_tty) if (msymbol == NULL) error (_("Execution is not within a known function.")); - tp->step_range_start = SYMBOL_VALUE_ADDRESS (msymbol); - tp->step_range_end = pc; + tp->control.step_range_start = SYMBOL_VALUE_ADDRESS (msymbol); + tp->control.step_range_end = pc; } else { sal = find_pc_line (pc, 0); - tp->step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); - tp->step_range_end = sal.end; + tp->control.step_range_start = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); + tp->control.step_range_end = sal.end; } - tp->step_over_calls = STEP_OVER_ALL; + tp->control.step_over_calls = STEP_OVER_ALL; tp->step_multi = 0; /* Only one call to proceed */ @@ -1429,7 +1430,7 @@ finish_command_continuation (void *arg) && is_stopped (inferior_ptid)) { tp = inferior_thread (); - bs = tp->stop_bpstat; + bs = tp->control.stop_bpstat; } if (bpstat_find_breakpoint (bs, a->breakpoint) != NULL @@ -1460,7 +1461,7 @@ finish_command_continuation (void *arg) /* We suppress normal call of normal_stop observer and do it here so that the *stopped notification includes the return value. */ - if (bs != NULL && tp->proceed_to_finish) + if (bs != NULL && tp->control.proceed_to_finish) observer_notify_normal_stop (bs, 1 /* print frame */); delete_breakpoint (a->breakpoint); } @@ -1493,7 +1494,7 @@ finish_backward (struct symbol *function) sal = find_pc_line (func_addr, 0); /* We don't need a return value. */ - tp->proceed_to_finish = 0; + tp->control.proceed_to_finish = 0; /* Special case: if we're sitting at the function entry point, then all we need to do is take a reverse singlestep. We don't need to set a breakpoint, and indeed it would do us @@ -1519,7 +1520,8 @@ finish_backward (struct symbol *function) old_chain = make_cleanup_delete_breakpoint (breakpoint); proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); /* We will be stopped when proceed returns. */ - back_up = bpstat_find_breakpoint (tp->stop_bpstat, breakpoint) != NULL; + back_up = (bpstat_find_breakpoint (tp->control.stop_bpstat, breakpoint) + != NULL); do_cleanups (old_chain); } else @@ -1529,7 +1531,7 @@ finish_backward (struct symbol *function) /* If in fact we hit the step-resume breakpoint (and not some other breakpoint), then we're almost there -- we just need to back up by one more single-step. */ - tp->step_range_start = tp->step_range_end = 1; + tp->control.step_range_start = tp->control.step_range_end = 1; proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); } return; @@ -1556,7 +1558,8 @@ finish_forward (struct symbol *function, struct frame_info *frame) old_chain = make_cleanup_delete_breakpoint (breakpoint); - tp->proceed_to_finish = 1; /* We want stop_registers, please... */ + /* We want stop_registers, please... */ + tp->control.proceed_to_finish = 1; cargs = xmalloc (sizeof (*cargs)); cargs->breakpoint = breakpoint; @@ -1632,8 +1635,9 @@ finish_command (char *arg, int from_tty) init_sal (&empty_sal); set_step_info (frame, empty_sal); - tp->step_range_start = tp->step_range_end = get_frame_pc (frame); - tp->step_over_calls = STEP_OVER_ALL; + tp->control.step_range_start = get_frame_pc (frame); + tp->control.step_range_end = tp->control.step_range_start; + tp->control.step_over_calls = STEP_OVER_ALL; /* Print info on the selected frame, including level number but not source. */ @@ -1699,13 +1703,13 @@ program_info (char *args, int from_tty) error (_("Selected thread is running.")); tp = find_thread_ptid (ptid); - bs = tp->stop_bpstat; + bs = tp->control.stop_bpstat; stat = bpstat_num (&bs, &num); target_files_info (); printf_filtered (_("Program stopped at %s.\n"), paddress (target_gdbarch, stop_pc)); - if (tp->stop_step) + if (tp->control.stop_step) printf_filtered (_("It stopped after being stepped.\n")); else if (stat != 0) { @@ -1723,11 +1727,11 @@ It stopped at a breakpoint that has since been deleted.\n")); stat = bpstat_num (&bs, &num); } } - else if (tp->stop_signal != TARGET_SIGNAL_0) + else if (tp->suspend.stop_signal != TARGET_SIGNAL_0) { printf_filtered (_("It stopped with signal %s, %s.\n"), - target_signal_to_name (tp->stop_signal), - target_signal_to_string (tp->stop_signal)); + target_signal_to_name (tp->suspend.stop_signal), + target_signal_to_string (tp->suspend.stop_signal)); } if (!from_tty) @@ -2206,7 +2210,7 @@ proceed_after_attach_callback (struct thread_info *thread, && !is_exited (thread->ptid) && !is_executing (thread->ptid) && !thread->stop_requested - && thread->stop_signal == TARGET_SIGNAL_0) + && thread->suspend.stop_signal == TARGET_SIGNAL_0) { switch_to_thread (thread->ptid); clear_proceed_status (); @@ -2256,7 +2260,7 @@ attach_command_post_wait (char *args, int from_tty, int async_exec) struct inferior *inferior; inferior = current_inferior (); - inferior->stop_soon = NO_STOP_QUIETLY; + inferior->control.stop_soon = NO_STOP_QUIETLY; /* If no exec file is yet known, try to determine it from the process itself. */ @@ -2308,7 +2312,7 @@ attach_command_post_wait (char *args, int from_tty, int async_exec) proceed_after_attach (inferior->pid); else { - if (inferior_thread ()->stop_signal == TARGET_SIGNAL_0) + if (inferior_thread ()->suspend.stop_signal == TARGET_SIGNAL_0) { clear_proceed_status (); proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); @@ -2447,7 +2451,7 @@ attach_command (char *args, int from_tty) need a way for handle_inferior_event to reset the stop_signal variable after an attach, and this is what STOP_QUIETLY_NO_SIGSTOP is for. */ - inferior->stop_soon = STOP_QUIETLY_NO_SIGSTOP; + inferior->control.stop_soon = STOP_QUIETLY_NO_SIGSTOP; if (target_can_async_p ()) { @@ -2510,7 +2514,7 @@ notice_new_inferior (ptid_t ptid, int leave_running, int from_tty) that. */ target_stop (inferior_ptid); - inferior->stop_soon = STOP_QUIETLY_REMOTE; + inferior->control.stop_soon = STOP_QUIETLY_REMOTE; /* Wait for stop before proceeding. */ if (target_can_async_p ()) |