| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
* loc2c.c (c_translate_constant): New function.
* loc2c.h: Declare it.
* loc2c-test.c (main): Use it for DW_AT_const_value cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Preparation for retrieving the Dwarf_Block that holds the value of an
DW_OP_implicit_value. We need the Dwarf_Attribute that is associated with
the location expression operants. Depends on new elfutils 0.143
functionality. Recognizes, but does not yet handle the new operants
DW_OP_{implicit,stack}_value.
* loc2c.h (c_translate_location): Take an Dwarf_Attribute.
* loc2c.c (c_translate_location): Likewise and pass it on.
(location_relative): Likewise.
(location_from_address): Likewise.
(translate): Likewise and capture Dwarf_Block.
* loc2c-test.c (handle_variable): Pass in Dwarf_Attribute.
* dwflpp.cxx (translate_location): Likewise.
(literal_stmt_for_return): Pass in NULL to indicate no attribute.
|
|
|
|
|
|
|
|
|
|
|
| |
Do the same workaround as loc2c-test.c does. Just treat a constant member
location offset as a DW_OP_plus_uconst and call c_translate_location for it.
Also Remove c_translate_add_offset.
* dwflpp.cxx (dwflpp::translate_location): Check elfutils version and only
do workaround for elfutils < 0.142.
* loc2c.h (c_translate_add_offset): Removed.
* loc2c.c (c_translate_add_offset): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Depends on elfutils 0.142 cfi support.
* loc2c.h (c_translate_location): Take (optional) Dwarf_Op *cfa_ops.
* loc2c.c (translate): Recognize DW_OP_call_frame_cfa.
(location_from_address): Take cfa_ops, examine fb_ops, if it is
DW_OP_call_frame_cfa, pass cfa_ops to translate instead.
(location_relative): Take cfa_ops, pass to location_from_address.
(c_translate_location): Take cfa_ops, pass to location_from_address.
* loc2c-test.c (handle_variable): Take cfa_ops, pass to c_translate_location
when needed.
(main): Fetch cfa_ops, pass to handle_variable.
* dwflpp.h (struct dwflpp): Add new method get_cfa_ops.
* dwflpp.cxx: Include elfutils/version.h.
(translate_location): Fetch cfa_ops when necessary.
(get_cfa_ops): New method.
|
|
|
|
|
|
|
| |
* loc2c.h (c_translate_add_offset): New function prototype.
* loc2c.c (c_translate_add_offset): New function implementation.
* loc2c-test.c (handle_variable): Use c_translate_add_offset if appropriate.
* dwflpp.cxx (translate_location): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will iterate over the module and its CUs looking for the type
definition, and then work with loc2c to dereference the pointer.
* loc2c.c (c_translate_argument): Create a dummy location to start
the address computation from a function parameter.
* translate.cxx (base_query, dwarf_query): Move some members from
base_query to dwarf_query, so the former can be more generic. Also
add a constructor using a module string instead of probe parameters.
(dwflpp::query_modules, dwflpp::iterate_over_modules): Use a generic
base_query instead of a dwarf_query.
(dwarf_cast_query): New query to scan the modules and CUs for a
matching type definition, and then produce a code fragment to deref
each component.
(dwarf_cast_expanding_visitor): Tries to replace @casts with a function
call to the result of a dwarf_cast_query.
(dwflpp::declaration_resolve): Search by name instead of by die.
(dwflpp::translate_components): Use the incoming vardie as the first
type die, so we don't assume that attr_mem has a DW_AT_type already.
(dwflpp::literal_stmt_for_pointer): Construct a C fragment that starts
with a pointer argument (THIS->pointer) and dereferences each member
component from there.
(*_derived_probe::register_patterns): Take a session parameter instead
of a match_node, so we can manipulate session-wide data.
(dwarf_derived_probe::register_patterns): Add a session code filter to
expand @casts with a dwarf_cast_expanding_visitor.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2008-03-03 Frank Ch. Eigler <fche@elastic.org>
PR5516
* elaborate.cxx (symbol_fetcher, dead_assignment_remover):
Support unresolved $target lvalues. Propagate pretty error
messages.
* staptree.cxx (varuse_collecting_visitor target_symbol): Ditto.
* staptree.h: Corresponding decl.
* loc2c.c: c_translate_pointer_store: New function.
* loc2c.h: Corresponding decl.
* tapsets.cxx (dwflpp::translate_final_fetch_or_store): Call it
for $target pointer assignments.
2008-03-03 Frank Ch. Eigler <fche@elastic.org>
PR5516
* buildok/twentynine.stp: New test.
|
|
|
|
| |
* loc2c.h: Add __attribute__ defeating code for g++ 3.3 compatibility.
|
|
|
|
|
|
|
|
|
|
| |
* loc2c.c (c_translate_location): Take Dwarf_Op vector as argument
directly, not Dwarf_Attribute.p
* loc2c.h: Update decl.
* loc2c-test.c (get_location): New function.
(handle_variable): Use it.
* tapsets.cxx (dwflpp::translate_location): New method.
(dwflpp::translate_components, dwflpp::literal_stmt_for_local): Use it.
|
|
|
|
| |
* loc2c.h: Comment fix.
|
|
|
|
|
|
|
| |
* loc2c.c (c_translate_addressof): Take TYPEDIE instead of TYPEATTR.
* loc2c.h: Update decl.
* loc2c-test.c (handle_variable): Handle DW_TAG_pointer_type target
for fetch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* loc2c.c (struct location): New member `emit_address'.
(alloc_location): Initialize new member from ORIGIN.
(location_from_address): New argument EMIT_ADDRESS.
Initialize new member.
(translate): Use LOC->emit_address hook to format DW_OP_addr constant.
(location_relative): Die if DW_OP_addr is used.
(default_emit_address): New function.
(c_translate_location): New argument EMIT_ADDRESS, pass it down.
Use default_emit_address if argument is null.
* loc2c.h: Update decl.
* loc2c-test.c (handle_variable): Update caller.
* tapsets.cxx (dwflpp::literal_stmt_for_local): Update caller.
(dwflpp::loc2c_emit_address): New static method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR systemtap/1197
* loc2c.c (struct location): New members `fail', `fail_arg'.
(alloc_location): New function. Initialize those members.
(new_synthetic_loc, translate): Use that instead of obstack_alloc.
(location_from_address, location_relative): Likewise.
(FAIL): New macro. Use it everywhere in place of `error'.
(c_translate_location): Take new args FAIL, FAIL_ARG.
* loc2c.h: Update declaration.
* loc2c-test.c (fail): New function.
(handle_variable): Pass it to c_translate_location.
* tapsets.cxx (dwflpp::loc2c_error): New static method.
(dwflpp::literal_stmt_for_local): Pass it to to c_translate_location.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* loc2c.c (c_translate_fetch): Take TYPEDIE instead of TYPEATTR.
(c_translate_store): Likewise.
* loc2c.h: Update decls.
* loc2c-test.c (handle_variable): Update callers.
Look up type, resolve typedefs, and check that it's DW_TAG_base_type.
* tapsets.cxx (dwflpp::literal_stmt_for_local): Likewise.
* loc2c.c (base_byte_size): Add assert on expected DIE tag.
(c_translate_array, c_translate_pointer): Likewise.
* loc2c.h: Amend comments to explicitly state type DIE tags expected.
|
|
|
|
|
|
|
|
|
| |
* loc2c.c (emit_base_store): New function.
(emit_bitfield): Rewritten to handle stores, change parameters.
(c_translate_fetch): Update caller.
(c_translate_store): New function.
* loc2c.h: Declare it.
* loc2c-test.c (handle_variable): Grok "=" last argument to do a store.
|
|
|
|
|
| |
* tapsets.cxx: <libdw.h> -> <elfutils/libdw.h>
* loc2c.c, loc2c.h: Likewise.
|
|
* elaborate.cxx (derived_probe::derived_probe): Accept NULL probe.
* staptree.cxx (provide, require): Move from here...
* staptree.h: to here, and virtualize deep-copy methods.
* translate.cxx
(c_unparser::emit_common_header): Include loc2c-runtime.h
* tapsets.cxx
(dwflpp::iterate_over_modules): Use new, faster getmodules loop.
(dwflpp::literal_stmt_for_local): New method, call loc2c.
(var_expanding_copy_visitor): New struct which expands $-vars.
(dwarf_derived_probe): Rebuild this->body using var expander.
(query_function): Refactor logic a bit for speed.
* loc2c.{c,h}: Copies (with minor changes) of Roland's work
from elfutils CVS.
* Makefile.am (AM_CFLAGS): Set to elfutils-style.
(stap_SOURCES): Add loc2c.c.
* Makefile.in: Regenerate.
2005-07-28 Graydon Hoare <graydon@redhat.com>
* loc2c-runtime.h: New file from elfutils CVS.
|