mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
0579205aec
Idea of this patch is to get a clean and simple public interface for the dwarf_expr_context class, looking like: - constructor, - destructor, - push_address method and - evaluate method. Where constructor should only ever require a target architecture information. This information is held in per object file (dwarf2_per_objfile) structure, so it makes sense to keep that structure as a constructor argument. It also makes sense to get the address size from that structure, but unfortunately that interface doesn't exist at the moment, so the dwarf_expr_context class user needs to provide that information. The push_address method is used to push a CORE_ADDR as a value on top of the DWARF stack before the evaluation. This method can be later changed to push any struct value object on the stack. The evaluate method is the method that evaluates a DWARF expression and provides the evaluation result, in a form of a single struct value object that describes a location. To do this, the method requires a context of the evaluation, as well as expected result type information. If the type information is not provided, the DWARF generic type will be used instead. To avoid storing the gdbarch information in the evaluator object, that information is now always acquired from the per_objfile object. All data members are now private and only visible to the evaluator class, so a m_ prefix was added to all of their names to reflect that. To make this distinction clear, they are also accessed through objects this pointer, wherever that was not the case before. gdb/ChangeLog: * dwarf2/expr.c (dwarf_expr_context::dwarf_expr_context): Add address size argument. (dwarf_expr_context::read_mem): Change to use property_addr_info structure. (dwarf_expr_context::evaluate): New function. (dwarf_expr_context::execute_stack_op): Change to use property_addr_info structure. * dwarf2/expr.h (struct dwarf_expr_context): New evaluate declaration. Change eval and fetch_result method to private. (dwarf_expr_context::gdbarch): Remove member. (dwarf_expr_context::stack): Make private and add m_ prefix. (dwarf_expr_context::addr_size): Make private and add m_ prefix. (dwarf_expr_context::recursion_depth): Make private and add m_ prefix. (dwarf_expr_context::max_recursion_depth): Make private and add m_ prefix. (dwarf_expr_context::len): Make private and add m_ prefix. (dwarf_expr_context::data): Make private and add m_ prefix. (dwarf_expr_context::initialized): Make private and add m_ prefix. (dwarf_expr_context::pieces): Make private and add m_ prefix. (dwarf_expr_context::per_objfile): Make private and add m_ prefix. (dwarf_expr_context::frame): Make private and add m_ prefix. (dwarf_expr_context::per_cu): Make private and add m_ prefix. (dwarf_expr_context::addr_info): Make private and add m_ prefix. * dwarf2/frame.c (execute_stack_op): Change to call evaluate method. * dwarf2/loc.c (dwarf2_evaluate_loc_desc_full): Change to call evaluate method. (dwarf2_locexpr_baton_eval): Change to call evaluate method. |
||
---|---|---|
bfd | ||
binutils | ||
config | ||
contrib | ||
cpu | ||
elfcpp | ||
etc | ||
gas | ||
gdb | ||
gdbserver | ||
gdbsupport | ||
gnulib | ||
gold | ||
gprof | ||
include | ||
intl | ||
ld | ||
libctf | ||
libdecnumber | ||
libiberty | ||
opcodes | ||
readline | ||
sim | ||
texinfo | ||
zlib | ||
.cvsignore | ||
.gitattributes | ||
.gitignore | ||
ar-lib | ||
ChangeLog | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.LIBGLOSS | ||
COPYING.NEWLIB | ||
depcomp | ||
djunpack.bat | ||
install-sh | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
makefile.vms | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
README-maintainer-mode | ||
setup.com | ||
src-release.sh | ||
symlink-tree | ||
test-driver | ||
ylwrap |
README for GNU development tools This directory contains various GNU compilers, assemblers, linkers, debuggers, etc., plus their support routines, definitions, and documentation. If you are receiving this as part of a GDB release, see the file gdb/README. If with a binutils release, see binutils/README; if with a libg++ release, see libg++/README, etc. That'll give you info about this package -- supported targets, how to use it, how to report bugs, etc. It is now possible to automatically configure and build a variety of tools with one command. To build all of the tools contained herein, run the ``configure'' script here, e.g.: ./configure make To install them (by default in /usr/local/bin, /usr/local/lib, etc), then do: make install (If the configure script can't determine your type of computer, give it the name as an argument, for instance ``./configure sun4''. You can use the script ``config.sub'' to test whether a name is recognized; if it is, config.sub translates it to a triplet specifying CPU, vendor, and OS.) If you have more than one compiler on your system, it is often best to explicitly set CC in the environment before running configure, and to also set CC when running make. For example (assuming sh/bash/ksh): CC=gcc ./configure make A similar example using csh: setenv CC gcc ./configure make Much of the code and documentation enclosed is copyright by the Free Software Foundation, Inc. See the file COPYING or COPYING.LIB in the various directories, for a description of the GNU General Public License terms under which you can copy the files. REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info on where and how to report problems.