Closed xobs closed 5 years ago
Great, Thanks :)
@xobs I got some issue with a recent eclipse with this pull request code :
eclipse : https://github.com/gnu-mcu-eclipse/org.eclipse.epp.packages/releases
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
bfd requires xlen 8, but target has xlen 4
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
bfd requires xlen 8, but target has xlen 4
bfd requires xlen 8, but target has xlen 4
Does that tell you something ?
Note, if i use raw GDB command lines to run and debug software, that's fine.
That sounds like the host is expecting a 64-bit part, but openocd is feeding it 32-bit values.
Maybe we need to add an address_bits
function to https://github.com/xobs/openocd_riscv/blob/368b9e0dab99b8379d626a922cbf7b23d7424d9c/src/target/vexriscv.c#L1791 similar to https://repo.or.cz/openocd.git/blob/HEAD:/src/target/riscv/riscv.c#l1958 that just returns 32
?
hmm, address_bits do not existe in the openocd version used in the vexriscv branch, that's something quite recent :)
I reverted the feature/group changes (untill the fix is discovered)
Are you accessing ELF files, or something else? How can I replicate this issue? I think the gdb function that's causing issues is at https://github.com/riscv/riscv-binutils-gdb/blob/riscv-binutils-2.32/gdb/riscv-tdep.c#L2876 but I don't yet know how those structures are getting set.
I was using gnu-mcu-eclipse (i just docuemented how to use it there) :
With MuraxSim
And openocd as :
With that demo :
Builded with the SiFive GNU Embedded Toolchain :
Let's me know if one info is missing :)
I should try with a more recent RISC-V toolchain, probably the one i'm using is quite outdated, so maybe the issue is on my side.
address_bits
probably isn't the answer. That seems to be more for deciding the address space size.
I'm trying to get eclipse working, but any time I try to build it just says:
04:10:30 **** Build of configuration Default for project murax ****
all
"all" terminated with exit code 127. Build might be incomplete.
04:10:31 Build Finished. 0 errors, 0 warnings. (took 1s.706ms)
I still don't have Eclipse working, but it does seem to be an issue when you attempt to connect to openocd before you've setup GDB:
xobs@Cuboid:~/Code/Fomu/foboot/sw$ riscv64-unknown-elf-gdb
GNU gdb (GDB) 8.2.90.20190228-git
Copyright (C) 2019 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-linux-gnu --target=riscv64-unknown-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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".
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
bfd requires xlen 8, but target has xlen 4
(gdb) set arch riscv:rv32
The target architecture is assumed to be riscv:rv32
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x00001a94 in ?? ()
(gdb)
That's something to look into, at least. Why is it different with the patch? Hmm...
Curiously, if I remove that patch and try the same thing, it works, but you can tell by the address that it's using the wrong ABI:
xobs@Cuboid:~/Code/Fomu/foboot/sw$ riscv64-unknown-elf-gdb
GNU gdb (GDB) 8.2.90.20190228-git
Copyright (C) 2019 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-linux-gnu --target=riscv64-unknown-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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".
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x00007fff00000000 in ?? ()
(gdb)
@Dolu1990 What happens if you move the set arch riscv:rv32
to GDB Client Setup
instead of Initialization Commands
?
Ahhh nice catch :) I will try :D
That's it, moving
set arch riscv:rv32
From the startup initialisation commands to debugger gdb client setup fixed it :)
Thanks and sorry for the false positive !
I'm trying to get eclipse working, but any time I try to build it just says:
Which folder did you imported as a makefile project ?
I'm trying to get eclipse working, but any time I try to build it just says:
Which folder did you imported as a makefile project ?
I did "New -> Makefile Project with Existing Code", then pointed it to /mnt/d/Code/Fomu/VexRiscvSocSoftware/projects/murax/demo/
on my filesystem.
I can build it in the terminal by running make -f makefile
, so I know my toolchain is set up properly.
Hmm normaly that should be fine, i will try, currently i was importing the repository root folder.
Got it, did you selected RISC-V Cross GCC when importing the project ? (instead of Cross GCC) ?
Because RISC-V Cross GCC give me the same error than you ^^
This patch fixes two separate issues I've experienced:
Add a
targetAddress
configuration option. I'm runninglitex_server
on a Raspberry Pi, where I don't have the ability to compile openocd. Using this patch, I can run openocd on my desktop, while connecting via Ethernet to a VexRiscv<->Wishbone<->UART<->Etherbone<->Ethernet<->OpenOCD bridge.Fix CSR support with modern gdb. GDB now appears to look for the
features
option, which previously was set to NULL. By setting it correctly, these registers appear again. See https://github.com/riscv/riscv-gnu-toolchain/issues/319 for more information.