xcode - How can I find the address of a stack trace in LLDB for iOS -
when crash report, offending part of code this, instead of showing me actual line number, though crash report symbolicated:
-[viewcontroller mymethod:] + 47
in order debug this, need know line of code represents can visually inspect it, set breakpoint, etc.
what way address of method plus offset, shown above, using lldb?
note: question not duplicate of how read crash report. know how read crash report. asking how corresponding line using lldb. nothing in other answers shows how that. quite verbose , go kinds of things dealing crash reports , debugging in general, don't show specific steps on lldb are. please not duplicate bug.
your steps (image lookup
+ p/x addr + offset
) give raw address, found. original crash report included address before method + offset --- easy slide binary correct address using target modules load
. @ end of crash report there should list of binary images present in program, including load address , uuid.
but more importantly, while address nice you're after source location. in case, once you've determined correct address method (or slid matching address via target modules load
), can use source list
(lldb) l -a `addr + offset`
i'm using backtick notation here in-line expression evaluation. there's handy shortcut commands take address: if omit spaces, can write expression without backticks:
(lldb) l -a addr+offset
you can use image lookup
address. if have debug information, tell current location of variables @ point. why useful? because crash reports include register context @ crash , variables in register provided (-v
necessary of register location information).
(lldb) im loo -v -a addr+offset
finally -- isn't going work because you're dealing objective-c method name -- simple c function name can offset arithmetic in-line long cast function name pointer type (it's not legal c add offset function pointer). e.g.
(lldb) l -a (char*)main+10
Comments
Post a Comment