]> sourceware.org Git - systemtap.git/commit - dwflpp.cxx
PR10594 cont'd: Use parent die cache for variable lookup
authorJosh Stone <jistone@redhat.com>
Fri, 11 Sep 2009 00:06:11 +0000 (17:06 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 11 Sep 2009 00:06:11 +0000 (17:06 -0700)
commit729455a739d4755269f20b73d2db231db2a1fdd7
tree8b09cc7f762877b2daa4cb2c436a67a283e8e9cd
parentc9efa5c99498ccb3d2f0f87bc373da7dfd1cc067
PR10594 cont'd: Use parent die cache for variable lookup

Variable lookup is usually done through the scopes from dwarf_getscopes
at a particular pc.  This requires an expensive traversal to find the
inner-most die containing the pc.  For cases where that containing die
is known, e.g. at a particular function entry, we can do much better
with our die_parent_cache.

This may also help get more accurate variable scopes in cases where
multiple dies contain a pc and the innermost isn't what we're trying to
probe.  For example, an inlined call chain of foo->bar->baz may all have
the same entry pc, but if the probe was on function("bar"), we would
want the variables in bar's scope, not baz's.

* dwflpp.h (struct dwflpp): Remove pc_cached_scopes, num_cached_scopes,
  and cached_scopes, as they are now remembered by the caller.
* dwflpp.cxx (dwflpp::getscopes): New - the DIE version uses the parent
  cache, and the pc version just defers to dwarf_getscopes.
  (dwflpp::print_locals, literal_stmt_for_local): Take a scopes vector.
  (dwflpp::find_variable_and_frame_base): Take a scopes vector from the
  caller instead of computing it every time.
  (dwflpp::dwarf_getscopes_cached): Removed.
* tapsets.cxx (dwarf_var_expanding_visitor::getscopes): New cached
  lookup function which gets the scopes from the DIE if possible.
  (dwarf_var_expanding_visitor::visit_target_symbol): Call getscopes.
dwflpp.cxx
dwflpp.h
tapsets.cxx
This page took 0.025878 seconds and 5 git commands to generate.