]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Move read_addr_from_reg function to frame.c
authorZoran Zaric <Zoran.Zaric@amd.com>
Mon, 7 Dec 2020 19:00:25 +0000 (19:00 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 8 Dec 2020 16:16:20 +0000 (11:16 -0500)
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.

Change-Id: I15c798d3e001f56cfd78a1e96dd0d6034c844b91

gdb/dwarf2/expr.c
gdb/dwarf2/expr.h
gdb/dwarf2/frame.c

index a259f5d5d5cd0aa5f34f4a3fafdc513e48901572..9f2c77197a60e28e50bbb5a7ee979772f1bd59af 100644 (file)
@@ -97,17 +97,6 @@ ill_formed_expression ()
   error (_("Ill-formed DWARF expression"));
 }
 
-/* See expr.h.  */
-
-CORE_ADDR
-read_addr_from_reg (struct 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
index 5fb4b0857e9a8284b1b364a99f060ad8d50e3db4..63fe78993940fb9ca8b9ee48920dbccc21454ade 100644 (file)
@@ -51,10 +51,6 @@ struct value *dwarf2_eval_exp (const gdb_byte *addr, size_t len, bool as_lval,
    ADDR_SIZE is expected size of the type.  */
 struct type *address_type (struct gdbarch *gdbarch, 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 (struct frame_info *, int);
-
 /* 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).  */
index dd4eca9aac6839ceb9bd57947e497958706a6f6f..1469621133f414eeba08aa9d7d1f2e48dbd3dacc 100644 (file)
@@ -192,6 +192,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 (struct 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);
+}
+
 /* Execute the required actions for both the DW_CFA_restore and
 DW_CFA_restore_extended instructions.  */
 static void