]> sourceware.org Git - systemtap.git/commit - loc2c.h
PR11556: Support array indexing on @cast pointers
authorJosh Stone <jistone@redhat.com>
Wed, 5 May 2010 23:47:19 +0000 (16:47 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 6 May 2010 01:40:05 +0000 (18:40 -0700)
commitf3b5366d0a5d6c746eaf5e7596e3c439c48c2f51
tree4d7cba593b035c79015ced2b364e6e91f13e84ee
parent6ce303b8edeb90514f7423bebc95fcee21414ce0
PR11556: Support array indexing on @cast pointers

It's a bit of a special case, because we don't have a pointer DIE for
the named type in @cast expressions.  However, we can read the element
size manually and still simulate an array access.

* loc2c.c (pointer_stride): New, factored out of array_stride.
  (c_translate_array_pointer): New, performs the pointer math based on
  the element size of the pointee type.
* dwflpp.cxx (dwflpp::translate_components): Take a starting component.
  (dwflpp::literal_stmt_for_pointer): If the initial type is not already
  a pointer or array, we can fake an array access on the input pointer.
* testsuite/semok/cast.stp: Add an array access test on a @cast.
* testsuite/systemtap.base/cast.stp: Ditto.
* testsuite/systemtap.base/cast.exp: Ditto.
dwflpp.cxx
dwflpp.h
loc2c.c
loc2c.h
testsuite/semok/cast.stp
testsuite/systemtap.base/cast.exp
testsuite/systemtap.base/cast.stp
This page took 0.030125 seconds and 5 git commands to generate.