aboutsummaryrefslogtreecommitdiff
path: root/gdb/m2-exp.y
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-10-08 20:33:22 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-10-08 20:33:22 +0000
commit443abae18cc0f7c2654a6d0ddda239a4c6c846a5 (patch)
tree76d1f9fd7a9bb44a320b34e230bc61c687ad3956 /gdb/m2-exp.y
parent1aa6938eb37f89db944795a21aadb98af7e44399 (diff)
downloadgdb-443abae18cc0f7c2654a6d0ddda239a4c6c846a5.zip
gdb-443abae18cc0f7c2654a6d0ddda239a4c6c846a5.tar.gz
gdb-443abae18cc0f7c2654a6d0ddda239a4c6c846a5.tar.bz2
* findvar.c, value.h (symbol_read_needs_frame): New function.
* c-exp.y, m2-exp.y: Call it instead of having our own switch on the symbol's class. * valops.c (value_of_variable): Use symbol_read_needs_frame to decide whether we care about finding a frame.
Diffstat (limited to 'gdb/m2-exp.y')
-rw-r--r--gdb/m2-exp.y27
1 files changed, 3 insertions, 24 deletions
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index ee6799c..cc4001f 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -599,35 +599,14 @@ variable: NAME
NULL);
if (sym)
{
- switch (sym->class)
+ if (symbol_read_needs_frame (sym))
{
- case LOC_REGISTER:
- case LOC_ARG:
- case LOC_LOCAL:
- case LOC_REF_ARG:
- case LOC_REGPARM:
- case LOC_REGPARM_ADDR:
- case LOC_LOCAL_ARG:
- case LOC_BASEREG:
- case LOC_BASEREG_ARG:
if (innermost_block == 0 ||
- contained_in (block_found,
+ contained_in (block_found,
innermost_block))
innermost_block = block_found;
- break;
-
- case LOC_UNDEF:
- case LOC_CONST:
- case LOC_STATIC:
- case LOC_TYPEDEF:
- case LOC_LABEL: /* maybe should go above? */
- case LOC_BLOCK:
- case LOC_CONST_BYTES:
- case LOC_OPTIMIZED_OUT:
- /* These are listed so gcc -Wall will reveal
- un-handled cases. */
- break;
}
+
write_exp_elt_opcode (OP_VAR_VALUE);
/* We want to use the selected frame, not
another more inner frame which happens to