Author Topic: Gdb work with openocd in pipe mode,but in C::B ,some message seems missing ?  (Read 47970 times)

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
Gdb can works well with openocd when  it run in  cmd or powershell   in pipe mode , but  in C::B ,  it seems  some message always missing. Gdb can not  get enough message.

It  look is  like this :
[debug]Source directories searched: D:/FPGA/CB_Projs/123456;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> target extended-remote | openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
[debug]Licensed under GNU GPL v2
[debug]For bug reports, read
[debug]   http://openocd.org/doc/doxygen/bugs.html
[debug]Info : OpenOCD will shutdown when debugger closed connection
[debug]Info : J-Link V9 compiled Oct 25 2018 11:46:07
[debug]Remote debugging using | openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Info : Hardware version: 9.20
[debug]Info : VTarget = 3.283 V
[debug]Info : clock speed 1000 kHz
[debug]Info : JTAG tap: riscv.cpu tap/device found: 0x00001303 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
[debug]Info : datacount=2 progbufsize=8
[debug]Info : Examined RISC-V core; found 1 harts
[debug]Info :  hart 0: XLEN=32, misa=0x40001104
[debug]Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
[debug]>>>>>>cb_gdb:
[debug]> load
[debug]You can't do that when your target is `exec'
[debug]>>>>>>cb_gdb:
[debug]> b main
[debug]Breakpoint 2 at 0x12356: file main.c, line 52.
« Last Edit: October 12, 2020, 04:59:10 am by jjingwer »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Is the full debug log enabled?
Settings->Debugger->full debug log

