mit-pdos/xv6-riscv

Additional steps required for using tui with gdb in Ubuntu 20.04 LTS for xv6-2021-labs

sudk1896 opened this issue · 1 comments

The instructions mentioned here are not enough to enable gdb with tui on Ubuntu 20.04 LTS.
The steps need to be updated. Here is what I had to do,

  • I had to install libncurses5-dev first. This isn't pre-installed on Ubuntu 20.04 LTS.
  • Then build riscv-gnu-toolchain from source -> here
  • After that I had to use riscv64-unknown-linux-gnu-gdb -tui, then I could debug with TUI option.

I also had to make changes to the CFLAGS option and had to add -gdwarf-2 option because on inspecting the local variables in gdb with info locals command, it was giving CORRUPTED DWARF EXPRESSION error.

IMO, the instructions in the tools page need to be updated with the above instructions.
Thanks.

Interesting. I am missing riscv64-unknown-linux-gnu-gdb on my system so I run gdb-multiarch. I followed the first two bullet-points.