简体   繁体   English

在远程机器上编译的调试过程

[英]debugging process that compiled in remote machine

I compiled Xcode project in debug mode. 我在调试模式下编译了Xcode项目。 however, while running it from VM with lldb (or any other remote machine), I cannot see any debug symbols. 但是,从带有lldb(或任何其他远程计算机)的VM运行它时,我看不到任何调试符号。

to resolve this I've created a soft link to the project source code in local compilation machine, so that each file will have the same path. 为了解决这个问题,我在本地编译器中创建了一个指向项目源代码的软链接,以便每个文件都具有相同的路径。

however, unlike local VM, in remote machine i might not have source code access. 但是,与本地VM不同,在远程计算机中,我可能没有源代码访问权限。

so my question is what files should i copy from project debug outputs in compilation machine, to remote machine so that the lldb debugger will recognize target symbols, and how should i "tell" lldb to look at those new data, rather than the original symbols location (in compilation machine) 所以我的问题是我应该将哪些文件从编译机的项目调试输出复制到远程机器,以便lldb调试器可以识别目标符号,我应该如何“告诉” lldb查看那些新数据,而不是原始符号位置(在编译机中)

In the normal build/debug cycle lldb reads debug information from the .o files made in the course of the build. 在正常的构建/调试周期中,lldb从构建过程中生成的.o文件中读取调试信息。 There's a "debug map" in the binary produce that points to the locations of these .o files. 二进制文件中有一个“调试图”,指向这些.o文件的位置。 Since the debug map records absolute paths, if you want to use the .o files on another machine the .o files must appear in the same place on the file system as they are on the builder. 由于调试映射记录了绝对路径,因此,如果要在另一台计算机上使用.o文件,则.o文件必须在文件系统上的位置与在生成器上的位置相同。

The other way to do this is to use Xcode's "DWARF + dSYM" variant of debug info generation, which builds a ".dSYM" folder that contains fully linked debug information. 执行此操作的另一种方法是使用Xcode的调试信息生成的“ DWARF + dSYM”变体,该变体构建包含完全链接的调试信息的“ .dSYM”文件夹。 Then just move the dSYM & the binary to the same directory and lldb will find it. 然后只需将dSYM和二进制文件移到同一目录,lldb就会找到它。 If for some reason that doesn't work, there is also an lldb command: add-dsym that you can use to manually tell lldb where the dSYM is. 如果由于某种原因不起作用,则还有一个lldb命令: add-dsym ,可用于手动告诉lldb dSYM在哪里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM