[PATCH v3 1/2] PR13475: Fix ARM SDT_V3 operand parsing
Mark Wielaard
mjw@redhat.com
Sun Apr 1 18:28:00 GMT 2012
On Wed, Mar 28, 2012 at 07:46:16AM -0700, Wade Farnsworth wrote:
> * Include regular expressions to parse ARM operands
> * Add ARM register data
> * Allow for whitespace in ARM operands containing []'s
>
> Signed-off-by: Wade Farnsworth <wade_farnsworth@mentor.com>
> ---
> tapsets.cxx | 80 +++++++++++++++++++++++++++++++++++++++++++++++-----------
> 1 files changed, 65 insertions(+), 15 deletions(-)
>
> diff --git a/tapsets.cxx b/tapsets.cxx
> index ccabc67..97cedc0 100644
> --- a/tapsets.cxx
> +++ b/tapsets.cxx
> @@ -6269,10 +6321,8 @@ sdt_query::setup_note_probe_entry (int type, const char *data, size_t len)
>
> arg_count = 0;
> for (unsigned i = 0; i < arg_string.length(); i++)
> - if (arg_string[i] == ' ')
> + if (arg_string[i] == '@')
> arg_count += 1;
> - if (arg_string.length() != 0)
> - arg_count += 1;
>
This part of the patch causes the following regression:
FAIL: sdt_misc asm (0) asm
spawn /usr/local/install/systemtap/bin/stap -c /usr/local/build/systemtap-obj/te
stsuite/sdt_asm.x /home/mark/src/systemtap/testsuite/systemtap.base/sdt_asm.stp
/usr/local/build/systemtap-obj/testsuite/sdt_asm.x
WARNING: cannot find module /usr/local/build/systemtap-obj/testsuite/sdt_asm.x d
ebuginfo: No DWARF information found
semantic error: while resolving probe point: identifier 'process' at /home/mark/
src/systemtap/testsuite/systemtap.base/sdt_asm.stp:1:7
source: probe process(@1).mark("a")
^
semantic error: no match
This is because this is a hand-written assembly probe.
And http://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation says:
"For compiler-generated code, each argument will be of the form N@OP.
For hand-written assembly, or for inline assembly in C or C++, the initial
N@ may be missing. If N is present, it describes the size of the argument.
[...] If N is omitted, the argument size is the natural size of the operand;
usually this is the size of the register or the word size of the machine.
In this case, the signedness is ambiguous."
So it seems we need to properly parse the arguments here and not just
depend on seeing a '@' or ' ' char.
I filed http://sourceware.org/bugzilla/show_bug.cgi?id=13934
Cheers,
Mark
More information about the Systemtap
mailing list