https://github.com/season727/gdb_12.1_risc-v
Compilation Toolchain:
Xuantie-900-gcc-linux-6.6.0-musl64-x86_64-V2.10.2-20240904
Due to GitHub’s file size limitations, this repository only releases the binaries of gdb/gdbserver and the dependency library libgmp.
a. Push the binaries of gdb/gdbserver from the out directory and libgmp to the /usr/lib directory of the RISC-V terminal device, set the PATH search path, and use the ln -s command to create symbolic links.
# Usage, taking the gdb binary as an example
#1 adb push gdb-12.1\out\bin\gdb /tmp/
#2 chmod +x /tmp/gdb
#3 export PATH=/tmp/:$PATH
#4 root@Linux:/usr/lib# ln -s libgmp.so.10.4.1 libgmp.so
#5 root@Linux:/usr/lib# ln -s libgmp.so.10.4.1 libgmp.so.10
#6 gdb path_to_exe
#7 (gdb) run
#8 bt
b. Developers can also download the GDB source code themselves and modify the build_gdb.sh script in gdb-12.1, referencing their own compilation toolchain and modifying CONFIGURE_ARGS compilation parameters to compile the desired GDB tool.

