LLDB - am I able to set breakpoint at a function if I did not set -g when compiling?

LLDB - am I able to set breakpoint at a function in a process, if the executable was not compiled with -g (ie no debugging info)?

@lolgrep Can you please help with this when you get a chance? Thank you - much appreciated! :]

Yes, you can set a breakpoint on a address if no symbol information is available to you.

Yea, but I meant was, can I do something like

breakpoint set -n main

on an executable that was not compiled with -g flag?

No right? There’s no way at all to do that right?

(2)
And a separated but related question - if the -g flag was not used, I won’t be able to inspect and see source code lines as well right? I can only see assembly right?

There’s no way LLDB can do that. Once it starts up, it’ll look for dSYM for a module. If it can find one (or if symbol table info is available for that address) then it will associate a function name to an address. If no, you’ll see the usual lldb_unammedFooBar123 naming for a function.

However even though there’s no naming, lldb can figure a function is there via the Mach-O LC_FUNCTION_STARTS load command, which contains a compact format for all functions compiled into the binary

This topic was automatically closed after 166 days. New replies are no longer allowed.