lldb target.source-map
settings set -- target.source-map <old-path> <new-path>
settings append -- target.source-map <old-path> <new-path>
Lookup a mono symbol to find out where the source code was when Jenkins built the package
(lldb) image lookup -vn mini_init
1 match found in /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono:
...
CompileUnit: id = {0xffffffff00084fd3}, file = "/Users/builder/jenkins/workspace/build-package-osx-mono/2019-02/external/bockbuild/builds/mono-x64/mono/mini/mini-runtime.c", language = "c99"
...
Set up a “source map” telling LLDB where the code really is
(lldb) settings set -- target.source-map "/Users/builder/jenkins/workspace/build-package-osx-mono/2019-02/external/bockbuild/builds/mono-x64" "/Users/work/2019-02/mono"
https://www.mono-project.com/docs/debug+profile/debug/lldb-source-map/
Easiest way:
use image lookup --verbose --address $pc
(or im loo -va $pc
to get all the information about the place where you're currently
executing.
You can give image lookup a function name or whatever, too.
You can use the python scripting interface to
get the current stack frame's filename too with a line like
script print lldb.frame.GetCompileUnit().GetFileSpec()
(lldb) image lookup -vn <FunctionName> <BinaryImageNameContainingFunction>
https://blog.csdn.net/AlibabaTech1024/article/details/126017329
https://heyonly.github.io/2020/05/25/lldb源码映射的技术实现/
https://anyhong.com/archives/debug-with-sourcecode
https://maskray.me/blog/2022-10-30-distribution-of-debug-information
https://maskray.me/blog/2022-04-10-unwinding-through-signal-handler
https://maskray.me/blog/2021-11-07-init-ctors-init-array
https://maskray.me/blog/2021-08-29-all-about-global-offset-table
https://maskray.me/blog/2021-09-19-all-about-procedure-linkage-table
https://maskray.me/blog/2021-02-14-all-about-thread-local-storage