From 9ee8fc9d71a37137239836d8c2dbe1e87f999960 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 13 Nov 2004 00:53:09 +0000 Subject: [PATCH] 2004-11-12 Andrew Cagney Merge VALUE_REGNO and VALUE_FRAME_REGNUM into VALUE_REGNUM. * value.h (VALUE_REGNO, VALUE_FRAME_REGNUM): Delete. (VALUE_REGNUM): Define. (struct value): Delete location.regnum, rename "regno" to "regnum". * value.c, valops.c, valarith.c, findvar.c: Update. --- gdb/ChangeLog | 7 +++++++ gdb/findvar.c | 22 +++++++++++----------- gdb/valarith.c | 2 +- gdb/valops.c | 8 ++++---- gdb/value.c | 6 +++--- gdb/value.h | 8 ++------ 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b089bcad72..c2c25aa0c5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2004-11-12 Andrew Cagney + Merge VALUE_REGNO and VALUE_FRAME_REGNUM into VALUE_REGNUM. + * value.h (VALUE_REGNO, VALUE_FRAME_REGNUM): Delete. + (VALUE_REGNUM): Define. + (struct value): Delete location.regnum, rename "regno" to + "regnum". + * value.c, valops.c, valarith.c, findvar.c: Update. + * value.h (VALUE_TYPE, VALUE_NEXT, VALUE_OFFSET, VALUE_BITSIZE) (VALUE_BITPOS): Delete. (value_type, value_offset, value_bitsize, value_bitpos): Declare. diff --git a/gdb/findvar.c b/gdb/findvar.c index 5ebc6e5f7b..c4b85321a4 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -286,7 +286,7 @@ value_of_register (int regnum, struct frame_info *frame) register_size (current_gdbarch, regnum)); VALUE_LVAL (reg_val) = lval; VALUE_ADDRESS (reg_val) = addr; - VALUE_REGNO (reg_val) = regnum; + VALUE_REGNUM (reg_val) = regnum; VALUE_OPTIMIZED_OUT (reg_val) = optim; return reg_val; } @@ -622,7 +622,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) We'll just attribute the value to the original register. */ VALUE_LVAL (v) = lval_register; VALUE_ADDRESS (v) = regnum; - VALUE_REGNO (v) = regnum; + VALUE_REGNUM (v) = regnum; } else if (CONVERT_REGISTER_P (regnum, type)) { @@ -636,7 +636,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) REGISTER_TO_VALUE (frame, regnum, type, VALUE_CONTENTS_RAW (v)); VALUE_LVAL (v) = lval_reg_frame_relative; VALUE_FRAME_ID (v) = get_frame_id (frame); - VALUE_FRAME_REGNUM (v) = regnum; + VALUE_REGNUM (v) = regnum; } else { @@ -696,7 +696,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) { VALUE_LVAL (v) = lval_reg_frame_relative; VALUE_FRAME_ID (v) = get_frame_id (frame); - VALUE_FRAME_REGNUM (v) = regnum; + VALUE_REGNUM (v) = regnum; } else if (mem_stor) { @@ -707,7 +707,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) { VALUE_LVAL (v) = lval_register; VALUE_ADDRESS (v) = first_addr; - VALUE_REGNO (v) = first_realnum; + VALUE_REGNUM (v) = first_realnum; } else internal_error (__FILE__, __LINE__, @@ -764,21 +764,21 @@ locate_var_value (struct symbol *var, struct frame_info *frame) switch (VALUE_LVAL (lazy_value)) { case lval_register: - gdb_assert (REGISTER_NAME (VALUE_REGNO (lazy_value)) != NULL - && *REGISTER_NAME (VALUE_REGNO (lazy_value)) != '\0'); + gdb_assert (REGISTER_NAME (VALUE_REGNUM (lazy_value)) != NULL + && *REGISTER_NAME (VALUE_REGNUM (lazy_value)) != '\0'); error("Address requested for identifier " "\"%s\" which is in register $%s", SYMBOL_PRINT_NAME (var), - REGISTER_NAME (VALUE_REGNO (lazy_value))); + REGISTER_NAME (VALUE_REGNUM (lazy_value))); break; case lval_reg_frame_relative: - gdb_assert (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != NULL - && *REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != '\0'); + gdb_assert (REGISTER_NAME (VALUE_REGNUM (lazy_value)) != NULL + && *REGISTER_NAME (VALUE_REGNUM (lazy_value)) != '\0'); error("Address requested for identifier " "\"%s\" which is in frame register $%s", SYMBOL_PRINT_NAME (var), - REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value))); + REGISTER_NAME (VALUE_REGNUM (lazy_value))); break; default: diff --git a/gdb/valarith.c b/gdb/valarith.c index 4fd0e74c42..ea93ea1111 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -277,7 +277,7 @@ value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound else VALUE_LVAL (v) = VALUE_LVAL (array); VALUE_ADDRESS (v) = VALUE_ADDRESS (array); - VALUE_REGNO (v) = VALUE_REGNO (array); + VALUE_REGNUM (v) = VALUE_REGNUM (array); v->offset = value_offset (array) + elt_offs; return v; } diff --git a/gdb/valops.c b/gdb/valops.c index a6a54e1de9..6fa1577851 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -606,23 +606,23 @@ value_assign (struct value *toval, struct value *fromval) if (VALUE_LVAL (toval) == lval_register) { frame = get_current_frame (); - value_reg = VALUE_REGNO (toval); + value_reg = VALUE_REGNUM (toval); } else { frame = frame_find_by_id (VALUE_FRAME_ID (toval)); - value_reg = VALUE_FRAME_REGNUM (toval); + value_reg = VALUE_REGNUM (toval); } if (!frame) error ("Value being assigned to is no longer active."); if (VALUE_LVAL (toval) == lval_reg_frame_relative - && CONVERT_REGISTER_P (VALUE_FRAME_REGNUM (toval), type)) + && CONVERT_REGISTER_P (VALUE_REGNUM (toval), type)) { /* If TOVAL is a special machine register requiring conversion of program values to a special raw format. */ - VALUE_TO_REGISTER (frame, VALUE_FRAME_REGNUM (toval), + VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval), type, VALUE_CONTENTS (fromval)); } else diff --git a/gdb/value.c b/gdb/value.c index f8300b17a2..2bbaeaca7e 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -94,7 +94,7 @@ allocate_value (struct type *type) val->offset = 0; val->bitpos = 0; val->bitsize = 0; - VALUE_REGNO (val) = -1; + VALUE_REGNUM (val) = -1; VALUE_LAZY (val) = 0; VALUE_OPTIMIZED_OUT (val) = 0; VALUE_EMBEDDED_OFFSET (val) = 0; @@ -248,7 +248,7 @@ value_copy (struct value *arg) val->bitpos = arg->bitpos; val->bitsize = arg->bitsize; VALUE_FRAME_ID (val) = VALUE_FRAME_ID (arg); - VALUE_REGNO (val) = VALUE_REGNO (arg); + VALUE_REGNUM (val) = VALUE_REGNUM (arg); VALUE_LAZY (val) = VALUE_LAZY (arg); VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg); VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg); @@ -963,7 +963,7 @@ value_primitive_field (struct value *arg1, int offset, if (VALUE_LVAL (arg1) == lval_internalvar) VALUE_LVAL (v) = lval_internalvar_component; VALUE_ADDRESS (v) = VALUE_ADDRESS (arg1); - VALUE_REGNO (v) = VALUE_REGNO (arg1); + VALUE_REGNUM (v) = VALUE_REGNUM (arg1); /* VALUE_OFFSET (v) = VALUE_OFFSET (arg1) + offset + TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; */ return v; diff --git a/gdb/value.h b/gdb/value.h index fc556ac254..0feddbf105 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -58,9 +58,6 @@ struct value /* Pointer to internal variable. */ struct internalvar *internalvar; - - /* Number of register. Only used with lval_reg_frame_relative. */ - int regnum; } location; /* Describes offset of a value within lval of a structure in bytes. @@ -139,7 +136,7 @@ struct value struct value *next; /* Register number if the value is from a register. */ - short regno; + short regnum; /* If zero, contents of this value are in the contents field. If nonzero, contents are in inferior memory at address in the @@ -218,9 +215,8 @@ extern int value_fetch_lazy (struct value *val); #define VALUE_LVAL(val) (val)->lval #define VALUE_ADDRESS(val) (val)->location.address #define VALUE_INTERNALVAR(val) (val)->location.internalvar -#define VALUE_FRAME_REGNUM(val) ((val)->location.regnum) #define VALUE_FRAME_ID(val) ((val)->frame_id) -#define VALUE_REGNO(val) (val)->regno +#define VALUE_REGNUM(val) (val)->regnum #define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out) #define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset) #define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)