every time i run [b77d0424] changed to another address
This is happening because of address space layout randomization, which you can disable with setarch -R
command.
GDB also disables address randomization by default, but the chance that the same address you'll get in GDB and under strace
is quite small, as the execution environment under the two tools is quite different. You don't actually need to find the address under strace
, you can find it in GDB:
You are now looking at one of the open
system calls your program does. Use continue
until you stop at the one you are interested in. Now use info registers
to find the address of the first parameter, and set a watchpoint on that address.