mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 18:44:20 +08:00
gdb/
* tracepoint.c (set_traceframe_context): Handle unavailable PC gracefully.
This commit is contained in:
parent
9a26e44c7c
commit
dba09041c7
@ -1,3 +1,8 @@
|
||||
2011-03-18 Pedro Alves <pedro@codesourcery.com>
|
||||
|
||||
* tracepoint.c (set_traceframe_context): Handle unavailable PC
|
||||
gracefully.
|
||||
|
||||
2011-03-18 Pedro Alves <pedro@codesourcery.com>
|
||||
|
||||
* frame.h (frame_unwind_caller_pc_if_available): Declare.
|
||||
|
@ -268,26 +268,24 @@ set_traceframe_context (struct frame_info *trace_frame)
|
||||
{
|
||||
CORE_ADDR trace_pc;
|
||||
|
||||
if (trace_frame == NULL) /* Cease debugging any trace buffers. */
|
||||
{
|
||||
traceframe_fun = 0;
|
||||
traceframe_sal.pc = traceframe_sal.line = 0;
|
||||
traceframe_sal.symtab = NULL;
|
||||
clear_internalvar (lookup_internalvar ("trace_func"));
|
||||
clear_internalvar (lookup_internalvar ("trace_file"));
|
||||
set_internalvar_integer (lookup_internalvar ("trace_line"), -1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Save as globals for internal use. */
|
||||
trace_pc = get_frame_pc (trace_frame);
|
||||
traceframe_sal = find_pc_line (trace_pc, 0);
|
||||
traceframe_fun = find_pc_function (trace_pc);
|
||||
if (trace_frame != NULL
|
||||
&& get_frame_pc_if_available (trace_frame, &trace_pc))
|
||||
{
|
||||
traceframe_sal = find_pc_line (trace_pc, 0);
|
||||
traceframe_fun = find_pc_function (trace_pc);
|
||||
|
||||
/* Save linenumber as "$trace_line", a debugger variable visible to
|
||||
users. */
|
||||
set_internalvar_integer (lookup_internalvar ("trace_line"),
|
||||
traceframe_sal.line);
|
||||
/* Save linenumber as "$trace_line", a debugger variable visible to
|
||||
users. */
|
||||
set_internalvar_integer (lookup_internalvar ("trace_line"),
|
||||
traceframe_sal.line);
|
||||
}
|
||||
else
|
||||
{
|
||||
init_sal (&traceframe_sal);
|
||||
traceframe_fun = NULL;
|
||||
set_internalvar_integer (lookup_internalvar ("trace_line"), -1);
|
||||
}
|
||||
|
||||
/* Save func name as "$trace_func", a debugger variable visible to
|
||||
users. */
|
||||
|
Loading…
Reference in New Issue
Block a user