diff options
author | Zoran Zaric <zoran.zaric@amd.com> | 2020-09-15 11:37:19 +0100 |
---|---|---|
committer | Zoran Zaric <zoran.zaric@amd.com> | 2021-08-05 16:39:59 +0100 |
commit | 3c7c57cdc06412d9c81dcc2d89ff2ab4e4704708 (patch) | |
tree | 84e78430ae81223e1b923ed4b7aab54cb0f90b6a /gdb/dwarf2 | |
parent | 73e6b863308a026a5c87dc73ab2417ee39027d4c (diff) | |
download | gdb-3c7c57cdc06412d9c81dcc2d89ff2ab4e4704708.zip gdb-3c7c57cdc06412d9c81dcc2d89ff2ab4e4704708.tar.gz gdb-3c7c57cdc06412d9c81dcc2d89ff2ab4e4704708.tar.bz2 |
Move read_mem to dwarf_expr_context
Following the idea of merging the evaluators, the read_mem method can
be moved from dwarf_expr_executor and dwarf_evaluate_loc_desc classes
to their base class dwarf_expr_context.
gdb/ChangeLog:
* dwarf2/expr.c (dwarf_expr_context::read_mem): Move from
dwarf_evaluate_loc_desc.
* dwarf2/frame.c (dwarf_expr_executor::read_mem): Remove
method.
* dwarf2/loc.c (dwarf_evaluate_loc_desc::read_mem): Move to
dwarf_expr_context.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/expr.c | 9 | ||||
-rw-r--r-- | gdb/dwarf2/expr.h | 2 | ||||
-rw-r--r-- | gdb/dwarf2/frame.c | 5 | ||||
-rw-r--r-- | gdb/dwarf2/loc.c | 7 |
4 files changed, 10 insertions, 13 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index b13de98..dac693d 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -249,6 +249,15 @@ dwarf_expr_context::dwarf_call (cu_offset die_cu_off) this->eval (block.data, block.size); } +/* See expr.h. */ + +void +dwarf_expr_context::read_mem (gdb_byte *buf, CORE_ADDR addr, + size_t length) +{ + read_memory (addr, buf, length); +} + /* Require that TYPE be an integral type; throw an exception if not. */ static void diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index d10bf9c..3a085fd 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -192,7 +192,7 @@ struct dwarf_expr_context CORE_ADDR obj_address = 0; /* Read LENGTH bytes at ADDR into BUF. */ - virtual void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t length) = 0; + virtual void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t length); /* Push on DWARF stack an entry evaluated for DW_TAG_call_site's parameter matching KIND and KIND_U at the caller of specified BATON. diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 37d3a40..76a546f 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -232,11 +232,6 @@ public: : dwarf_expr_context (per_objfile) {} - void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t len) override - { - read_memory (addr, buf, len); - } - void push_dwarf_reg_entry_value (enum call_site_parameter_kind kind, union call_site_parameter_u kind_u, int deref_size) override diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 217d74c..a23c676 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -728,13 +728,6 @@ public: this->eval (data_src, size); } - - /* Read memory at ADDR (length LEN) into BUF. */ - - void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t len) override - { - read_memory (addr, buf, len); - } }; /* See dwarf2loc.h. */ |