gdb/
authorPedro Alves <palves@redhat.com>
Fri, 18 Mar 2011 18:48:56 +0000 (18:48 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 18 Mar 2011 18:48:56 +0000 (18:48 +0000)
* stack.c (print_frame_local_vars, print_frame_arg_vars): Handle
unavailable PC.

gdb/ChangeLog
gdb/stack.c

index 388e5d6b5a59fb89357e995227b6589db76c3ebb..7fb05100cf4f3740d82c4de2f8812295a1fb3bc0 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-18  Pedro Alves  <pedro@codesourcery.com>
+
+       * stack.c (print_frame_local_vars, print_frame_arg_vars): Handle
+       unavailable PC.
+
 2011-03-18  Pedro Alves  <pedro@codesourcery.com>
 
        * tracepoint.c (set_traceframe_context): Handle unavailable PC
index dba77d4bf303046ec56b7b1fa90634be31f5bfc4..0888b69d3f37f8964f0ff2eca7ce5afc5f20db2a 100644 (file)
@@ -1629,6 +1629,14 @@ print_frame_local_vars (struct frame_info *frame, int num_tabs,
 {
   struct print_variable_and_value_data cb_data;
   struct block *block;
+  CORE_ADDR pc;
+
+  if (!get_frame_pc_if_available (frame, &pc))
+    {
+      fprintf_filtered (stream,
+                       _("PC unavailable, cannot determine locals.\n"));
+      return;
+    }
 
   block = get_frame_block (frame, 0);
   if (block == 0)
@@ -1781,6 +1789,13 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
 {
   struct print_variable_and_value_data cb_data;
   struct symbol *func;
+  CORE_ADDR pc;
+
+  if (!get_frame_pc_if_available (frame, &pc))
+    {
+      fprintf_filtered (stream, _("PC unavailable, cannot determine args.\n"));
+      return;
+    }
 
   func = get_frame_function (frame);
   if (func == NULL)