]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add new memory access interface to expr.c
authorZoran Zaric <Zoran.Zaric@amd.com>
Mon, 7 Dec 2020 19:00:18 +0000 (19:00 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 8 Dec 2020 16:16:19 +0000 (11:16 -0500)
commit0ead7f247ce85b834fb53059da82f8d0d6c41b76
tree70b8f30e11f9dce7fbe3d3638cd68835a7ab7f6d
parentb9b1a8273b1641c585510b7584d3a0f63be6935b
Add new memory access interface to expr.c

DWARF expression evaluator is currently using a few different
interfaces for memory access: write_memory_with_notification,
read_value_memory, read_memory.

They all seem incosistent, while some of them even need a struct
value typed argument to be present.

This patch is simplifying that interface by replacing it with two new
low level functions: read_from_memory and write_to_memory.

The advantage of this new interface is that it behaves in the same way
as the register access interface from the previous patch. Both of these
have the same error returning policy, which will be usefull for the
following patches.

* dwarf2/expr.c (xfer_from_memory):  New function.
(read_from_memory): New function.
(write_to_memory): New function.
(rw_pieced_value): Now calls the read_from_memory and
write_to_memory functions.

Change-Id: Id1f4c9b8127da83dece543e68757ffb1de2afedd
gdb/dwarf2/expr.c