From feb13ab03fc262ada6379aa92441e48e93b29f0a Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 7 Feb 2005 04:50:28 +0000 Subject: 2005-02-06 Andrew Cagney * value.h (VALUE_OPTIMIZED_OUT): Delete. (value_optimized_out, set_value_optimized_out): Declare. * value.c (set_value_optimized_out, value_optimized_out): Define. * valprint.c, findvar.c, dwarf2loc.c: Update. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2loc.c | 6 ++++-- gdb/findvar.c | 6 +++--- gdb/valprint.c | 2 +- gdb/value.c | 15 +++++++++++++-- gdb/value.h | 3 ++- 6 files changed, 28 insertions(+), 9 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 33ac6bb..6c20395 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2005-02-06 Andrew Cagney + * value.h (VALUE_OPTIMIZED_OUT): Delete. + (value_optimized_out, set_value_optimized_out): Declare. + * value.c (set_value_optimized_out, value_optimized_out): Define. + * valprint.c, findvar.c, dwarf2loc.c: Update. + * value.c (value_contents, value_contents_writeable): New functions. * value.h (VALUE_CONTENTS): Delete macro. diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 6657791..037adf3 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1,5 +1,7 @@ /* DWARF 2 location expression support for GDB. - Copyright 2003 Free Software Foundation, Inc. + + Copyright 2003, 2005 Free Software Foundation, Inc. + Contributed by Daniel Jacobowitz, MontaVista Software, Inc. This file is part of GDB. @@ -214,7 +216,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, { retval = allocate_value (SYMBOL_TYPE (var)); VALUE_LVAL (retval) = not_lval; - VALUE_OPTIMIZED_OUT (retval) = 1; + set_value_optimized_out (retval, 1); } baton.frame = frame; diff --git a/gdb/findvar.c b/gdb/findvar.c index 94140d6..aff138a 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -287,7 +287,7 @@ value_of_register (int regnum, struct frame_info *frame) VALUE_LVAL (reg_val) = lval; VALUE_ADDRESS (reg_val) = addr; VALUE_REGNUM (reg_val) = regnum; - VALUE_OPTIMIZED_OUT (reg_val) = optim; + set_value_optimized_out (reg_val, optim); VALUE_FRAME_ID (reg_val) = get_frame_id (frame); return reg_val; } @@ -576,7 +576,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i case LOC_OPTIMIZED_OUT: VALUE_LVAL (v) = not_lval; - VALUE_OPTIMIZED_OUT (v) = 1; + set_value_optimized_out (v, 1); return v; default: @@ -701,7 +701,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_REGNUM (v) = regnum; } - VALUE_OPTIMIZED_OUT (v) = optimized; + set_value_optimized_out (v, optimized); /* Any structure stored in more than one register will always be an integral number of registers. Otherwise, you need to do diff --git a/gdb/valprint.c b/gdb/valprint.c index 9285906..dfcd722 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -164,7 +164,7 @@ value_print (struct value *val, struct ui_file *stream, int format, printf_filtered ("
"); return 0; } - if (VALUE_OPTIMIZED_OUT (val)) + if (value_optimized_out (val)) { printf_filtered (""); return 0; diff --git a/gdb/value.c b/gdb/value.c index fecbbf5..cf9e137 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -96,7 +96,7 @@ allocate_value (struct type *type) val->bitsize = 0; VALUE_REGNUM (val) = -1; val->lazy = 0; - VALUE_OPTIMIZED_OUT (val) = 0; + val->optimized_out = 0; VALUE_EMBEDDED_OFFSET (val) = 0; VALUE_POINTED_TO_OFFSET (val) = 0; val->modifiable = 1; @@ -193,6 +193,17 @@ value_contents_writeable (struct value *value) return value->aligner.contents; } +int +value_optimized_out (struct value *value) +{ + return value->optimized_out; +} + +void +set_value_optimized_out (struct value *value, int val) +{ + value->optimized_out = val; +} /* Return a mark in the value chain. All values allocated after the mark is obtained (except for those released) are subject to being freed @@ -297,7 +308,7 @@ value_copy (struct value *arg) VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg); VALUE_REGNUM (val) = VALUE_REGNUM (arg); val->lazy = arg->lazy; - VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg); + val->optimized_out = arg->optimized_out; VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg); VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg); val->modifiable = arg->modifiable; diff --git a/gdb/value.h b/gdb/value.h index 50ea6d9..0a3d6af 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -213,7 +213,8 @@ extern int value_fetch_lazy (struct value *val); #define VALUE_INTERNALVAR(val) (val)->location.internalvar #define VALUE_FRAME_ID(val) ((val)->frame_id) #define VALUE_REGNUM(val) (val)->regnum -#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out) +extern int value_optimized_out (struct value *value); +extern void set_value_optimized_out (struct value *value, int val); #define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset) #define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset) -- cgit v1.1