This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH v3 1/2] PR13475: Fix ARM SDT_V3 operand parsing
- From: Mark Wielaard <mjw at redhat dot com>
- To: Wade Farnsworth <wade_farnsworth at mentor dot com>
- Cc: systemtap at sourceware dot org, fche at redhat dot com, Josh Stone <jistone at redhat dot com>
- Date: Sun, 1 Apr 2012 20:27:42 +0200
- Subject: Re: [PATCH v3 1/2] PR13475: Fix ARM SDT_V3 operand parsing
- References: <4F58C7E0.70008@mentor.com> <4F6C8FDB.9000401@mentor.com> <4F732414.4020108@mentor.com> <4F732438.8020400@mentor.com>
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