【发布时间】:2014-03-25 18:27:29
【问题描述】:
我正在尝试让 nacl-gdb 与 nacl_sdk 提供的示例应用程序之一一起工作。特别是,我试图让它与 getting_started/part1 文件夹中的示例 hello_tutorial 应用程序一起工作(本教程中的存根代码:https://developers.google.com/native-client/dev/devguide/tutorial/tutorial-part1)。
我已尝试按照此处的说明进行操作:https://developers.google.com/native-client/dev/devguide/devcycle/debugging#debugging-with-nacl-gdb
但每当我连接到目标时,gdb 都会打印出以下内容:
(gdb) target remote localhost:4014
Remote debugging using localhost:4014
warning: Can not parse XML target description; XML support was disabled at compile time
0x00000000 in ?? ()
然后我可以继续并运行应用程序,但它在没有调试符号的情况下非常有用。有人知道为什么这可能无法正常工作吗?
我执行了以下步骤:
- 将
Makefile修改为buildhello_tutorial.pexe而不最终确定,并在编译时添加-g标志,并重新运行make。 - 运行
pnacl-translate从未最终确定的 .pexe 创建 .nexe 文件。 ../../toolchain/linux_pnacl/bin/pnacl-translate --allow-llvm-bitcode-input hello_tutorial.pexe -arch x86-64 -o hello_tutorial_x86_64.nexe - 修改了
hello_tutorial.nmf指向nexe 文件而不是pexe 文件。 - 修改了
index.html以指向“application/x-nacl”,而不是“application/x-pnacl” -
使用以下命令启动 Chrome:
/opt/google/chrome/chrome --enable-nacl --enable-nacl-debug --no-sandbox --disable-hang-monitor localhost:5103 -
使用以下命令从 part1 文件夹启动调试器:
../../toolchain/linux_x86_newlib/bin/x86_64-nacl-gdb -
在 gdb 中运行以下命令。 (请注意,从 nacl_irt_x86_64.nexe 读取时显示“未找到调试符号” - 这是一个问题吗?)
(gdb) nacl-irt hello_tutorial_x86_64.nexe Reading symbols from /home/bender/dev/nacl_sdk/pepper_33/getting_started/part1/hello_tutorial_x86_64.nexe...done. (gdb) nacl-irt /opt/google/chrome/nacl_irt_x86_64.nexe Reading symbols from /opt/google/chrome/nacl_irt_x86_64.nexe...(no debugging symbols found)...done. (gdb) target remote localhost:4014 Remote debugging using localhost:4014 warning: Can not parse XML target description; XML support was disabled at compile time 0x00000000 in ?? ()
我在 Linux 上运行:
Linux bender-VirtualBox 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
【问题讨论】: