In GDB, I can use “info line func_name” to get the memory address of func_name, and then use “set $PC=memory_address” to start debugging this function. How do I do the same within lldb? Thanks in advance!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The command in lldb is “image lookup”. I think an example of “info func” <-> “image lookup” was recently added to the lldb/gdb command page – http://lldb.llvm.org/lldb-gdb.html
e.g.
although this is only showing you the offset in libsystem_c.dylib here (0x11d9a) — to see the actual load address you would need to use the “-v” option to image lookup which will show the range of addresses that puts covers. Or you could do this more directly with the back tick notation in lldb,
OK I had to cast puts() because lldb needed a function prototype here – not super convenient, but if it’s one of your own functions that isn’t needed: