Skip to content

Cannot debug with GDB; DWARF data seems corruptedΒ #1

@sgray004

Description

@sgray004

With a fresh build of github.com/riscv-rust/rust, I can successfully compile, deploy, and run each riscv-crates/example to a HiFive1 board. However, I cannot debug using GDB. For example, building hello_world, uploading, running openocd, and then running:

make gdb

Connects to openocd correctly, loads the Rust pretty printers successfully, but GDB emits:

Dwarf Error: Cannot find DIE at 0x48d referenced from DIE at 0x693 [in module /home/foo/riscv-crates/target/riscv32imac-unknown-none/debug/examples/hello_world]

Because of this, symbols don't appear to be loaded, breakpoints cannot be set, etc.

Running llvm-dwarfdump -verify against riscv-crates/target/riscv32imac-unknown-none/debug/examples/hello_world seems to show several DIE errors, including an ...invalid DIE reference 0x0000048d... error similar to the one emitted by GDB above.

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions