aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2002-08-19 23:19:53 +0000
committerDavid Carlton <carlton@bactrian.org>2002-08-19 23:19:53 +0000
commit2c2738a0e0b459fdbf385972b2820e6cfcb0324d (patch)
tree07cd168b53f36b9052d704013c30b8b34e770e48 /gdb/valops.c
parent2a73a662d6126607a81bd392614c30daa16580f0 (diff)
downloadfsf-binutils-gdb-2c2738a0e0b459fdbf385972b2820e6cfcb0324d.zip
fsf-binutils-gdb-2c2738a0e0b459fdbf385972b2820e6cfcb0324d.tar.gz
fsf-binutils-gdb-2c2738a0e0b459fdbf385972b2820e6cfcb0324d.tar.bz2
2002-08-19 David Carlton <carlton@math.stanford.edu>
* valops.c (search_struct_field): Change error message to treat return value of 0 from value_static_field as meaning that field is optimized out. (value_struct_elt_for_reference): Ditto. * values.c (value_static_field): Treat an unresolved location the same as a nonexistent symbol. Fix PR gdb/635.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 1d0039f..d7c889f 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2054,11 +2054,18 @@ search_struct_field (char *name, struct value *arg1, int offset,
{
struct value *v;
if (TYPE_FIELD_STATIC (type, i))
- v = value_static_field (type, i);
+ {
+ v = value_static_field (type, i);
+ if (v == 0)
+ error ("field %s is nonexistent or has been optimised out",
+ name);
+ }
else
- v = value_primitive_field (arg1, offset, i, type);
- if (v == 0)
- error ("there is no field named %s", name);
+ {
+ v = value_primitive_field (arg1, offset, i, type);
+ if (v == 0)
+ error ("there is no field named %s", name);
+ }
return v;
}
@@ -3043,7 +3050,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
{
v = value_static_field (t, i);
if (v == NULL)
- error ("Internal error: could not find static variable %s",
+ error ("static field %s has been optimized out",
name);
return v;
}