I debug a remote Linux process with GdbServer. And I want to put a breakpoint in some function.
The problem is that this process use ASLR so each time that process load in another address. I can watch in /proc/PID/maps the base address of the process and calculate where the function is located but this is tedious.
Is there a way to put break point with GDB in address the rebase? So the GDB will automatically calculate the rebase of the process?
All the ways you can put a breakpoint in GDB are documented here.
You want something like
$image_base(myprogram) + image_offset, which is not a supported address location.What you could do is write a shell wrapper which computes the desired address and invokes GDB. Something along the lines of: