Debian Codegraph @

testsuite/systemtap.printf/pretty-bits.stp

raw
1 %{
2 /* I'm not sure of a good way to find the path to the testsuite header,
3 * used in the @cast as @1, so it's just duped here. */
4 struct pretty_bits {
5 signed char a:4, b:4;
6 unsigned char c:4, d:4;
7 signed int e:4, f:4;
8 unsigned int g:4, h:4;
9 };
10 %}
11
12 function get_bits_pointer:long() %{
13 static struct pretty_bits bits = { 0, 1, 1, 2, 3, 5, 8, 13, };
14 STAP_RETVALUE = (intptr_t) &bits;
15 %}
16
17 probe begin {
18 bits = get_bits_pointer();
19 println(@cast(bits, "struct pretty_bits", @1)$);
20 exit();
21 }