6

I'm used to using GDB and there is an equivalent function I am not able to find with LLDB. I would like to be able to place a breakpoint at a certain offset from the base address of a function. With GDB I can do:

b *(&functionX+20)

Is there a way to do that with LLDB?

Dpp
  • 1,926
  • 1
  • 18
  • 26
  • I think you'd find an answer here: http://stackoverflow.com/questions/13506629/lldb-break-at-address – Oak Apr 23 '14 at 04:38
  • 1
    Due to ASLR the address of the function changes at each run so it's not practical for me to break on a specific address (and no I do not want to disable ASLR) – Dpp Apr 23 '14 at 05:02

1 Answers1

7

While its a bit odd in its formatting I method I use is:

b -a `(void())functionX`+20

As a side note when I you want to quickly get the address of a function I just run the same without a command.. it will give an error but it quickly show the address:

`(void())functionX`