Summary: | inaccessible sdt.h operands of the form symbol(%reg) | ||
---|---|---|---|
Product: | systemtap | Reporter: | Frank Ch. Eigler <fche> |
Component: | translator | Assignee: | Unassigned <systemtap> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jlebon, kalvdans, mark, rrakus, scox, sergiodj |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Frank Ch. Eigler
2011-10-14 12:14:52 UTC
readelf -x .note.stapsdt bash-prev Hex dump of section '.note.stapsdt': 0x00000000 08000000 53000000 03000000 73746170 ....S.......stap 0x00000010 73647400 791e4300 00000000 6af74b00 sdt.y.C.....j.K. 0x00000020 00000000 70fc6d00 00000000 62617368 ....p.m.....bash 0x00000030 00626173 685f6675 6e637469 6f6e5f63 .bash_function_c 0x00000040 616c6c00 2d34406c 696e655f 6e756d62 all.-4@line_numb 0x00000050 65722825 72697029 20384025 72736920 er(%rip) 8@%rsi 0x00000060 38402572 62700000 8@%rbp.. nm bash-prev| grep line_number 000000000042df70 T executing_line_number 00000000006e12e0 b function_line_number 00000000006dfdb4 B line_number 00000000006dfdb0 B line_number_base 00000000006e12d8 b line_number_for_err_trap (In reply to comment #0) > However, we should at least attempt to resolve globals in the symbol > table, within sdt_uprobe_var_expanding_visitor::visit_target_symbol_arg. Note we already have dwflpp::vardie_from_symtable() to do that. *** Bug 12690 has been marked as a duplicate of this bug. *** The branch jlebon/pr13296 contains patches to support this now. More precisely, we also pick up STT_OBJECT symbols from the symbol table, which we then try to use if we meet such an operand. Example: $ cat prog.c #include "sys/sdt.h" int globalvar = 3; int main(int argc, char **argv) { globalvar += argc; STAP_PROBE1(test, mymark, globalvar); return 0; } $ gcc prog.c -o prog -I../install/include -DSTAP_SDT_ARG_CONSTRAINT=m $ readelf --notes prog | tail -n 7 Notes at offset 0x00001088 with length 0x0000004c: Owner Data size Description stapsdt 0x00000037 NT_STAPSDT (SystemTap probe descriptors) Provider: test Name: mymark Location: 0x000000000040050c, Base: 0x00000000004005b0, Semaphore: 0x0000000000000000 Arguments: -4@globalvar(%rip) $ stap -e 'probe process.mark("mymark") { printf("globalvar is %d\n", $arg1) }' -c ./prog globalvar is 4 $ Merged into master under commit b8688ee. |