diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-03-03 19:01:58 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-03-03 19:01:58 -0500 |
commit | c108ad66d2218a1311b8891f1194d08179ae7c19 (patch) | |
tree | 66b3e148a84447d69f1340447c5edba8bf2055cd /tapsets.cxx | |
parent | 378f9227b04b876ff06af099715e7d60cdc49903 (diff) | |
parent | b0be9bdb8c6972d847cad50a1e699f1fa806ad99 (diff) | |
download | systemtap-steved-c108ad66d2218a1311b8891f1194d08179ae7c19.tar.gz systemtap-steved-c108ad66d2218a1311b8891f1194d08179ae7c19.tar.xz systemtap-steved-c108ad66d2218a1311b8891f1194d08179ae7c19.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 52c14024..147ea3f0 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1601,7 +1601,7 @@ struct dwflpp if (components[i].first == target_symbol::comp_literal_array_index) throw semantic_error ("cannot index pointer"); // XXX: of course, we should support this the same way C does, - // by explicit pointer arithmetic etc. + // by explicit pointer arithmetic etc. PR4166. c_translate_pointer (pool, 1, module_bias, die, tail); break; @@ -1773,10 +1773,7 @@ struct dwflpp case DW_TAG_array_type: case DW_TAG_pointer_type: - if (lvalue) - throw semantic_error ("cannot store into target pointer value"); - - { + { Dwarf_Die pointee_typedie_mem; Dwarf_Die *pointee_typedie; Dwarf_Word pointee_encoding; @@ -1790,21 +1787,33 @@ struct dwflpp dwarf_formudata (dwarf_attr_integrate (pointee_typedie, DW_AT_encoding, attr_mem), &pointee_encoding); - // We have the pointer: cast it to an integral type via &(*(...)) - - // NB: per bug #1187, at one point char*-like types were - // automagically converted here to systemtap string values. - // For several reasons, this was taken back out, leaving - // pointer-to-string "conversion" (copying) to tapset functions. - - ty = pe_long; - if (typetag == DW_TAG_array_type) - c_translate_array (pool, 1, module_bias, typedie, tail, NULL, 0); - else - c_translate_pointer (pool, 1, module_bias, typedie, tail); - c_translate_addressof (pool, 1, module_bias, NULL, pointee_typedie, tail, - "THIS->__retvalue"); - } + if (lvalue) + { + ty = pe_long; + if (typetag == DW_TAG_array_type) + throw semantic_error ("cannot write to array address"); + assert (typetag == DW_TAG_pointer_type); + c_translate_pointer_store (pool, 1, module_bias, typedie, tail, + "THIS->value"); + } + else + { + // We have the pointer: cast it to an integral type via &(*(...)) + + // NB: per bug #1187, at one point char*-like types were + // automagically converted here to systemtap string values. + // For several reasons, this was taken back out, leaving + // pointer-to-string "conversion" (copying) to tapset functions. + + ty = pe_long; + if (typetag == DW_TAG_array_type) + c_translate_array (pool, 1, module_bias, typedie, tail, NULL, 0); + else + c_translate_pointer (pool, 1, module_bias, typedie, tail); + c_translate_addressof (pool, 1, module_bias, NULL, pointee_typedie, tail, + "THIS->__retvalue"); + } + } break; } } |