Can you post a cmd version and a codeblocks version in code tags (the # symbol in the forum text editor)?

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@BlueHazzard
yes , full debug log
when it  run in  cmd  like this:
PS D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS> riscv64-unknown-elf-gdb.exe  .\123456.elf
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
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-w64-mingw32 --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"...
Reading symbols from .\123456.elf...
<LOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : OpenOCD will shutdown when debugger closed connection
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.20
Info : VTarget = 3.259 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x00001303 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40001104
0x007fbfc4 in ?? ()
(gdb) load
Loading section .PieCtrlRegs, size 0x80 lma 0x1900
Loading section .PieVectTable, size 0x1c0 lma 0x1a00
Loading section .GpioCtrlRegs, size 0x38 lma 0xd800
Loading section .GpioDataRegs, size 0x30 lma 0xd838
Loading section .GpioIntRegs, size 0x10 lma 0xd868
Loading section .text.init, size 0x128 lma 0x12000
Loading section .text, size 0x64c lma 0x12128
Start address 0x12000, load size 2604
Transfer rate: 8 KB/sec, 372 bytes/write.
(gdb)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Please use the # symbol to post logs.
This should look like this
Code
This is a log 

I see only this difference:
Code
[debug]Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
This comes from GDB, so is the connection to your target not stable?

A quick google search showed that it is possible a bug in gdb. Are you sure you are using the same version of GDB from command line and from codeblocks?

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@BlueHazzard


I am  using the same version of GDB ,  and  the only difference is  :

Code
[debug]Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+


And  It did happens  in cmd, But when I   add
Code
fflush(stdout);
into  oenocd  and build it,   It  does not happend  again  in cmd. 
But in C::B  it still  happens  .
« Last Edit: October 12, 2020, 02:12:41 pm by jjingwer »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
very strange...

If all executable are the same for cmd and codeblocks it should work...
Are you starting OpenOCD separately or trough codeblocks?

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@BlueHazzard

I use C::B   to  start  Gdb .  And start Openocd  through  Gdb.

I get the infomation form Openocd  user guide

Code
21.1 Connecting to GDB
Use GDB 6.7 or newer with OpenOCD if you run into trouble. For instance GDB 6.3 has a known bug that produces bogus memory access errors, which has since been fixed; see http://osdir.com/ml/gdb.bugs.discuss/2004-12/msg00018.html

OpenOCD can communicate with GDB in two ways:

A socket (TCP/IP) connection is typically started as follows:
target extended-remote localhost:3333
This would cause GDB to connect to the gdbserver on the local pc using port 3333.

The extended remote protocol is a super-set of the remote protocol and should be the preferred choice. More details are available in GDB documentation https://sourceware.org/gdb/onlinedocs/gdb/Connecting.html

To speed-up typing, any GDB command can be abbreviated, including the extended remote command above that becomes:

tar ext :3333
Note: If any backward compatibility issue requires using the old remote protocol in place of the extended remote one, the former protocol is still available through the command:

target remote localhost:3333

A pipe connection is typically started as follows:

target extended-remote | openocd -c "gdb_port pipe; log_output openocd.log"

This would cause GDB to run OpenOCD and communicate using pipes (stdin/stdout). Using this method has the advantage of GDB starting/stopping OpenOCD for the debug session. log_output sends the log output to a file to ensure that the pipe is not saturated when using higher debug level outputs.

To list the available OpenOCD commands type monitor help on the GDB command line.

One way to connect Openocd is
Code
target remote localhost:3333

The other is
Code
target extended-remote | openocd -c "gdb_port pipe; log_output openocd.log"

I  used the second .

when in cmd or powershell ,  also  use cmd to start  Gdb and use gdb to start Openocd.


In fact , I  want to use the first way  , but  I can not   find plugins for  Openocd.
« Last Edit: October 13, 2020, 09:43:05 am by jjingwer »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Code
target extended-remote | openocd -c "gdb_port pipe; log_output openocd.log"
So this line starts openocd from within gdb?
My guess is, that it starts the old version of openocd you still have in your path... Where do you have openocd installed? Where is your self build version of OpenOCD? Have you tried to use a full path to openocd in this command line?
Have you tried to start openocd from command line, and connect with codeblocks to it?
You can use processExplorer https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer to see the path from your executable if you hover the mouse over it. So start codebocks and your gdb setup, and look at the path of the started openocd


Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@BlueHazzard

I  can  set path  for C::B and cmd  ,so   I am sure  it is  the same Gdb and Openocd .

Also  I  can  set path in Gdb to start Openocd.

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding file: D:\FPGA\CB_Projs\123456\bin\Debug\123456.elf
Changing directory to: D:/FPGA/CB_Projs/123456/
Set variable: PATH=.;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-llvm\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC;C:\Windows\System32;C:\Windows;D:\CodeBlocks\MinGW\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\jim\AppData\Local\Microsoft\WindowsApps;D:\modeltech64_2019\win64;C:\Users\jim\AppData\Local\Programs\Microsoft VS Code\bin;\;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\mingw-w64\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\riscv32-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\riscv64-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools\openocd;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools

[debug]Command-line: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
[debug]Working dir : D:\FPGA\CB_Projs\123456

Starting debugger: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
done

[debug]D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
[debug]Reading symbols from D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf...
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.2.90.20190228-git
[debug]Copyright (C) 2019 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "--host=x86_64-w64-mingw32 --target=riscv64-unknown-elf".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]    <http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.2.90.20190228-git

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/FPGA/CB_Projs/123456/
[debug]Source directories searched: D:/FPGA/CB_Projs/123456;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> target extended-remote | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
[debug]Licensed under GNU GPL v2
[debug]For bug reports, read
[debug] http://openocd.org/doc/doxygen/bugs.html
[debug]Info : OpenOCD will shutdown when debugger closed connection
[debug]Info : J-Link V9 compiled Oct 25 2018 11:46:07
[debug]Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Info : Hardware version: 9.20
[debug]Info : VTarget = 3.283 V
[debug]Info : clock speed 1000 kHz
[debug]Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
[debug]Info : datacount=2 progbufsize=8
[debug]Info : Examined RISC-V core; found 1 harts
[debug]Info :  hart 0: XLEN=32, misa=0x40001104
[debug]Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
[debug]>>>>>>cb_gdb:
[debug]> load
[debug]You can't do that when your target is `exec'
[debug]>>>>>>cb_gdb:
[debug]> b main
[debug]Breakpoint 2 at 0x12356: file main.c, line 52.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Don't know how to run.  Try "help target".
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: Don't know how to run.  Try "help target".

[debug]> quit

Debugger finished with status 0


like this:
Code
[debug]Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"

