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/infcall.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/infcall.c')
-rw-r--r-- | gdb/infcall.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c index 68343b8..6eb1bbf 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -360,16 +360,18 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) { volatile struct gdb_exception e; int saved_async = 0; - int saved_in_infcall = call_thread->in_infcall; + int saved_in_infcall = call_thread->control.in_infcall; ptid_t call_thread_ptid = call_thread->ptid; char *saved_target_shortname = xstrdup (target_shortname); - call_thread->in_infcall = 1; + call_thread->control.in_infcall = 1; clear_proceed_status (); disable_watchpoints_before_interactive_call_start (); - call_thread->proceed_to_finish = 1; /* We want stop_registers, please... */ + + /* We want stop_registers, please... */ + call_thread->control.proceed_to_finish = 1; if (target_can_async_p ()) saved_async = target_async_mask (0); @@ -397,11 +399,11 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) if (e.reason < 0) { if (call_thread != NULL) - breakpoint_auto_delete (call_thread->stop_bpstat); + breakpoint_auto_delete (call_thread->control.stop_bpstat); } if (call_thread != NULL) - call_thread->in_infcall = saved_in_infcall; + call_thread->control.in_infcall = saved_in_infcall; xfree (saved_target_shortname); @@ -440,9 +442,9 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) struct type *values_type, *target_values_type; unsigned char struct_return = 0, lang_struct_return = 0; CORE_ADDR struct_addr = 0; - struct inferior_status *inf_status; + struct infcall_control_state *inf_status; struct cleanup *inf_status_cleanup; - struct inferior_thread_state *caller_state; + struct infcall_suspend_state *caller_state; CORE_ADDR funaddr; CORE_ADDR real_pc; struct type *ftype = check_typedef (value_type (function)); @@ -473,16 +475,17 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) /* A cleanup for the inferior status. This is only needed while we're preparing the inferior function call. */ - inf_status = save_inferior_status (); - inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status); + inf_status = save_infcall_control_state (); + inf_status_cleanup + = make_cleanup_restore_infcall_control_state (inf_status); /* Save the caller's registers and other state associated with the inferior itself so that they can be restored once the callee returns. To allow nested calls the registers are (further down) pushed onto a dummy frame stack. Include a cleanup (which is tossed once the regcache has been pushed). */ - caller_state = save_inferior_thread_state (); - make_cleanup_restore_inferior_thread_state (caller_state); + caller_state = save_infcall_suspend_state (); + make_cleanup_restore_infcall_suspend_state (caller_state); /* Ensure that the initial SP is correctly aligned. */ { @@ -810,7 +813,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) const char *name = get_function_name (funaddr, name_buf, sizeof (name_buf)); - discard_inferior_status (inf_status); + discard_infcall_control_state (inf_status); /* We could discard the dummy frame here if the program exited, but it will get garbage collected the next time the program is @@ -842,7 +845,7 @@ When the function is done executing, GDB will silently stop."), /* If we try to restore the inferior status, we'll crash as the inferior is no longer running. */ - discard_inferior_status (inf_status); + discard_infcall_control_state (inf_status); /* We could discard the dummy frame here given that the program exited, but it will get garbage collected the next time the program is @@ -864,7 +867,7 @@ Evaluation of the expression containing the function\n\ signal or breakpoint while our thread was running. There's no point in restoring the inferior status, we're in a different thread. */ - discard_inferior_status (inf_status); + discard_infcall_control_state (inf_status); /* Keep the dummy frame record, if the user switches back to the thread with the hand-call, we'll need it. */ if (stopped_by_random_signal) @@ -905,7 +908,7 @@ When the function is done executing, GDB will silently stop."), /* We also need to restore inferior status to that before the dummy call. */ - restore_inferior_status (inf_status); + restore_infcall_control_state (inf_status); /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ @@ -923,7 +926,7 @@ Evaluation of the expression containing the function\n\ (default). Discard inferior status, we're not at the same point we started at. */ - discard_inferior_status (inf_status); + discard_infcall_control_state (inf_status); /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ @@ -946,7 +949,7 @@ When the function is done executing, GDB will silently stop."), /* We also need to restore inferior status to that before the dummy call. */ - restore_inferior_status (inf_status); + restore_infcall_control_state (inf_status); error (_("\ The program being debugged entered a std::terminate call, most likely\n\ @@ -965,7 +968,7 @@ will be abandoned."), Keep the dummy frame, the user may want to examine its state. Discard inferior status, we're not at the same point we started at. */ - discard_inferior_status (inf_status); + discard_infcall_control_state (inf_status); /* The following error message used to say "The expression which contained the function call has been discarded." @@ -1002,7 +1005,7 @@ When the function is done executing, GDB will silently stop."), /* Inferior call is successful. Restore the inferior status. At this stage, leave the RETBUF alone. */ - restore_inferior_status (inf_status); + restore_infcall_control_state (inf_status); /* Figure out the value returned by the function. */ |