bieganski / mtkcpu

RISC-V CPU implementation in Amaranth HDL (aka nMigen)
GNU General Public License v2.0
25 stars 5 forks source link

GDB version that we ship segfaults. #69

Open bieganski opened 1 month ago

bieganski commented 1 month ago

Description

mateusz@test:~/tb/github/mtkcpu$ riscv-none-elf-gdb  -x board/breakpoint_example.gdb  sw/uart_tx/build/uart_tx.elf 
GNU gdb (xPack GNU RISC-V Embedded GCC x86_64) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=riscv-none-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from sw/uart_tx/build/uart_tx.elf...
I'm sorry, Dave, I can't do that.  Symbol format `elf32-littleriscv' unknown.
The target architecture is set to "riscv:rv32".
warning: platform-specific solib_create_inferior_hook did not load initial shared libraries.

Fatal signal: Segmentation fault
----- Backtrace -----
Segmentation fault (core dumped)
mateusz@test:~/tb/github/mtkcpu$ riscv-none-elf-gdb  --version
GNU gdb (xPack GNU RISC-V Embedded GCC x86_64) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Workaround

The workaround is to use gdb-multiarch (apt-get install gdb-multiarch).

mateusz@test:~$ gdb-multiarch --version
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bieganski commented 1 month ago

cc @baiobelfer