如何在Xcode中设置lldb的发现路径 [英] How to set the discover path for lldb in xcode

查看:0
本文介绍了如何在Xcode中设置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会向您显示上面的帮助,以及一个非常简短的其他内容列表。

这篇关于如何在Xcode中设置lldb的发现路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