xcode - 如何在xcode中设置lldb的发现路径

标签 xcode symbols lldb

我有一个在一个环境中构建的程序,我想在我自己的环境中调试它。我已经复制了可执行文件、.dSYM 和源代码,但我找不到让 lldb 知道在哪里可以找到源代码的方法。

例如构建环境中有源文件:

/build_src/rel_path/source1.c
/build_src/rel_path/source1.dSYM
/build_src/rel_path/app1

在我的环境中,文件和 .dSYM 被复制到:

/source/rel_path/source1.c
/source/rel_path/source1.dSYM
/source/rel_path/app1

是否有任何方法可以设置发现路径或任何其他方法来重新映射源代码路径?

最佳答案

这就是“target.source-map”设置的用途:

(lldb) settings list target.source-map
  source-map -- Source path remappings used to track the change of location between a source file when built, and where it exists on the current system. 
                It consists of an array of duples, the first element of each duple is some part (starting at the root) of the path to the file when it
                was built, and the second is where the remainder of the original build hierarchy is rooted on the local system.  Each element of the
                array is checked in order and the first one that results in a match wins.

例如,在您的情况下,您会这样做:

settings set target.source-map /build_src /source

lldb 有一个 apropos 命令,您可以使用它来查找这些隐藏的好东西,因此例如 apropos source 会向您显示上面的帮助,以及其他事情的简短 list 。

关于xcode - 如何在xcode中设置lldb的发现路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26705506/

相关文章:

objective-c - UITableViewCellAccessoryDe​​tailDisclosureButton 和 UITableViewCellAccessoryDisclosureIndicator 之间有什么区别吗

ios - 在静态库中链接 Objective-C 类别

c++ - 如何在 Mac 上安装 VTK?

lisp - 符号和名称不同吗?

c++ - 使用LLVM的libc++时__1符号从何而来?

c++ - 体系结构 x86_64 Xcode Mac 的 undefined symbol

swift - 不断收到 "(lldb)"以及为什么在使用 .indexOf() 后解开元素

ios - 无法连接 IBAction 以查看

python - 我怎样才能自动执行这一系列 lldb 命令?

linux - 如何使用 LLDB 调试服务器本身进行调试