2001-06-13 Michael Snyder <msnyder@redhat.com>
* gdbthread.h (struct thread_info): Add new fields: current_line, current_symtab, step_sp, for saved infrun state. * thread.c (save_infrun_state, load_infrun_state): Save and restore current_line, current_symtab, and step_sp. (add_thread): Rather than adding assignments to initialize the new fields, just use memset (tp, 0, sizeof (*tp). This way future new fields will not be overlooked. * infrun.c (handle_inferior_event): Save and restore save_sp, current_line, and current_symtab when switching threads.
This commit is contained in:
parent
16075aced5
commit
6c0d3f6a03
4 changed files with 71 additions and 37 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2001-06-13 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
|
* gdbthread.h (struct thread_info): Add new fields:
|
||||||
|
current_line, current_symtab, step_sp, for saved infrun state.
|
||||||
|
* thread.c (save_infrun_state, load_infrun_state): Save and
|
||||||
|
restore current_line, current_symtab, and step_sp.
|
||||||
|
(add_thread): Rather than adding assignments to initialize
|
||||||
|
the new fields, just use memset (tp, 0, sizeof (*tp).
|
||||||
|
This way future new fields will not be overlooked.
|
||||||
|
* infrun.c (handle_inferior_event): Save and restore save_sp,
|
||||||
|
current_line, and current_symtab when switching threads.
|
||||||
|
|
||||||
2001-06-13 Elena Zannoni <ezannoni@redhat.com>
|
2001-06-13 Elena Zannoni <ezannoni@redhat.com>
|
||||||
|
|
||||||
* MAINTAINERS: Add Andrew Cagney as co-maintainer of
|
* MAINTAINERS: Add Andrew Cagney as co-maintainer of
|
||||||
|
|
|
@ -44,6 +44,9 @@ struct thread_info
|
||||||
CORE_ADDR step_range_start;
|
CORE_ADDR step_range_start;
|
||||||
CORE_ADDR step_range_end;
|
CORE_ADDR step_range_end;
|
||||||
CORE_ADDR step_frame_address;
|
CORE_ADDR step_frame_address;
|
||||||
|
CORE_ADDR step_sp;
|
||||||
|
int current_line;
|
||||||
|
struct symtab *current_symtab;
|
||||||
int trap_expected;
|
int trap_expected;
|
||||||
int handling_longjmp;
|
int handling_longjmp;
|
||||||
int another_trap;
|
int another_trap;
|
||||||
|
@ -120,7 +123,10 @@ extern void save_infrun_state (ptid_t ptid,
|
||||||
int another_trap,
|
int another_trap,
|
||||||
int stepping_through_solib_after_catch,
|
int stepping_through_solib_after_catch,
|
||||||
bpstat stepping_through_solib_catchpoints,
|
bpstat stepping_through_solib_catchpoints,
|
||||||
int stepping_through_sigtramp);
|
int stepping_through_sigtramp,
|
||||||
|
int current_line,
|
||||||
|
struct symtab *current_symtab,
|
||||||
|
CORE_ADDR step_sp);
|
||||||
|
|
||||||
/* infrun context switch: load the debugger state previously saved
|
/* infrun context switch: load the debugger state previously saved
|
||||||
for the given thread. */
|
for the given thread. */
|
||||||
|
@ -138,7 +144,10 @@ extern void load_infrun_state (ptid_t ptid,
|
||||||
int *another_trap,
|
int *another_trap,
|
||||||
int *stepping_through_solib_affter_catch,
|
int *stepping_through_solib_affter_catch,
|
||||||
bpstat *stepping_through_solib_catchpoints,
|
bpstat *stepping_through_solib_catchpoints,
|
||||||
int *stepping_through_sigtramp);
|
int *stepping_through_sigtramp,
|
||||||
|
int *current_line,
|
||||||
|
struct symtab **current_symtab,
|
||||||
|
CORE_ADDR *step_sp);
|
||||||
|
|
||||||
/* Commands with a prefix of `thread'. */
|
/* Commands with a prefix of `thread'. */
|
||||||
extern struct cmd_list_element *thread_cmd_list;
|
extern struct cmd_list_element *thread_cmd_list;
|
||||||
|
|
|
@ -2001,7 +2001,9 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
ecs->another_trap,
|
ecs->another_trap,
|
||||||
ecs->stepping_through_solib_after_catch,
|
ecs->stepping_through_solib_after_catch,
|
||||||
ecs->stepping_through_solib_catchpoints,
|
ecs->stepping_through_solib_catchpoints,
|
||||||
ecs->stepping_through_sigtramp);
|
ecs->stepping_through_sigtramp,
|
||||||
|
ecs->current_line, ecs->current_symtab,
|
||||||
|
step_sp);
|
||||||
|
|
||||||
/* Load infrun state for the new thread. */
|
/* Load infrun state for the new thread. */
|
||||||
load_infrun_state (ecs->ptid, &prev_pc,
|
load_infrun_state (ecs->ptid, &prev_pc,
|
||||||
|
@ -2013,7 +2015,9 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
&ecs->another_trap,
|
&ecs->another_trap,
|
||||||
&ecs->stepping_through_solib_after_catch,
|
&ecs->stepping_through_solib_after_catch,
|
||||||
&ecs->stepping_through_solib_catchpoints,
|
&ecs->stepping_through_solib_catchpoints,
|
||||||
&ecs->stepping_through_sigtramp);
|
&ecs->stepping_through_sigtramp,
|
||||||
|
&ecs->current_line, &ecs->current_symtab,
|
||||||
|
&step_sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
inferior_ptid = ecs->ptid;
|
inferior_ptid = ecs->ptid;
|
||||||
|
|
75
gdb/thread.c
75
gdb/thread.c
|
@ -124,26 +124,11 @@ add_thread (ptid_t ptid)
|
||||||
{
|
{
|
||||||
struct thread_info *tp;
|
struct thread_info *tp;
|
||||||
|
|
||||||
tp = (struct thread_info *) xmalloc (sizeof (struct thread_info));
|
tp = (struct thread_info *) xmalloc (sizeof (*tp));
|
||||||
|
memset (tp, 0, sizeof (*tp));
|
||||||
tp->ptid = ptid;
|
tp->ptid = ptid;
|
||||||
tp->num = ++highest_thread_num;
|
tp->num = ++highest_thread_num;
|
||||||
tp->prev_pc = 0;
|
|
||||||
tp->prev_func_start = 0;
|
|
||||||
tp->prev_func_name = NULL;
|
|
||||||
tp->step_range_start = 0;
|
|
||||||
tp->step_range_end = 0;
|
|
||||||
tp->step_frame_address = 0;
|
|
||||||
tp->step_resume_breakpoint = 0;
|
|
||||||
tp->through_sigtramp_breakpoint = 0;
|
|
||||||
tp->handling_longjmp = 0;
|
|
||||||
tp->trap_expected = 0;
|
|
||||||
tp->another_trap = 0;
|
|
||||||
tp->stepping_through_solib_after_catch = 0;
|
|
||||||
tp->stepping_through_solib_catchpoints = NULL;
|
|
||||||
tp->stepping_through_sigtramp = 0;
|
|
||||||
tp->next = thread_list;
|
tp->next = thread_list;
|
||||||
tp->private = NULL;
|
|
||||||
thread_list = tp;
|
thread_list = tp;
|
||||||
return tp;
|
return tp;
|
||||||
}
|
}
|
||||||
|
@ -302,15 +287,24 @@ gdb_list_thread_ids (/* output object */)
|
||||||
/* Load infrun state for the thread PID. */
|
/* Load infrun state for the thread PID. */
|
||||||
|
|
||||||
void
|
void
|
||||||
load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, CORE_ADDR *prev_func_start,
|
load_infrun_state (ptid_t ptid,
|
||||||
char **prev_func_name, int *trap_expected,
|
CORE_ADDR *prev_pc,
|
||||||
|
CORE_ADDR *prev_func_start,
|
||||||
|
char **prev_func_name,
|
||||||
|
int *trap_expected,
|
||||||
struct breakpoint **step_resume_breakpoint,
|
struct breakpoint **step_resume_breakpoint,
|
||||||
struct breakpoint **through_sigtramp_breakpoint,
|
struct breakpoint **through_sigtramp_breakpoint,
|
||||||
CORE_ADDR *step_range_start, CORE_ADDR *step_range_end,
|
CORE_ADDR *step_range_start,
|
||||||
CORE_ADDR *step_frame_address, int *handling_longjmp,
|
CORE_ADDR *step_range_end,
|
||||||
int *another_trap, int *stepping_through_solib_after_catch,
|
CORE_ADDR *step_frame_address,
|
||||||
|
int *handling_longjmp,
|
||||||
|
int *another_trap,
|
||||||
|
int *stepping_through_solib_after_catch,
|
||||||
bpstat *stepping_through_solib_catchpoints,
|
bpstat *stepping_through_solib_catchpoints,
|
||||||
int *stepping_through_sigtramp)
|
int *stepping_through_sigtramp,
|
||||||
|
int *current_line,
|
||||||
|
struct symtab **current_symtab,
|
||||||
|
CORE_ADDR *step_sp)
|
||||||
{
|
{
|
||||||
struct thread_info *tp;
|
struct thread_info *tp;
|
||||||
|
|
||||||
|
@ -323,31 +317,43 @@ load_infrun_state (ptid_t ptid, CORE_ADDR *prev_pc, CORE_ADDR *prev_func_start,
|
||||||
*prev_pc = tp->prev_pc;
|
*prev_pc = tp->prev_pc;
|
||||||
*prev_func_start = tp->prev_func_start;
|
*prev_func_start = tp->prev_func_start;
|
||||||
*prev_func_name = tp->prev_func_name;
|
*prev_func_name = tp->prev_func_name;
|
||||||
|
*trap_expected = tp->trap_expected;
|
||||||
*step_resume_breakpoint = tp->step_resume_breakpoint;
|
*step_resume_breakpoint = tp->step_resume_breakpoint;
|
||||||
|
*through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint;
|
||||||
*step_range_start = tp->step_range_start;
|
*step_range_start = tp->step_range_start;
|
||||||
*step_range_end = tp->step_range_end;
|
*step_range_end = tp->step_range_end;
|
||||||
*step_frame_address = tp->step_frame_address;
|
*step_frame_address = tp->step_frame_address;
|
||||||
*through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint;
|
|
||||||
*handling_longjmp = tp->handling_longjmp;
|
*handling_longjmp = tp->handling_longjmp;
|
||||||
*trap_expected = tp->trap_expected;
|
|
||||||
*another_trap = tp->another_trap;
|
*another_trap = tp->another_trap;
|
||||||
*stepping_through_solib_after_catch = tp->stepping_through_solib_after_catch;
|
*stepping_through_solib_after_catch = tp->stepping_through_solib_after_catch;
|
||||||
*stepping_through_solib_catchpoints = tp->stepping_through_solib_catchpoints;
|
*stepping_through_solib_catchpoints = tp->stepping_through_solib_catchpoints;
|
||||||
*stepping_through_sigtramp = tp->stepping_through_sigtramp;
|
*stepping_through_sigtramp = tp->stepping_through_sigtramp;
|
||||||
|
*current_line = tp->current_line;
|
||||||
|
*current_symtab = tp->current_symtab;
|
||||||
|
*step_sp = tp->step_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save infrun state for the thread PID. */
|
/* Save infrun state for the thread PID. */
|
||||||
|
|
||||||
void
|
void
|
||||||
save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, CORE_ADDR prev_func_start,
|
save_infrun_state (ptid_t ptid,
|
||||||
char *prev_func_name, int trap_expected,
|
CORE_ADDR prev_pc,
|
||||||
|
CORE_ADDR prev_func_start,
|
||||||
|
char *prev_func_name,
|
||||||
|
int trap_expected,
|
||||||
struct breakpoint *step_resume_breakpoint,
|
struct breakpoint *step_resume_breakpoint,
|
||||||
struct breakpoint *through_sigtramp_breakpoint,
|
struct breakpoint *through_sigtramp_breakpoint,
|
||||||
CORE_ADDR step_range_start, CORE_ADDR step_range_end,
|
CORE_ADDR step_range_start,
|
||||||
CORE_ADDR step_frame_address, int handling_longjmp,
|
CORE_ADDR step_range_end,
|
||||||
int another_trap, int stepping_through_solib_after_catch,
|
CORE_ADDR step_frame_address,
|
||||||
|
int handling_longjmp,
|
||||||
|
int another_trap,
|
||||||
|
int stepping_through_solib_after_catch,
|
||||||
bpstat stepping_through_solib_catchpoints,
|
bpstat stepping_through_solib_catchpoints,
|
||||||
int stepping_through_sigtramp)
|
int stepping_through_sigtramp,
|
||||||
|
int current_line,
|
||||||
|
struct symtab *current_symtab,
|
||||||
|
CORE_ADDR step_sp)
|
||||||
{
|
{
|
||||||
struct thread_info *tp;
|
struct thread_info *tp;
|
||||||
|
|
||||||
|
@ -360,17 +366,20 @@ save_infrun_state (ptid_t ptid, CORE_ADDR prev_pc, CORE_ADDR prev_func_start,
|
||||||
tp->prev_pc = prev_pc;
|
tp->prev_pc = prev_pc;
|
||||||
tp->prev_func_start = prev_func_start;
|
tp->prev_func_start = prev_func_start;
|
||||||
tp->prev_func_name = prev_func_name;
|
tp->prev_func_name = prev_func_name;
|
||||||
|
tp->trap_expected = trap_expected;
|
||||||
tp->step_resume_breakpoint = step_resume_breakpoint;
|
tp->step_resume_breakpoint = step_resume_breakpoint;
|
||||||
|
tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint;
|
||||||
tp->step_range_start = step_range_start;
|
tp->step_range_start = step_range_start;
|
||||||
tp->step_range_end = step_range_end;
|
tp->step_range_end = step_range_end;
|
||||||
tp->step_frame_address = step_frame_address;
|
tp->step_frame_address = step_frame_address;
|
||||||
tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint;
|
|
||||||
tp->handling_longjmp = handling_longjmp;
|
tp->handling_longjmp = handling_longjmp;
|
||||||
tp->trap_expected = trap_expected;
|
|
||||||
tp->another_trap = another_trap;
|
tp->another_trap = another_trap;
|
||||||
tp->stepping_through_solib_after_catch = stepping_through_solib_after_catch;
|
tp->stepping_through_solib_after_catch = stepping_through_solib_after_catch;
|
||||||
tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints;
|
tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints;
|
||||||
tp->stepping_through_sigtramp = stepping_through_sigtramp;
|
tp->stepping_through_sigtramp = stepping_through_sigtramp;
|
||||||
|
tp->current_line = current_line;
|
||||||
|
tp->current_symtab = current_symtab;
|
||||||
|
tp->step_sp = step_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if TP is an active thread. */
|
/* Return true if TP is an active thread. */
|
||||||
|
|
Loading…
Reference in a new issue