diff options
author | Daniel Jacobowitz <drow@false.org> | 2005-03-07 22:38:04 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2005-03-07 22:38:04 +0000 |
commit | bb04426270995d00357531c2f08887bcc8661a1f (patch) | |
tree | add032ff0364050495d68aa0ddcf149df2da97fd | |
parent | 384e1a6106a6de8ed9e5df2cab4e90b62420902e (diff) | |
download | gdb-bb04426270995d00357531c2f08887bcc8661a1f.zip gdb-bb04426270995d00357531c2f08887bcc8661a1f.tar.gz gdb-bb04426270995d00357531c2f08887bcc8661a1f.tar.bz2 |
* findvar.c (read_var_value): Don't allocate V when it will not
be used. Add missing break for LOC_INDIRECT.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/findvar.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5440897..70415c0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2005-03-07 Daniel Jacobowitz <dan@codesourcery.com> + + * findvar.c (read_var_value): Don't allocate V when it will not + be used. Add missing break for LOC_INDIRECT. + 2005-03-06 Mark Kettenis <kettenis@gnu.org> * sparc64fbsd-tdep.c: Include "solib-svr4.h". diff --git a/gdb/findvar.c b/gdb/findvar.c index 84964f3..8c48c93 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -385,12 +385,20 @@ read_var_value (struct symbol *var, struct frame_info *frame) CORE_ADDR addr; int len; - v = allocate_value (type); - VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */ + if (SYMBOL_CLASS (var) == LOC_COMPUTED + || SYMBOL_CLASS (var) == LOC_COMPUTED_ARG + || SYMBOL_CLASS (var) == LOC_REGISTER + || SYMBOL_CLASS (var) == LOC_REGPARM) + /* These cases do not use V. */ + v = NULL; + else + { + v = allocate_value (type); + VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */ + } len = TYPE_LENGTH (type); - /* FIXME drow/2003-09-06: this call to the selected frame should be pushed upwards to the callers. */ if (frame == NULL) @@ -452,6 +460,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i locaddr = SYMBOL_VALUE_ADDRESS (var); loc = value_at (lookup_pointer_type (type), locaddr); addr = value_as_address (loc); + break; } case LOC_ARG: |