Also in powershell:
Code
PS D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS> riscv64-unknown-elf-gdb.exe .\123456.elf
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
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-w64-mingw32 --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"...
Reading symbols from .\123456.elf...
<-f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : OpenOCD will shutdown when debugger closed connection
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.20
Info : VTarget = 3.280 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40001104
0x007fc026 in ?? ()
(gdb) load
Loading section .PieCtrlRegs, size 0x80 lma 0x1900
Loading section .PieVectTable, size 0x1c0 lma 0x1a00
Loading section .GpioCtrlRegs, size 0x38 lma 0xd800
Loading section .GpioDataRegs, size 0x30 lma 0xd838
Loading section .GpioIntRegs, size 0x10 lma 0xd868
Loading section .text.init, size 0x128 lma 0x12000
Loading section .text, size 0x64c lma 0x12128
Start address 0x12000, load size 2604
Transfer rate: 12 KB/sec, 372 bytes/write.
(gdb)



Same path:
Code
Reading symbols from .\123456.elf...
<-f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
« Last Edit: October 13, 2020, 01:59:03 pm by jjingwer »

Online stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
An almost debugger newbie, but, are you sure you are running the same "123456.elf" because it looks like you have different working folders being shown.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@stahta01
It is the  same file, the path is  different  because  I copy it  here .

And I  tried    in  same path just now,  no change

Code
PS D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS> riscv64-unknown-elf-gdb.exe   ..\..\CB_Projs\123456\bin\Debug\123456.elf
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
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-w64-mingw32 --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"...
Reading symbols from ..\..\CB_Projs\123456\bin\Debug\123456.elf...
(gdb) load
You can't do that when your target is `exec'
<_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : OpenOCD will shutdown when debugger closed connection
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.20
Info : VTarget = 3.237 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40001104
main () at main.c:163
163           while(Xint2Count == TempX2Count) {}
(gdb) load
Loading section .PieCtrlRegs, size 0x80 lma 0x1900
Loading section .PieVectTable, size 0x1c0 lma 0x1a00
Loading section .GpioCtrlRegs, size 0x38 lma 0xd800
Loading section .GpioDataRegs, size 0x30 lma 0xd838
Loading section .GpioIntRegs, size 0x10 lma 0xd868
Loading section .text.init, size 0x128 lma 0x12000
Loading section .text, size 0x64c lma 0x12128
Start address 0x12000, load size 2604
Transfer rate: 11 KB/sec, 372 bytes/write.
(gdb)

By the way , I  am a newcomer here ,but  I spent  years on debugger.
« Last Edit: October 13, 2020, 02:48:11 pm by jjingwer »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
The thing is, in the logs you see everything that codeblocks sends to gdb, and everything gdb sends to codeblocks. I do not see many (or lets say crucial) differences.


Can you try to use the command line and execute exactly the same things codeblocks is executing?
You see what codeblocks is sending to GDB with the
Code
[debug]>>>>>>cb_gdb:
line in front...


Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
@BlueHazzard

First thanks  for your  help , and  I  just   tried  to  execute exactly the same things codeblocks is executing.
And the result is the same.

In  cmd:
Code
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS>D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf...
(gdb) show version
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-w64-mingw32 --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) set confirm off
(gdb) set width 0
(gdb) set height 0
(gdb) set breakpoint pending on
(gdb) set print asm-demangle on
(gdb) set unwindonsignal on
(gdb) set print elements 200
(gdb) set disassembly-flavor att
No symbol "disassembly" in current context.
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) directory D:/FPGA/CB_Projs/123456/
Source directories searched: D:/FPGA/CB_Projs/123456;$cdir;$cwd
(gdb) target extended-remote | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : OpenOCD will shutdown when debugger closed connection
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.20
Info : VTarget = 2.802 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40001104
main () at main.c:163
D:\FPGA\CB_Projs\123456\main.c:163:5598:beg:0x12514
(gdb) load
Loading section .PieCtrlRegs, size 0x80 lma 0x1900
Loading section .PieVectTable, size 0x1c0 lma 0x1a00
Loading section .GpioCtrlRegs, size 0x38 lma 0xd800
Loading section .GpioDataRegs, size 0x30 lma 0xd838
Loading section .GpioIntRegs, size 0x10 lma 0xd868
Loading section .text.init, size 0x128 lma 0x12000
Loading section .text, size 0x64c lma 0x12128
Start address 0x12000, load size 2604
Transfer rate: 12 KB/sec, 372 bytes/write.
(gdb) b main
Breakpoint 2 at 0x12356: file main.c, line 52.

