Eclipse qemu debug

Installed Eclipse from Third Party RISC‑V Tools (Software - SiFive).

Compile build in “Hello RISC-V World in C” example without error (see ‘compile output’ below).

Run as > 2 Local C/C++ application with error message but there is no output to Console

Debug as > 2 Local C/C++ application report error:
Error with command: gdb --version
Cannot run program “gdb”: Unknown reason

xPack GNU RISC-V Embedded GCC (riscv-none-embed-gcc) installed in
/Users/alain/Library/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/10.1.0-1.1.1/.content/bin
and both riscv-none-embed-gcc and riscv-none-embed-gdb present in this folder

Is qemu installed by default in Eclipse from Third Party RISC‑V Tools ?
What is missing ?

/* compile output */

6:00:51 **** Build of configuration Debug for project me ****
make all
Building file: …/src/main.c
Invoking: GNU RISC-V Cross C Compiler
riscv-none-embed-gcc -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -std=gnu11 -MMD -MP -MF"src/main.d" -MT"src/main.o" -c -o “src/main.o” “…/src/main.c”
Finished building: …/src/main.c

Building target: me.elf
Invoking: GNU RISC-V Cross C Linker
riscv-none-embed-gcc -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -Xlinker --gc-sections -Wl,-Map,“me.map” --specs=nosys.specs -o “me.elf” ./src/main.o
Finished building target: me.elf

Invoking: GNU RISC-V Cross Create Flash Image
riscv-none-embed-objcopy -O ihex “me.elf” “me.hex”
Finished building: me.hex

Invoking: GNU RISC-V Cross Print Size
riscv-none-embed-size --format=berkeley “me.elf”
text data bss dec hex filename
10072 2124 88 12284 2ffc me.elf
Finished building: me.siz

16:00:51 Build Finished. 0 errors, 0 warnings. (took 234ms)

Looks like you are using GNU MCU Eclipse, which I see has been renamed to Eclipse Embedded CDT.
https://eclipse-embed-cdt.github.io/
You might want to try asking there. They have their own forums. There is a link to the forums under Support which points here.
https://www.tapatalk.com/groups/xpack/

I want to run/debug without board, using risc-v emulation.
there is 3 Eclipse at www.sifive.com/software:
GNU MCU Eclipse IDE for C/C++ Developers
GNU MCU Eclipse RISC-V Embedded GCC
GNU MCU Eclipse OpenOCD
Which one achive my goal ?

Freedom Studio is the SiFive Eclipse release. I believe it contains qemu. But I don’t use Eclipse myself.

GNU MCU Eclipse is third party software. If you want support for that, you should probably talk to them.

Hi Alain,

To follow-up on Jim’s response Freedom Studio has 4 available SiFive qemu targets
as shown here:

To create your project, you’ll want to use the SiFiveTools - Create a new Freedom E SDK Software project menu.

As for the 3rd party links you referenced, it doesn’t appear to support a RISC-V soft target.

Regards,
Ralph

I am sorry to be unclear about qemu.
I want to compile, run and debug without the board.

The board will be used only from time to time to check the code written with Eclipse, board not connected.
The highlighted example state “… and uses board LEDs”

Is it possible to use Eclipse without board ? How ?

Than you.

If you choose qemu target then you don’t need a board. Please try it.

The version Freedom I have used is do not hold “qemu-sifive-s51”
I have try FreedomStudio but SiFive Mac FreedomStudio application is corrupted.
But I can see that application hold “qemu-sifive-s51”.
Do you know an other source where I can download SiFive Mac FreedomStudio ?

I don’t have a Mac so I can’t help with Mac specific issues.

Got the example from Freedom Studio:

There are 3 checkbox in “Select Target”. I use default setting, is it OK ?

There is no build error. The “Finnish” show a dialog with “Debug” button.
There is an error there:

debug_error
[see Apple console log below]

Can you help me…

****************** Apple console log
Process: qemu-system-riscv64 [2326]
Path: /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
Identifier: qemu-system-riscv64
Version: 0
Code Type: X86-64 (Native)
Parent Process: FreedomStudio [463]
Responsible: qemu-system-riscv64 [2326]
User ID: 501

Date/Time: 2021-10-31 07:56:02.243 -0400
OS Version: Mac OS X 10.12.5 (16F73)
Report Version: 12
Anonymous UUID: 65DD5E81-55CD-06F5-F9DB-0A480322B418

