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/gdbthread.h | |
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/gdbthread.h')
-rw-r--r-- | gdb/gdbthread.h | 152 |
1 files changed, 88 insertions, 64 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index cd24eaf..8fe82c3 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -29,43 +29,14 @@ struct symtab; #include "ui-out.h" #include "inferior.h" -struct thread_info -{ - struct thread_info *next; - ptid_t ptid; /* "Actual process id"; - In fact, this may be overloaded with - kernel thread id, etc. */ - int num; /* Convenient handle (GDB thread id) */ +/* Inferior thread specific part of `struct infcall_control_state'. - /* Non-zero means the thread is executing. Note: this is different - from saying that there is an active target and we are stopped at - a breakpoint, for instance. This is a real indicator whether the - thread is off and running. */ - /* This field is internal to thread.c. Never access it directly, - use is_executing instead. */ - int executing_; - - /* Frontend view of the thread state. Note that the RUNNING/STOPPED - states are different from EXECUTING. When the thread is stopped - internally while handling an internal event, like a software - single-step breakpoint, EXECUTING will be false, but running will - still be true. As a possible future extension, this could turn - into enum { stopped, exited, stepping, finishing, until(ling), - running ... } */ - /* This field is internal to thread.c. Never access it directly, - use is_running instead. */ - int state_; - - /* If this is > 0, then it means there's code out there that relies - on this thread being listed. Don't delete it from the lists even - if we detect it exiting. */ - int refcount; + Inferior process counterpart is `struct inferior_control_state'. */ +struct thread_control_state +{ /* User/external stepping state. */ - /* Step-resume or longjmp-resume breakpoint. */ - struct breakpoint *step_resume_breakpoint; - /* Range to single step within. If this is nonzero, respond to a single-step signal by continuing @@ -88,17 +59,6 @@ struct thread_info any inlined frames). */ struct frame_id step_stack_frame_id; - int current_line; - struct symtab *current_symtab; - - /* Internal stepping state. */ - - /* Record the pc of the thread the last time it stopped. This is - maintained by proceed and keep_going, and used in - adjust_pc_after_break to distinguish a hardware single-step - SIGTRAP from a breakpoint SIGTRAP. */ - CORE_ADDR prev_pc; - /* Nonzero if we are presently stepping over a breakpoint. If we hit a breakpoint or watchpoint, and then continue, we need @@ -123,6 +83,90 @@ struct thread_info by keep_going. */ int trap_expected; + /* Nonzero if the thread is being proceeded for a "finish" command + or a similar situation when stop_registers should be saved. */ + int proceed_to_finish; + + /* Nonzero if the thread is being proceeded for an inferior function + call. */ + int in_infcall; + + enum step_over_calls_kind step_over_calls; + + /* Nonzero if stopped due to a step command. */ + int stop_step; + + /* Chain containing status of breakpoint(s) the thread stopped + at. */ + bpstat stop_bpstat; +}; + +/* Inferior thread specific part of `struct infcall_suspend_state'. + + Inferior process counterpart is `struct inferior_suspend_state'. */ + +struct thread_suspend_state +{ + /* Last signal that the inferior received (why it stopped). */ + enum target_signal stop_signal; +}; + +struct thread_info +{ + struct thread_info *next; + ptid_t ptid; /* "Actual process id"; + In fact, this may be overloaded with + kernel thread id, etc. */ + int num; /* Convenient handle (GDB thread id) */ + + /* Non-zero means the thread is executing. Note: this is different + from saying that there is an active target and we are stopped at + a breakpoint, for instance. This is a real indicator whether the + thread is off and running. */ + /* This field is internal to thread.c. Never access it directly, + use is_executing instead. */ + int executing_; + + /* Frontend view of the thread state. Note that the RUNNING/STOPPED + states are different from EXECUTING. When the thread is stopped + internally while handling an internal event, like a software + single-step breakpoint, EXECUTING will be false, but running will + still be true. As a possible future extension, this could turn + into enum { stopped, exited, stepping, finishing, until(ling), + running ... } */ + /* This field is internal to thread.c. Never access it directly, + use is_running instead. */ + int state_; + + /* If this is > 0, then it means there's code out there that relies + on this thread being listed. Don't delete it from the lists even + if we detect it exiting. */ + int refcount; + + /* State of GDB control of inferior thread execution. + See `struct thread_control_state'. */ + struct thread_control_state control; + + /* State of inferior thread to restore after GDB is done with an inferior + call. See `struct thread_suspend_state'. */ + struct thread_suspend_state suspend; + + /* User/external stepping state. */ + + /* Step-resume or longjmp-resume breakpoint. */ + struct breakpoint *step_resume_breakpoint; + + int current_line; + struct symtab *current_symtab; + + /* Internal stepping state. */ + + /* Record the pc of the thread the last time it stopped. This is + maintained by proceed and keep_going, and used in + adjust_pc_after_break to distinguish a hardware single-step + SIGTRAP from a breakpoint SIGTRAP. */ + CORE_ADDR prev_pc; + /* Should we step over breakpoint next time keep_going is called? */ int stepping_over_breakpoint; @@ -153,19 +197,6 @@ struct thread_info command. */ struct continuation *intermediate_continuations; - /* Nonzero if the thread is being proceeded for a "finish" command - or a similar situation when stop_registers should be saved. */ - int proceed_to_finish; - - /* Nonzero if the thread is being proceeded for an inferior function - call. */ - int in_infcall; - - enum step_over_calls_kind step_over_calls; - - /* Nonzero if stopped due to a step command. */ - int stop_step; - /* If stepping, nonzero means step count is > 1 so don't print frame next time inferior stops if it stops due to stepping. */ int step_multi; @@ -175,13 +206,6 @@ struct thread_info resume of the thread, and not immediately. */ struct target_waitstatus pending_follow; - /* Last signal that the inferior received (why it stopped). */ - enum target_signal stop_signal; - - /* Chain containing status of breakpoint(s) the thread stopped - at. */ - bpstat stop_bpstat; - /* True if this thread has been explicitly requested to stop. */ int stop_requested; |