+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.
{
CORE_ADDR trace_pc;
- if (trace_frame == NULL) /* Cease debugging any trace buffers. */
+ /* Save as globals for internal use. */
+ 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);
+ }
+ else
{
- 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"));
+ init_sal (&traceframe_sal);
+ traceframe_fun = NULL;
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);
-
- /* Save linenumber as "$trace_line", a debugger variable visible to
- users. */
- set_internalvar_integer (lookup_internalvar ("trace_line"),
- traceframe_sal.line);
-
/* Save func name as "$trace_func", a debugger variable visible to
users. */
if (traceframe_fun == NULL