Time Awake Since Boot: 510 seconds

System Integrity Protection: disabled

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: /usr/local/opt/vde/lib/libvdeplug.3.dylib
Referenced from: /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
Reason: image not found

Binary Images:
0x1040af000 - 0x104cc3fff +qemu-system-riscv64 (0) <0CE1C267-79AA-3CF0-9737-7E23564BCF82> /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
0x104fe0000 - 0x104fe4ff3 com.apple.Hypervisor (1.0 - 1) /System/Library/Frameworks/Hypervisor.framework/Versions/A/Hypervisor
0x10726b000 - 0x1072a8dc7 dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
0x7fffd268e000 - 0x7fffd271bfff com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <78767F88-91D4-31CE-AAC6-1F9407F479BB> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x7fffd2add000 - 0x7fffd2f70fff com.apple.CoreFoundation (6.9 - 1349.8) <36385A3A-60D3-32DB-BF55-C6D8931A7AA6> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fffd4ad7000 - 0x7fffd4b6dff7 com.apple.framework.IOKit (2.0.2 - 1324.60.3) <7CE4C98B-107C-3AAA-B49A-F2ACFCBBF526> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit

Hi Alain,

We’re sorry you hit that issue. Could you please email your Eclipse log file to support@sifive.com?
The log file is located at <workspace_location>/.metadata/.log.

Thank You,
Ralph

Hi Alain,

It looks like there is a missing dependency (libvdeplug.3.dylib) that qemu is trying to load. Can you run this command in a terminal windows and paste the output here?

>ldd /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64

Thanks,
Kevin

On Mac OS there is no ldd but there is an equivalent:

otool -L

/Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64:
/System/Library/Frameworks/Hypervisor.framework/Versions/A/Hypervisor (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1570.15.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/vde/lib/libvdeplug.3.dylib (compatibility version 4.0.0, current version 4.1.0)
/usr/lib/libpam.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
/usr/local/opt/libssh/lib/libssh.4.dylib (compatibility version 4.0.0, current version 4.8.5)
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/usr/lib/libsasl2.2.dylib (compatibility version 3.0.0, current version 3.15.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
/usr/local/opt/lzo/lib/liblzo2.2.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/local/opt/snappy/lib/libsnappy.1.dylib (compatibility version 1.0.0, current version 1.1.8)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0)
/usr/local/opt/nettle/lib/libnettle.8.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/local/opt/gnutls/lib/libgnutls.30.dylib (compatibility version 59.0.0, current version 59.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1671.40.118)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 50.1.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1251.12.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 944.3.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1570.15.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

Done.

Thank you.

Below a copy of the log file sent:

!SESSION 2021-10-30 15:02:31.177 -----------------------------------------------
eclipse.buildId=unknown
java.version=15.0.1
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Framework arguments: -keyring /Users/alain/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/alain/.eclipse_keyring

!ENTRY org.eclipse.cdt.core 1 0 2021-10-30 15:39:43.176
!MESSAGE Indexed ‘qemu_sifive_s51_sifive_welcome’ (0 sources, 0 headers) in 0.001 sec: 0 declarations; 0 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0%)

!ENTRY org.eclipse.cdt.core 1 0 2021-10-30 15:39:45.105
!MESSAGE Indexed ‘qemu_sifive_s51_sifive_welcome’ (0 sources, 0 headers) in 0.001 sec: 0 declarations; 0 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0%)

!ENTRY org.eclipse.cdt.core 1 0 2021-10-30 15:39:45.155
!MESSAGE Indexed ‘qemu_sifive_s51_sifive_welcome’ (0 sources, 0 headers) in 0.001 sec: 0 declarations; 0 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0%)

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-30 15:40:48.594
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-30 15:41:38.084
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY org.eclipse.cdt.core 1 0 2021-10-30 15:55:27.734
!MESSAGE Indexed ‘qemu_sifive_s51_sifive_welcome’ (58 sources, 126 headers) in 1.24 sec: 5,643 declarations; 10,765 references; 29 unresolved inclusions; 5 syntax errors; 255 unresolved names (1.5%)

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-30 15:55:43.643
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S
!SESSION 2021-10-31 07:48:06.390 -----------------------------------------------
eclipse.buildId=unknown
java.version=15.0.1
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Framework arguments: -keyring /Users/alain/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/alain/.eclipse_keyring

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:49:32.280
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:52:22.183
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:54:22.232
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:55:09.670
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:55:42.109
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 07:56:02.228
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S
!SESSION 2021-10-31 08:03:23.709 -----------------------------------------------
eclipse.buildId=unknown
java.version=15.0.1
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Framework arguments: -keyring /Users/alain/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/alain/.eclipse_keyring

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 08:04:03.161
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S
!SESSION 2021-10-31 13:56:26.378 -----------------------------------------------
eclipse.buildId=unknown
java.version=15.0.1
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CA
Framework arguments: -keyring /Users/alain/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/alain/.eclipse_keyring

