| 1 |
#! stap -p2 |
| 2 |
|
| 3 |
probe begin |
| 4 |
{ |
| 5 |
// Test multiple DWARF assignments to a local can propagate types if |
| 6 |
// they're the same underneath. |
| 7 |
if (randint(2)) |
| 8 |
sun = & @cast(0, "sockaddr_un", "<sys/un.h>"); |
| 9 |
else |
| 10 |
sun = & @cast(1, "sockaddr_un", "<sys/un.h>"); |
| 11 |
println(sun->sun_family) |
| 12 |
|
| 13 |
// Different types can also be assigned, but it degrades to plain long |
| 14 |
// (These are actually the same, but coming from different cast modules.) |
| 15 |
if (randint(2)) |
| 16 |
sun2 = & @cast(0, "sockaddr_un", "<sys/un.h>"); |
| 17 |
else |
| 18 |
sun2 = & @cast(0, "sockaddr_un", "<sys/socket.h><sys/un.h>"); |
| 19 |
println(sun2) |
| 20 |
} |