Well the problem here is that the used toolchain-risv toolchain is
meaning gcc 8.3.0. According to the bintray, the latest package there has a datecode of 2019, 27th of September. So it seems that that patch didn’t make it in there at time it was built…
Although it’s still seemingly 8.3.0, maybe it does include the patch. I’ve downloaded and repacked SiFive’s latest version for Mac with an updated package.json file and uploaded it on my Github.
Please try adding these lines to your platformio.ini:
This should attempt to install the updated toolchain and use it upon next compilation (docs).
Though it also seems very odd to me that simply starting a debugging session (I assume) with the simplest code leads to GDB crashing and that that wasn’t noticed by the people releasing and maintaining the SiFive support for PlatformIO. If it still doesn’t work with the latest toolchain, please contact Issues · platformio/platform-sifive · GitHub. Maybe the issue lies in something else completely.
/scratch/jenkins/workspace/tpp-freedom-tools/tpp01--toolchain-only-package--scratch-carsteng/obj/x86_64-apple-darwin/build/riscv-gnu-toolchain/riscv-gdb/gdb/riscv-tdep.c:1381: internal-error: unable to decode 6 byte instructions in prologue at 0x0000000020010608
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB?
**Terminal logs below for your aid.**
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/sifive/hifive1-revb.html
PLATFORM: SiFive (2.4.0) > HiFive1 Rev B
HARDWARE: FE310 320MHz, 16KB RAM, 16MB Flash
DEBUG: Current (jlink) On-board (jlink, renode)
PACKAGES:
- framework-freedom-e-sdk 2.20050003.200818 (2005.0.3)
**- toolchain-riscv 1.80300.200401+sha.128e838**
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
There may be the possibility to use JlinkGDBserver or openocd as the GDB server (the thing that connects to the board and accepts connections from GDB client), but your GDB client will always be riscv64-unknown-elf-gdb. So that shouldn’t make a difference.
If you know the commandline to start the JlinkGDBserver so that it connects and opens a gdbserver on a certain port, you can use the debug_server directives (and debug_tool = custom, debug_port = localhost:<port of opened gdbserver>).