In  C::BB
Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding file: D:\FPGA\CB_Projs\123456\bin\Debug\123456.elf
Changing directory to: D:/FPGA/CB_Projs/123456/
Set variable: PATH=.;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-llvm\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC;C:\Windows\System32;C:\Windows;D:\CodeBlocks\MinGW\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\jim\AppData\Local\Microsoft\WindowsApps;D:\modeltech64_2019\win64;C:\Users\jim\AppData\Local\Programs\Microsoft VS Code\bin;\;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\mingw-w64\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\riscv32-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\riscv64-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools\openocd;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools

[debug]Command-line: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
[debug]Working dir : D:\FPGA\CB_Projs\123456

Starting debugger: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
done

[debug]D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
[debug]Reading symbols from D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf...
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.2.90.20190228-git
[debug]Copyright (C) 2019 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "--host=x86_64-w64-mingw32 --target=riscv64-unknown-elf".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]    <http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.2.90.20190228-git

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/FPGA/CB_Projs/123456/
[debug]Source directories searched: D:/FPGA/CB_Projs/123456;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> target extended-remote | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
[debug]Licensed under GNU GPL v2
[debug]For bug reports, read
[debug] http://openocd.org/doc/doxygen/bugs.html
[debug]Info : OpenOCD will shutdown when debugger closed connection
[debug]Info : J-Link V9 compiled Oct 25 2018 11:46:07
[debug]Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
[debug]Info : Hardware version: 9.20
[debug]Info : VTarget = 3.146 V
[debug]Info : clock speed 1000 kHz
[debug]Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
[debug]Info : datacount=2 progbufsize=8
[debug]Info : Examined RISC-V core; found 1 harts
[debug]Info :  hart 0: XLEN=32, misa=0x40001104
[debug]Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
[debug]>>>>>>cb_gdb:
[debug]> load
[debug]You can't do that when your target is `exec'
[debug]>>>>>>cb_gdb:
[debug]> b main
[debug]Breakpoint 2 at 0x12356: file main.c, line 52.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Don't know how to run.  Try "help target".
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: Don't know how to run.  Try "help target".

[debug]> quit

Debugger finished with status 0



I think  I may not  make  it  easy to be  understood.

In the C::B,  openocd   post  message to  Gdb ,but Gdb can not  get enough  message.

C::B  can  tell  you  what   C::B send to  Gdb and  Gdb  send to  C::B  , but  It can not tell  you  what  Openocd  send to  Gdb.

But they all  in C::B ,   Maybe   command  line  in   C::B  do not  have  eouch  buffer or  cache  ?

And  I  did a  test , I make  Openocd  to send more logs in  C::B:
Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding source dir: D:\FPGA\CB_Projs\123456\
Adding file: D:\FPGA\CB_Projs\123456\bin\Debug\123456.elf
Changing directory to: D:/FPGA/CB_Projs/123456/
Set variable: PATH=.;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-llvm\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC;C:\Windows\System32;C:\Windows;D:\CodeBlocks\MinGW\bin;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\jim\AppData\Local\Microsoft\WindowsApps;D:\modeltech64_2019\win64;C:\Users\jim\AppData\Local\Programs\Microsoft VS Code\bin;\;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\mingw-w64\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv-tc-gcc\riscv32-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\riscv64-unknown-elf\bin;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools\openocd;D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\tools

[debug]Command-line: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
[debug]Working dir : D:\FPGA\CB_Projs\123456

Starting debugger: D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
done