!ENTRY com.sifive.gnumcueclipse.debug.gdbjtag.qemu 4 1 2021-10-31 14:02:57.485
!MESSAGE /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64 -gdb tcp::1234 -monitor tcp::5432,server,nowait -d unimp,guest_errors -readconfig bsp/qemu.cfg -nographic -version -S

I got a similar problem with qemu-sifive-s51 on Ubuntu 20.10

The Run > Degug As has 2 sub-menu
1 - SiFive J-Link Launch
2 - SiFive OpenOCD Launch

The first one do nothing, the second open the “Edit Configuration” window
The “Debug” button give this error:

pen On-Chip Debugger 0.11.0-rc1+dev (SiFive OpenOCD 0.10.0-2020.12.1)
Licensed under GNU GPL v2
For bug reports:
	https://github.com/sifive/freedom-tools/issues
debug_level: 0

jtag
probe
/home/alain/wsFreedomStudio/qemu_sifive_s51_sifive_welcome/bsp/qemu.cfg:3: Error: invalid command name "machine"
in procedure 'script' 
at file "embedded:startup.tcl", line 26
at file "/home/alain/wsFreedomStudio/qemu_sifive_s51_sifive_welcome/bsp/qemu.cfg", line 3

An alert dialog appear:

dialog_error

I cannot find the “openocd console”.

This appears to be an issue with SiFive’s “Freedom Tools” software. If I’m understanding correctly, there is nothing specific to the HiFive Unmatched dev-board (and other dev-boards), so this discussion is off-topic for this channel (and the forums as a whole). In my opinion, the appropriate place for this discussion, as suggested in the error message above, is:

For bug reports:
Issues · sifive/freedom-tools · GitHub

The OS > Console > User Reports > qemu-system-riscv64_2021-11-06-082707_Alains-Mac-Pro.crash:

Process: qemu-system-riscv64 [746]
Path: /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
Identifier: qemu-system-riscv64
Version: 0
Code Type: X86-64 (Native)
Parent Process: FreedomStudio [580]
Responsible: qemu-system-riscv64 [746]
User ID: 501

Date/Time: 2021-11-06 08:27:07.100 -0400
OS Version: Mac OS X 10.12.5 (16F73)
Report Version: 12
Anonymous UUID: 65DD5E81-55CD-06F5-F9DB-0A480322B418

Time Awake Since Boot: 2000 seconds

System Integrity Protection: disabled

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: /usr/local/opt/vde/lib/libvdeplug.3.dylib
Referenced from: /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
Reason: image not found

Binary Images:
0x1085e6000 - 0x1091fafff +qemu-system-riscv64 (0) <0CE1C267-79AA-3CF0-9737-7E23564BCF82> /Applications/FreedomStudio.app/Contents/Eclipse/SiFive/riscv-qemu-5.1.0-2020.08.1/bin/qemu-system-riscv64
0x109519000 - 0x10951dff3 com.apple.Hypervisor (1.0 - 1) /System/Library/Frameworks/Hypervisor.framework/Versions/A/Hypervisor
0x11744f000 - 0x11748cdc7 dyld (433.5) <322C06B7-8878-311D-888C-C8FD2CA96FF3> /usr/lib/dyld
0x7fffb05c6000 - 0x7fffb0653fff com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <78767F88-91D4-31CE-AAC6-1F9407F479BB> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x7fffb0a15000 - 0x7fffb0ea8fff com.apple.CoreFoundation (6.9 - 1349.8) <36385A3A-60D3-32DB-BF55-C6D8931A7AA6> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fffb2a0f000 - 0x7fffb2aa5ff7 com.apple.framework.IOKit (2.0.2 - 1324.60.3) <7CE4C98B-107C-3AAA-B49A-F2ACFCBBF526> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit