Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to debug with GDB #31

Open
Zhaizhiu opened this issue Nov 5, 2018 · 11 comments
Open

Fail to debug with GDB #31

Zhaizhiu opened this issue Nov 5, 2018 · 11 comments

Comments

@Zhaizhiu
Copy link

Zhaizhiu commented Nov 5, 2018

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
Copy link

JSnobody commented Nov 5, 2018

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

@Zhaizhiu
Copy link
Author

Zhaizhiu commented Nov 5, 2018

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

@JSnobody
Copy link

JSnobody commented Nov 5, 2018

直接gdb aarch64_nvdla_bdma_mmio,然后run呢

@Zhaizhiu
Copy link
Author

Zhaizhiu commented Nov 5, 2018

直接gdb aarch64_nvdla_bdma_mmio,然后run呢

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

@JSnobody
Copy link

JSnobody commented Nov 5, 2018

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

@Zhaizhiu
Copy link
Author

Zhaizhiu commented Nov 5, 2018

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

@JSnobody
Copy link

JSnobody commented Nov 5, 2018

用file看啊

@Zhaizhiu
Copy link
Author

Zhaizhiu commented Nov 5, 2018

用file看啊
不好意思,
image

@Zhaizhiu
Copy link
Author

Zhaizhiu commented Nov 6, 2018

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.

@Zhaizhiu Zhaizhiu closed this as completed Nov 6, 2018
@Zhaizhiu Zhaizhiu reopened this Nov 6, 2018
@Abraham-Xu
Copy link

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
Copy link
Author

Zhaizhiu commented May 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants