Open kentindell opened 3 weeks ago
Thanks, I'm travelling without a PC at the moment but will look at this when I get back. So that I can reproduce could you please let me know:
The hash is
a4412c0b00fd67788e42bc61599bf7a8c106d7b1
(the current repository HEAD).
The OpenOCD config file is unchanged.
The gdb commands are exactly as shown in Readme.md
(they were copied and pasted).
My colleague discovered this first and so I followed the exact same build sequence, and replicated their result.
I just tried to run in the simulator, get not same as above but very similar.
root@debian12:/home/hazard3/test/sim/tb_cxxrtl# riscv32-unknown-elf-gdb GNU gdb (GDB) 15.1 Copyright (C) 2024 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=riscv32-unknown-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". (gdb) target extended-remote localhost:3333 Remote debugging using localhost:3333 Info : accepting 'gdb' connection on tcp/3333 hazard3.cpu halted due to debug-request. warning: No executable has been specified and target does not support determining executable automatically. Try using the "file" command. 0x00000000 in ?? () (gdb) file ../hellow/tmp/hellow.elf A program is being debugged already. Are you sure you want to change the file? (y or n) y Reading symbols from ../hellow/tmp/hellow.elf... (No debugging symbols found in ../hellow/tmp/hellow.elf) (gdb) load Loading section .text, size 0x17e0 lma 0x0 Loading section .rodata, size 0x24 lma 0x17e0 Error: [hazard3.cpu] Error when writing memory, abstractcs=0x2000301 Error: [hazard3.cpu] Failed to write memory (addr=0x0) progbuf=failed, sysbus=disabled, abstract=disabled Load failed
When running
hellow
through the simulator, the output when using gdb/OpenOCD/JTAG is:When dumping the memory for the string from the simulated and via gdb shows that this is indeed the string value. OpenOCD shows some errors and warnings:
I'm assuming there''s some kind of memory allocation problem for gdb to push data into the target (so the first four bytes of the string are repeated across the memory). When asking gdb to verify the sections:
The code does actually run correctly (the simulator terminates with a value of 123, as expected). I guess this could be down to 'luck' though.
The versions of the software are: