This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: sdt-types tests
On 11/23/2010 12:38 PM, Roland McGrath wrote:
>> That's an improvement - the old sdt.h gave four such errors. ;) But
>> even the baby example given in PR12139 still fails in this way. This is
>> on F14 x86_64, using gcc 4.5.1 20100924 (Red Hat 4.5.1-4).
>
> Damn! I get that too with gcc-4.4.4-10.fc13.x86_64 (less column numbers!).
> It works in C++, though--but two different cases barf now there. Sigh.
> Back to the fiddling.
Here's another issue I narrowed down. It is triggered by sdt_types, but
probably easier to check alone:
$ cat sdt-string.c
#include <sys/sdt.h>
int main() {
const char* ptr = "ptr";
const char array[] = "array";
STAP_PROBE3(foo, bar, ptr, array, "constant");
return 0;
}
$ gcc -S sdt-string.c -o -
[...]
.pushsection .note.stapsdt,"","note"
.balign 4
.4byte 992f-991f,994f-993f,3
991: .asciz "stapsdt"
992: .balign 4
993: .8byte 990b
.8byte _.stapsdt.base
.8byte 0
.asciz "foo"
.asciz "bar"
.asciz "8@-8(%rbp) 6@%rax 9@%rdx"
994: .balign 4
.popsection
[...]
The pointer's 8@ is good, but the array and literal have sizes 6 and 9
(== strlen+1). The given registers look fine with the generated asm
though. The same code with -xc++ gives a good 8@ for all.
Josh