I want to better understand sigaction and I have reached this instruction using gdb.
0x73xxxxxxxx: bl 0x73xxxxxxxx <sigaction@plt>
If I were to explore its parameters,
<code>x0 0x0e 14
x1 0x7fxxxxxxxx xxxxxxxxxxxx
x2 0x0
</code>
<code>x0 0x0e 14
x1 0x7fxxxxxxxx xxxxxxxxxxxx
x2 0x0
</code>
x0 0x0e 14
x1 0x7fxxxxxxxx xxxxxxxxxxxx
x2 0x0
- x0 should be referring to the signal to handle?
- x1 should be the new sigaction structure?
- x2 should be the old sigaction structure (so this means there is
no old sigaction structure defined?)
If I explore x1 further,
<code>(gdb) x/16gx 0x7fxxxxxxxx
0x7fe5xxxxc0: 0x0000000000000004 0x0000007365xxxxxx
0x7fe5xxxxd0: 0xffffffffffffffff 0x0000000000000000
0x7fe5xxxxe0: 0x0000000000000020 0x0000003800030015
0x7fe5xxxxf0: 0x0000003800020015 0x0000003800010015
0x7fe5xxxx00: 0x000000380f000015 0x0000000c00000020
0x7fe5xxxx10: 0x0000007300020015 0x0000007304000025
0x7fe5xxxx20: 0x000000730b030025 0x0000000800000020
</code>
<code>(gdb) x/16gx 0x7fxxxxxxxx
0x7fe5xxxxc0: 0x0000000000000004 0x0000007365xxxxxx
0x7fe5xxxxd0: 0xffffffffffffffff 0x0000000000000000
0x7fe5xxxxe0: 0x0000000000000020 0x0000003800030015
0x7fe5xxxxf0: 0x0000003800020015 0x0000003800010015
0x7fe5xxxx00: 0x000000380f000015 0x0000000c00000020
0x7fe5xxxx10: 0x0000007300020015 0x0000007304000025
0x7fe5xxxx20: 0x000000730b030025 0x0000000800000020
</code>
(gdb) x/16gx 0x7fxxxxxxxx
0x7fe5xxxxc0: 0x0000000000000004 0x0000007365xxxxxx
0x7fe5xxxxd0: 0xffffffffffffffff 0x0000000000000000
0x7fe5xxxxe0: 0x0000000000000020 0x0000003800030015
0x7fe5xxxxf0: 0x0000003800020015 0x0000003800010015
0x7fe5xxxx00: 0x000000380f000015 0x0000000c00000020
0x7fe5xxxx10: 0x0000007300020015 0x0000007304000025
0x7fe5xxxx20: 0x000000730b030025 0x0000000800000020
What do each of the qword mean? I know the second qword (0x7365xxxxxx) should be referring to the handler function for the signal but how do I map the rest of the qwords to the sigaction structure?