summaryrefslogtreecommitdiffstats
path: root/loc2c.h
Commit message (Collapse)AuthorAgeFilesLines
* Report experssion stack slot use back from loc2c.Roland McGrath2009-10-141-1/+2
|
* Support DW_AT_const_value cases in loc2c and loc2c-test.Roland McGrath2009-09-241-0/+14
| | | | | | * loc2c.c (c_translate_constant): New function. * loc2c.h: Declare it. * loc2c-test.c (main): Use it for DW_AT_const_value cases.
* PR10417 Pass around attributes for supporting DW_OP_{implicit,stack}_value.Mark Wielaard2009-09-171-1/+4
| | | | | | | | | | | | | | | | | 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.
* Clean up dwflpp::translate_location workaround for DW_AT_data_member_location.Mark Wielaard2009-09-161-7/+0
| | | | | | | | | | | 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.
* PR10388 Support DW_OP_call_frame_cfa.Mark Wielaard2009-07-151-2/+4
| | | | | | | | | | | | | | | | | | 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.
* Add support for constant struct member field offsets.Mark Wielaard2009-07-081-0/+7
| | | | | | | * 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.
* Enable dwarf expansion of @castsJosh Stone2009-02-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* PR5516: assignment to $pointersfche2008-03-031-0/+9
| | | | | | | | | | | | | | | | | | | | | 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.
* 2005-12-21 Frank Ch. Eigler <fche@elastic.org>fche2005-12-211-0/+4
| | | | * loc2c.h: Add __attribute__ defeating code for g++ 3.3 compatibility.
* 2005-11-21 Roland McGrath <roland@redhat.com>roland2005-11-221-2/+3
| | | | | | | | | | * 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.
* 2005-09-05 Roland McGrath <roland@redhat.com>roland2005-09-061-2/+1
| | | | * loc2c.h: Comment fix.
* 2005-08-18 Roland McGrath <roland@redhat.com>roland2005-08-181-1/+1
| | | | | | | * 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.
* 2005-08-18 Roland McGrath <roland@redhat.com>roland2005-08-181-0/+3
| | | | | | | | | | | | | | | | * 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.
* 2005-08-17 Roland McGrath <roland@redhat.com>roland2005-08-181-6/+14
| | | | | | | | | | | | | | | 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.
* 2005-08-17 Roland McGrath <roland@redhat.com>roland2005-08-181-6/+6
| | | | | | | | | | | | * 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.
* 2005-08-10 Roland McGrath <roland@redhat.com>roland2005-08-111-1/+9
| | | | | | | | | * 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.
* 2005-07-29 Roland McGrath <roland@redhat.com>roland2005-07-291-1/+1
| | | | | * tapsets.cxx: <libdw.h> -> <elfutils/libdw.h> * loc2c.c, loc2c.h: Likewise.
* 2005-07-28 Graydon Hoare <graydon@redhat.com>graydon2005-07-291-0/+63
* 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.