diff options
author | Zoran Zaric <Zoran.Zaric@amd.com> | 2020-09-24 12:04:50 +0100 |
---|---|---|
committer | Zoran Zaric <zoran.zaric@amd.com> | 2021-11-05 11:46:38 +0000 |
commit | a572357c566093a2a4541e60ce177d04b55afb8a (patch) | |
tree | 80ff05a378ee8e09bb0e021fde7f430b4c6ee812 | |
parent | 54ecae43a304bc9421e09d96c08c030ff3ef4244 (diff) | |
download | binutils-gdb-a572357c566093a2a4541e60ce177d04b55afb8a.tar.gz |
Move read_addr_from_reg function to frame.c
read_addr_from_reg function is now only called from frame.c file, this
means that the function can safely be moved there.
gdb/ChangeLog:
* dwarf2/expr.c (read_addr_from_reg): Move function to frame.c.
* dwarf2/expr.h (read_addr_from_reg): Remove function.
* dwarf2/frame.c (read_addr_from_reg): Add function from
expr.c.
-rw-r--r-- | gdb/dwarf2/expr.c | 11 | ||||
-rw-r--r-- | gdb/dwarf2/expr.h | 4 | ||||
-rw-r--r-- | gdb/dwarf2/frame.c | 12 |
3 files changed, 12 insertions, 15 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 8ebc1dfdfe4..15164babdd6 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -104,17 +104,6 @@ ill_formed_expression () error (_("Ill-formed DWARF expression")); } -/* See expr.h. */ - -CORE_ADDR -read_addr_from_reg (frame_info *frame, int reg) -{ - struct gdbarch *gdbarch = get_frame_arch (frame); - int regnum = dwarf_reg_to_regnum_or_error (gdbarch, reg); - - return address_from_register (regnum, frame); -} - /* Read register REGNUM's contents in a given FRAME context. The data read is offsetted by OFFSET, and the number of bytes read diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index df097f8867d..955fc84f441 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -51,10 +51,6 @@ value *dwarf2_evaluate (const gdb_byte *addr, size_t len, bool as_lval, ADDR_SIZE is expected size of the type. */ type *address_type (gdbarch *arch, int addr_size); -/* Return the value of register number REG (a DWARF register number), - read as an address in a given FRAME. */ -CORE_ADDR read_addr_from_reg (frame_info *frame, int reg); - /* Check that the current operator is either at the end of an expression, or that it is followed by a composition operator or by DW_OP_GNU_uninit (which should terminate the expression). */ diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index f97387a9d71..e17b36e243b 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -193,6 +193,18 @@ dwarf2_frame_state::dwarf2_frame_state (CORE_ADDR pc_, struct dwarf2_cie *cie) { } +/* Return the value of register number REG (a DWARF register number), + read as an address in a given FRAME. */ + +static CORE_ADDR +read_addr_from_reg (frame_info *frame, int reg) +{ + gdbarch *arch = get_frame_arch (frame); + int regnum = dwarf_reg_to_regnum_or_error (arch, reg); + + return address_from_register (regnum, frame); +} + /* Execute the required actions for both the DW_CFA_restore and DW_CFA_restore_extended instructions. */ static void |