diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-12-24 10:38:35 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-12-24 11:15:01 -0500 |
commit | 78f2fd84e832c49a496ab712512be058c0c2912b (patch) | |
tree | a3a2968753c42b5fe6b940166689a42d9466822d /gdb/value.h | |
parent | 8b31004bd82d3833d042dc5d456e1279635734ab (diff) | |
download | fsf-binutils-gdb-78f2fd84e832c49a496ab712512be058c0c2912b.zip fsf-binutils-gdb-78f2fd84e832c49a496ab712512be058c0c2912b.tar.gz fsf-binutils-gdb-78f2fd84e832c49a496ab712512be058c0c2912b.tar.bz2 |
gdb: remove VALUE_REGNUM, add value::regnum
Remove VALUE_REGNUM, replace it with a method on struct value. Set
`m_location.reg.regnum` directly from value::allocate_register_lazy,
which is fine because allocate_register_lazy is a static creation
function for struct value.
Change-Id: Id632502357da971617d9dce1e2eab9b56dbcf52d
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/value.h b/gdb/value.h index 0e8c759..9fd8732 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -383,7 +383,16 @@ public: return m_location.reg.next_frame_id; } - int *deprecated_regnum_hack (); + /* Return this value's register number. + + The value must be of lval == lval_register. */ + int regnum () + { + gdb_assert (m_lval == lval_register); + + return m_location.reg.regnum; + } + /* contents() and contents_raw() both return the address of the gdb buffer used to hold a copy of the contents of the lval. @@ -972,9 +981,6 @@ extern void error_value_optimized_out (void); /* Pointer to internal variable. */ #define VALUE_INTERNALVAR(val) (*((val)->deprecated_internalvar_hack ())) -/* Register number if the value is from a register. */ -#define VALUE_REGNUM(val) (*((val)->deprecated_regnum_hack ())) - /* Return value after lval_funcs->coerce_ref (after check_typedef). Return NULL if lval_funcs->coerce_ref is not applicable for whatever reason. */ |