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.c | |
parent | 8b31004bd82d3833d042dc5d456e1279635734ab (diff) | |
download | gdb-78f2fd84e832c49a496ab712512be058c0c2912b.zip gdb-78f2fd84e832c49a496ab712512be058c0c2912b.tar.gz 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.c')
-rw-r--r-- | gdb/value.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/gdb/value.c b/gdb/value.c index 87eb6ef..086f8c9 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -971,7 +971,7 @@ value::allocate_register_lazy (frame_info_ptr next_frame, int regnum, value *result = value::allocate_lazy (type); result->set_lval (lval_register); - VALUE_REGNUM (result) = regnum; + result->m_location.reg.regnum = regnum; result->m_location.reg.next_frame_id = get_frame_id (next_frame); return result; @@ -1421,14 +1421,6 @@ value::set_address (CORE_ADDR addr) m_location.address = addr; } -int * -value::deprecated_regnum_hack () -{ - gdb_assert (m_lval == lval_register); - return &m_location.reg.regnum; -} - - /* Return a mark in the value chain. All values allocated after the mark is obtained (except for those released) are subject to being freed if a subsequent value_free_to_mark is passed the mark. */ @@ -3921,8 +3913,6 @@ value::fetch_lazy_memory () void value::fetch_lazy_register () { - - int regnum; struct type *type = check_typedef (this->type ()); struct value *new_val = this; @@ -3938,7 +3928,7 @@ value::fetch_lazy_register () frame_info_ptr next_frame = frame_find_by_id (next_frame_id); gdb_assert (next_frame != NULL); - regnum = VALUE_REGNUM (new_val); + int regnum = new_val->regnum (); /* Convertible register routines are used for multi-register values and for interpretation in different types @@ -3982,7 +3972,7 @@ value::fetch_lazy_register () { frame_info_ptr frame = frame_find_by_id (this->next_frame_id ()); frame = get_prev_frame_always (frame); - regnum = VALUE_REGNUM (this); + int regnum = this->regnum (); gdbarch *gdbarch = get_frame_arch (frame); string_file debug_file; @@ -4003,8 +3993,7 @@ value::fetch_lazy_register () gdb::array_view<const gdb_byte> buf = new_val->contents (); if (new_val->lval () == lval_register) - gdb_printf (&debug_file, " register=%d", - VALUE_REGNUM (new_val)); + gdb_printf (&debug_file, " register=%d", new_val->regnum ()); else if (new_val->lval () == lval_memory) gdb_printf (&debug_file, " address=%s", paddress (gdbarch, |