【问题标题】:How do you get nacl-gdb to show debug symbols when debugging?调试时如何让 nacl-gdb 显示调试符号?
【发布时间】: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 ?? ()

然后我可以继续并运行应用程序,但它在没有调试符号的情况下非常有用。有人知道为什么这可能无法正常工作吗?

我执行了以下步骤:

  1. Makefile修改为build hello_tutorial.pexe而不最终确定,并在编译时添加-g标志,并重新运行make。
  2. 运行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
  3. 修改了hello_tutorial.nmf 指向nexe 文件而不是pexe 文件。
  4. 修改了index.html 以指向“application/x-nacl”,而不是“application/x-pnacl”
  5. 使用以下命令启动 Chrome:

    /opt/google/chrome/chrome --enable-nacl --enable-nacl-debug --no-sandbox --disable-hang-monitor localhost:5103
    
  6. 使用以下命令从 part1 文件夹启动调试器:

    ../../toolchain/linux_x86_newlib/bin/x86_64-nacl-gdb
    
  7. 在 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

【问题讨论】:

    标签: gdb google-nativeclient


    【解决方案1】:

    如果我使用pepper_canary 而不是pepper_33,这似乎可以正常工作。在此链接中找到了一些信息:https://code.google.com/p/nativeclient/issues/detail?id=3739

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-14
      • 1970-01-01
      • 1970-01-01
      • 2016-10-18
      • 1970-01-01
      相关资源
      最近更新 更多