nvdla / vp

Virtual Platform for NVDLA
Other
136 stars 81 forks source link

Fail to debug with GDB #31

Open Zhaizhiu opened 5 years ago

Zhaizhiu commented 5 years ago

hi, I have build the virtual platform according to NVDLA document and run nvdla_bdma_mmio successfully. But when I debugged nvdla_bdma_mmio.c with gdb, there is something wrong.

According to NVDLA document, i build virtual platform again for GDB debug. 

image "-DCMAKE_BUILD_TYPE=Debug" option was added to cmake command.

image

after this, I attached aarch64_toplevel process successfully, but when I run the program in GDB command-line, i got below errors: starting program: .../tests/nvdla_bdma_mmio/aarch64_nvdla_bdma_mmio /bin/bash: .../tests/nvdla_bdma_mmio/aarch64_nvdla_bdma_mmio: cannot execute binary file: Exec format error ...

Thank you very much and i sincerely look forward to you reply.

JSnobody commented 5 years ago

不用GDB的aarch64_toplevel release版本,有试过在VP里面跑起来了吗?

Zhaizhiu commented 5 years ago

GDB 版本和非GDB,VP中tests目录下的demo program均能跑起来。但是却不能用GDB 进行debug。

JSnobody commented 5 years ago

直接gdb aarch64_nvdla_bdma_mmio,然后run呢

Zhaizhiu commented 5 years ago

直接gdb aarch64_nvdla_bdma_mmio,然后run呢

在虚拟平台中直接 gdb aarch64_nvdla_bdma_mmio,会提示gdb command not found

JSnobody commented 5 years ago

看一下aarch64_nvdla_bdma_mmio具体的属性格式是什么

Zhaizhiu commented 5 years ago

看一下aarch64_nvdla_bdma_mmio具体的属性格式是什么 在虚拟平台中,aarch64_nvdla_bdma_mmio具体属性如下: image

JSnobody commented 5 years ago

用file看啊

Zhaizhiu commented 5 years ago

用file看啊 不好意思, image

Zhaizhiu commented 5 years ago

The issue was closed with the following steps:

  1. add "-s" option to extra_arguments in aarch64_nvdla.lua
  2. run virtual simulator in one terminal
  3. run GDB in another terminal with cmmand: "aarch64-linux-gnu-gdb target remote:1234" the following log indicates sucess: Remote debugging using:1234 determining executable automatically, Try using the "file" command 0xffff000008091348 in ?? ()

@JSnobody, thank you for your help.

Abraham-Xu commented 4 years ago

run GDB in another terminal with cmmand: "aarch64-linux-gnu-gdb target remote:1234" Does it mean to use this command to launch gdb or to launch gdb and then execute this command? Neither way works here. Could you please explain it clearly? It would be better if you could explain the function of "-s". Thank you very much!

Zhaizhiu commented 4 years ago

[EXTERNAL EMAIL] Hi,

Follow the bellowing steps and you will run GDB successfully. Step1: aarch64-linux-gnu-gdb ./tests/hello/hello (local terminal) Step2: target remote:1234 (local terminal) Step3: b main (local terminal) Step4: c (local terminal) Step5: ./hello (vp terminal)

BRs

发件人: Abraham-Xu notifications@github.com 发送时间: 2020年5月14日 20:18 收件人: nvdla/vp vp@noreply.github.com 抄送: 朱海周 zhuhaizhou@unisound.com; State change state_change@noreply.github.com 主题: Re: [nvdla/vp] Fail to debug with GDB (#31)

[EXTERNAL EMAIL]

run GDB in another terminal with cmmand: "aarch64-linux-gnu-gdb target remote:1234" Does it mean to use this command to launch gdb or to launch gdb and then execute this command? Neither way works here. Could you please explain it clearly? It would be better if you could explain the function of "-s". Thank you very much!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/nvdla/vp/issues/31#issuecomment-628595792, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKU7YXC7W6YG52VOM7GWZHTRRPORFANCNFSM4GBXLKJQ.