Skip to content

GDB Docs #510

@kotval

Description

@kotval

When attempting to use gdb to debug why a process crashed with renode, I attempted to follow the docs: https://betrusted.io/xous-book/ch03-04-debugging-programs.html, but ran into some issues.

  1. The docs reference port :3456, but doesn't seem to exist. GDB seems to be started in renode on :3333 on the SoC here.

  2. The book recommends to use riscv-none-elf-gdb. It is unclear which binary that is. Is it from here? I tried just using riscv64-unknown-elf-gdb from here and using set architecture riscv:rv32. It seems to work, but could be causing the issues I see below?

  3. I changed opt-level to 1 and debug to true in the profile in the main Cargo.toml, ran cargo xtask renode-image --gdb-stub, ran renode emulation/xous-release.resc, and connected using riscv64-unknown-elf-gdb -ex 'tar ext :3333'. Loading symbols for the kernel with file target/riscv32imac-unknown-none-elf/release/xous-kernel seems to work, but loading symbols for any process, e.g. file target/riscv32imac-unknown-xous-elf/release/shellchat, does not. I can enable breakpoints in the kernel, but breakpoints seem to be ignored in processes. Furthermore, mon pr does not work saying No such command or device: pr.

I did all of this on main without my changes to any process to see if I had messed something up. When running on my branch, root-keys crashes, and I would like to connect over gdb to see why, but could not. Does it appear that I am doing anything incorrect?

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