* tracepoint.c (set_traceframe_context): Handle unavailable PC
	gracefully.
This commit is contained in:
Pedro Alves 2011-03-18 18:47:56 +00:00
parent 9a26e44c7c
commit dba09041c7
2 changed files with 21 additions and 18 deletions

View File

@ -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.

View File

@ -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. */