This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/18462] macro deprecation
- From: "mcermak at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Wed, 10 Jun 2015 17:31:39 +0000
- Subject: [Bug translator/18462] macro deprecation
- Auto-submitted: auto-generated
- References: <bug-18462-6586 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18462
--- Comment #4 from Martin Cermak <mcermak at redhat dot com> ---
Created attachment 8356
--> https://sourceware.org/bugzilla/attachment.cgi?id=8356&action=edit
patch that seems to work for me
(In reply to Josh Stone from comment #3)
> Can you just change parse_library_macros to call scan_pp() instead?
This works in a sense, that the macro declaration surrounded by a conditional,
that evaluates to false, gets skipped. Also this doesn't cause any regression
in the (whole) testsuite. So far so good.
But when the unwanted macro is being skipped in skip_pp(), scan_pp1() gets
called, putting the macro into the pp1_namespace --- so later on the macro gets
inadvertently expanded anyway:
=======
7.1 S x86_64 # cat /root/systemtap/blah/share/systemtap/tapset/linux/aaa.stpm
%( 1 == 2 %?
@define __mymacro
%(
"blah"
%)
%)
7.1 S x86_64 # cat xxx.stp
probe oneshot {
println(@__mymacro)
}
7.1 S x86_64 # gdb -q -args stap -p1 -g xxx.stp
Reading symbols from /root/systemtap/stap...done.
(gdb) b parse.cxx:484
Breakpoint 1 at 0x43ad3e: file parse.cxx, line 484.
(gdb) r
Starting program: /root/systemtap/stap -p1 -g xxx.stp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Breakpoint 1, parser::scan_pp1 (this=this@entry=0x7fffffffc490) at
parse.cxx:484
484 macrodecl* decl = (pp1_namespace[name] = new macrodecl);
Missing separate debuginfos, use: ... stuff deleted ...
(gdb) bt
#0 parser::scan_pp1 (this=this@entry=0x7fffffffc490) at parse.cxx:484
#1 0x000000000043e318 in parser::skip_pp (this=this@entry=0x7fffffffc490) at
parse.cxx:1152
#2 0x000000000043e51e in parser::scan_pp (this=this@entry=0x7fffffffc490) at
parse.cxx:1037
#3 0x000000000043f597 in parser::parse_library_macros
(this=this@entry=0x7fffffffc490) at parse.cxx:721
#4 0x00000000004407bd in parse_library_macros (s=...,
name="/root/systemtap/blah/share/systemtap/tapset/linux/aaa.stpm") at
parse.cxx:260
#5 0x0000000000412a47 in passes_0_4 (s=...) at main.cxx:567
#6 0x000000000040f45d in main (argc=<optimized out>, argv=<optimized out>) at
main.cxx:1207
(gdb)
=======
So what seems to fix the issue for me is to modify skip_pp() to call newly
created scan_pp1_temp(), which behaves like scan_pp1() except of putting stuff
into pp1_namespace. Using it, reference to a deprecated macro results in:
=======
7.1 S x86_64 # stap -p1 -g xxx.stp
parse error: unknown operator @__mymacro
saw: operator '@__mymacro' at xxx.stp:2:13
source: println(@__mymacro)
^
1 parse error.
Pass 1: parse failed. [man error::pass1]
7.1 S x86_64 #
=======
Which looks about fine to me.
--
You are receiving this mail because:
You are the assignee for the bug.