[debug]D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
[debug]Reading symbols from D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf...
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.2.90.20190228-git
[debug]Copyright (C) 2019 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "--host=x86_64-w64-mingw32 --target=riscv64-unknown-elf".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]    <http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 8.2.90.20190228-git

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]No symbol "disassembly" in current context.
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/FPGA/CB_Projs/123456/
[debug]Source directories searched: D:/FPGA/CB_Projs/123456;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> target extended-remote | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"   -d3
[debug]Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
[debug]Licensed under GNU GPL v2
[debug]For bug reports, read
[debug] http://openocd.org/doc/doxygen/bugs.html
[debug]User : 13 1 options.c:60 configuration_output_handler(): debug_level: 3
[debug]User : 14 1 options.c:60 configuration_output_handler():
[debug]Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"   -d3
[debug]Debug: 15 957 options.c:184 add_default_dirs(): bindir=/usr/local/bin
[debug]Debug: 16 957 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
[debug]Debug: 17 957 options.c:186 add_default_dirs(): exepath=/openocd
[debug]Debug: 18 957 options.c:187 add_default_dirs(): bin2data=../share/openocd


Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
And  the cmd  in  C::B  just not  working .
I  can sned  message   to  it ,  but  no  respond .


But in cmd:
Code
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS>D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe -nx -fullname -quiet  -args D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf
D:\FPGA\CODEBLOCKS-20200813\CODEBLOCKS\DSC\bin\riscv64-unknown-elf-gcc-8.2.0-2019.02.0\bin\riscv64-unknown-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from D:/FPGA/CB_Projs/123456/bin/Debug/123456.elf...
<-f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"   -d3
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"   -d3
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
User : 13 1 options.c:60 configuration_output_handler(): debug_level: 3
User : 14 1 options.c:60 configuration_output_handler():
Debug: 15 965 options.c:184 add_default_dirs(): bindir=/usr/local/bin
Debug: 16 967 options.c:185 add_default_dirs(): pkgdatadir=/usr/local/share/openocd
Debug: 17 968 options.c:186 add_default_dirs(): exepath=/openocd
Debug: 18 969 options.c:187 add_default_dirs(): bin2data=../share/openocd
Debug: 883 2712 riscv-013.c:393 scan():  ->  progbufsize=8 cmderr=2 datacount=2
Debug: 884 2715 riscv-013.c:755 execute_abstract_command(): command 0x321008 failed; abstractcs=0x8000202
Debug: 894 2716 riscv-013.c:382 scan(): 41b 3i w 00000200 @16 -> + 00000000 @16
Debug: 895 2720 riscv-013.c:393 scan():  cmderr=2 ->
Debug: 905 2722 riscv-013.c:382 scan(): 41b 3i - 00000000 @16 -> + 00000200 @16
Debug: 906 2725 riscv-013.c:393 scan():  ->  cmderr=2
Debug: 907 2725 riscv-013.c:733 execute_abstract_command(): command=0x220301; access register, size=32, postexec=0, transfer=1, write=0, regno=0x301
Debug: 917 2730 riscv-013.c:382 scan(): 41b 3i w 00220301 @17 -> + 00000000 @16
Debug: 927 2731 riscv-013.c:382 scan(): 41b 3i - 00000000 @17 -> + 00220301 @17
Debug: 937 2732 riscv-013.c:382 scan(): 41b 3i r 00000000 @16 -> + 00000000 @17
Debug: 947 2734 riscv-013.c:382 scan(): 41b 3i - 00000000 @16 -> + 08000002 @16
Debug: 948 2740 riscv-013.c:393 scan():  ->  progbufsize=8 datacount=2
Debug: 958 2742 riscv-013.c:382 scan(): 41b 3i r 00000000 @04 -> + 00000000 @16
Debug: 968 2743 riscv-013.c:382 scan(): 41b 3i - 00000000 @04 -> + 40001104 @04
Debug: 969 2745 riscv-013.c:1335 register_read_direct(): {0} reg[0x342] = 0x40001104
Debug: 970 2749 riscv.c:2531 riscv_init_registers(): create register cache for 4162 registers
Debug: 971 2751 riscv-013.c:1548 examine():  hart 0: XLEN=32, misa=0x40001104
Debug: 972 2752 riscv-013.c:3573 riscv013_step_or_resume_current_hart(): resuming hart 0 (for step?=0)
Debug: 982 2760 riscv-013.c:382 scan(): 41b 3i r 00000000 @11 -> + 00000000 @04
Debug: 992 2761 riscv-013.c:382 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 993 2763 riscv-013.c:393 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 994 2764 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[00] = DASM(0x0000100f)
Debug: 1004 2769 riscv-013.c:382 scan(): 41b 3i w 0000100f @20 -> + 00000000 @11
Debug: 1014 2770 riscv-013.c:382 scan(): 41b 3i - 00000000 @20 -> + 0000100f @20
Debug: 1015 2772 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[01] = DASM(0x0000000f)
Debug: 1025 2779 riscv-013.c:382 scan(): 41b 3i w 0000000f @21 -> + 00000000 @20
Debug: 1035 2780 riscv-013.c:382 scan(): 41b 3i - 00000000 @21 -> + 0000000f @21
Debug: 1036 2782 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[02] = DASM(0x00100073)
Debug: 1046 2784 riscv-013.c:382 scan(): 41b 3i w 00100073 @22 -> + 00000000 @21
Debug: 1056 2789 riscv-013.c:382 scan(): 41b 3i - 00000000 @22 -> + 00100073 @22
Debug: 1057 2794 riscv-013.c:733 execute_abstract_command(): command=0x241000; access register, size=32, postexec=1, transfer=0, write=0, regno=0x1000
Debug: 1067 2800 riscv-013.c:382 scan(): 41b 3i w 00241000 @17 -> + 00000000 @22
Debug: 1077 2801 riscv-013.c:382 scan(): 41b 3i - 00000000 @17 -> + 00241000 @17
Debug: 1087 2803 riscv-013.c:382 scan(): 41b 3i r 00000000 @16 -> + 00000000 @17
Debug: 1097 2804 riscv-013.c:382 scan(): 41b 3i - 00000000 @16 -> + 08000002 @16
Debug: 1098 2810 riscv-013.c:393 scan():  ->  progbufsize=8 datacount=2
Debug: 1099 2812 riscv.c:2152 riscv_set_current_hartid(): setting hartid to 0, was 0
Debug: 1100 2814 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[00] = DASM(0x0000100f)
Debug: 1110 2819 riscv-013.c:382 scan(): 41b 3i w 0000100f @20 -> + 00000000 @16
Debug: 1120 2820 riscv-013.c:382 scan(): 41b 3i - 00000000 @20 -> + 0000100f @20
Debug: 1121 2822 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[01] = DASM(0x0000000f)
Debug: 1131 2824 riscv-013.c:382 scan(): 41b 3i w 0000000f @21 -> + 00000000 @20
Debug: 1141 2829 riscv-013.c:382 scan(): 41b 3i - 00000000 @21 -> + 0000000f @21
Debug: 1142 2830 program.c:33 riscv_program_write(): 0xffffbf30: debug_buffer[02] = DASM(0x00100073)
Debug: 1152 2834 riscv-013.c:382 scan(): 41b 3i w 00100073 @22 -> + 00000000 @21
Debug: 1162 2838 riscv-013.c:382 scan(): 41b 3i - 00000000 @22 -> + 00100073 @22
Debug: 1163 2839 riscv-013.c:733 execute_abstract_command(): command=0x241000; access register, size=32, postexec=1, transfer=0, write=0, regno=0x1000
Debug: 1173 2846 riscv-013.c:382 scan(): 41b 3i w 00241000 @17 -> + 00000000 @22
Debug: 1183 2847 riscv-013.c:382 scan(): 41b 3i - 00000000 @17 -> + 00241000 @17
Debug: 1193 2848 riscv-013.c:382 scan(): 41b 3i r 00000000 @16 -> + 00000000 @17
Debug: 1203 2849 riscv-013.c:382 scan(): 41b 3i - 00000000 @16 -> + 08000002 @16
Debug: 1204 2850 riscv-013.c:393 scan():  ->  progbufsize=8 datacount=2
Debug: 1205 2852 riscv.c:2152 riscv_set_current_hartid(): setting hartid to 0, was 0
Debug: 1215 2857 riscv-013.c:382 scan(): 41b 3i w 40000001 @10 -> + 00000000 @16
Debug: 1216 2859 riscv-013.c:393 scan():  resumereq dmactive ->
Debug: 1226 2859 riscv-013.c:382 scan(): 41b 3i - 00000000 @10 -> + 40000001 @10
Debug: 1227 2860 riscv-013.c:393 scan():  ->  resumereq dmactive
Debug: 1237 2864 riscv-013.c:382 scan(): 41b 3i r 00000000 @11 -> + 00000000 @10
Debug: 1247 2867 riscv-013.c:382 scan(): 41b 3i - 00000000 @11 -> + 00030c82 @11
Debug: 1248 2868 riscv-013.c:393 scan():  ->  allresumeack anyresumeack allrunning anyrunning authenticated version=2
Debug: 1258 2872 riscv-013.c:382 scan(): 41b 3i w 00000001 @10 -> + 00000000 @11
Debug: 1259 2877 riscv-013.c:393 scan():  dmactive ->
Debug: 1269 2877 riscv-013.c:382 scan(): 41b 3i - 00000000 @10 -> + 00000001 @10
Debug: 1270 2878 riscv-013.c:393 scan():  ->  dmactive
Debug: 1271 2879 riscv-013.c:1555 examine(): Enumerated 1 harts
Info : 1272 2881 riscv-013.c:1567 examine(): Examined RISC-V core; found 1 harts
Info : 1273 2886 riscv-013.c:1571 examine():  hart 0: XLEN=32, misa=0x40001104
Debug: 1283 2888 riscv-013.c:382 scan(): 41b 3i r 00000000 @10 -> + 00000000 @10
Debug: 1293 2895 riscv-013.c:382 scan(): 41b 3i - 00000000 @10 -> + 00000001 @10
Debug: 1294 2896 riscv-013.c:393 scan():  ->  dmactive
Debug: 1682 3145 riscv-013.c:382 scan(): 41b 3i r 00000000 @11 -> + 00000000 @10
Debug: 1692 3149 riscv-013.c:382 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 1693 3150 riscv-013.c:393 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Debug: 1694 3151 command.c:143 script_debug(): command - log_output log_output openocd.log
Debug: 1695 3154 riscv.c:1193 riscv_openocd_poll(): polling all harts
Debug: 1696 3154 riscv.c:2152 riscv_set_current_hartid(): setting hartid to 0, was 0
Debug: 1697 3161 riscv.c:1148 riscv_poll_hart(): polling hart 0, target->state=2
Debug: 1707 3164 riscv-013.c:382 scan(): 41b 3i r 00000000 @11 -> + 00000000 @11
Debug: 1717 3165 riscv-013.c:382 scan(): 41b 3i - 00000000 @11 -> + 00030382 @11
Debug: 1718 3169 riscv-013.c:393 scan():  ->  allresumeack anyresumeack allhalted anyhalted authenticated version=2
Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
(gdb)

