aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1991-04-22 20:08:53 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1991-04-22 20:08:53 +0000
commit777bef06cd075ee4031187fe28381d5d5edd4f94 (patch)
tree0ca9c4eaec086bb1a36e3ae9a7f6f29757612ca7 /gdb/findvar.c
parentfcb887ffcd896af0b53c7ac8808bfeed54b321e8 (diff)
downloadgdb-777bef06cd075ee4031187fe28381d5d5edd4f94.zip
gdb-777bef06cd075ee4031187fe28381d5d5edd4f94.tar.gz
gdb-777bef06cd075ee4031187fe28381d5d5edd4f94.tar.bz2
Check for NULL selected_frame in various places.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 25ff0ba..5ac03bc 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -354,7 +354,8 @@ supply_register (regno, val)
/* Given a struct symbol for a variable,
and a stack frame id, read the value of the variable
and return a (pointer to a) struct value containing the value.
- If the variable cannot be found, return a zero pointer. */
+ If the variable cannot be found, return a zero pointer.
+ If FRAME is NULL, use the selected_frame. */
value
read_var_value (var, frame)
@@ -411,6 +412,8 @@ read_var_value (var, frame)
case LOC_ARG:
fi = get_frame_info (frame);
+ if (fi == NULL)
+ return 0;
addr = FRAME_ARGS_ADDRESS (fi);
if (!addr) {
return 0;
@@ -420,6 +423,8 @@ read_var_value (var, frame)
case LOC_REF_ARG:
fi = get_frame_info (frame);
+ if (fi == NULL)
+ return 0;
addr = FRAME_ARGS_ADDRESS (fi);
if (!addr) {
return 0;
@@ -431,6 +436,8 @@ read_var_value (var, frame)
case LOC_LOCAL:
case LOC_LOCAL_ARG:
fi = get_frame_info (frame);
+ if (fi == NULL)
+ return 0;
addr = SYMBOL_VALUE (var) + FRAME_LOCALS_ADDRESS (fi);
break;
@@ -445,8 +452,12 @@ read_var_value (var, frame)
case LOC_REGISTER:
case LOC_REGPARM:
{
- struct block *b = get_frame_block (frame);
+ struct block *b;
+ if (frame == NULL)
+ return 0;
+ b = get_frame_block (frame);
+
v = value_from_register (type, SYMBOL_VALUE (var), frame);
if (REG_STRUCT_HAS_ADDR(b->gcc_compile_flag)