This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[unavailable regs/locals, 09/11] unavailable PC, "info locals" / "info args"
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 22 Feb 2011 13:32:14 +0000
- Subject: [unavailable regs/locals, 09/11] unavailable PC, "info locals" / "info args"
And this makes "info args"/"info locals" behave gracefully for
frames which we don't know the PC.
--
Pedro Alves
2011-02-22 Pedro Alves <pedro@codesourcery.com>
gdb/
* stack.c (print_frame_local_vars, print_frame_arg_vars): Handle
unavailable PC.
---
gdb/stack.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
Index: src/gdb/stack.c
===================================================================
--- src.orig/gdb/stack.c 2011-02-02 11:01:38.917898999 +0000
+++ src/gdb/stack.c 2011-02-02 11:06:25.827898999 +0000
@@ -1629,6 +1629,14 @@ print_frame_local_vars (struct frame_inf
{
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
{
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)