Offline jjingwer

  • Multiple posting newcomer
  • *
  • Posts: 13
The  old problem happen  a  again, but  when I   make  Openocd  generate less logs ,
it   works again.
Code
Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+
<-f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Remote debugging using | D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd -c "gdb_port pipe"  -f   D:\\FPGA\\CODEBLOCKS-20200813\\CODEBLOCKS\\tools\\openocd\\openocd_test.cfg  -c "log_output openocd.log"
Open On-Chip Debugger 0.10.0+dev-00923-g9e6a7a2e5-dirty (2020-09-27-13:35)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : OpenOCD will shutdown when debugger closed connection
Info : J-Link V9 compiled Oct 25 2018 11:46:07
Info : Hardware version: 9.20
Info : VTarget = 2.868 V
Info : clock speed 1000 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x00007c03 (mfg: 0x601 (<unknown>), part: 0x0007, ver: 0x0)
Info : datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40001104
0x00000000 in ?? ()
(gdb) load
Loading section .PieCtrlRegs, size 0x80 lma 0x1900
Loading section .PieVectTable, size 0x1c0 lma 0x1a00
Loading section .GpioCtrlRegs, size 0x38 lma 0xd800
Loading section .GpioDataRegs, size 0x30 lma 0xd838
Loading section .GpioIntRegs, size 0x10 lma 0xd868
Loading section .text.init, size 0x128 lma 0x12000
Loading section .text, size 0x64c lma 0x12128
Start address 0x12000, load size 2604
Transfer rate: 12 KB/sec, 372 bytes/write.
(gdb)