I executed a C program that converts an RGB image to grescale image.
Then, I wanna obtain the created greyscale image by using this command: dump value GreyImage.dat GreyImage
BUT I got the error info:
dropped ‘gdb’ connection
Remote connection closed
Remote connection closed (from interpreter-exec console “dump value GreyImage.dat GreyImage”)
You set a breakpoint at the end of the computation. You start debugging mode (Debug → Start debugging). Debugging starts and at some point later the breakpoint is hit and the processor is stopped. You go into the “Debug Console” where you can enter GDB commands. Just like you tried executing dump value GreyImage.dat GreyImage in that console and got an error, I want you to try the commands info registers and help dump to see if GDB is generally working.
Seems like either GDB or the thing answering GDB has a bug and aborts the connection. An issue should be opened about that.
Well if the print and dump command does not work but the examine (x) command does work, the only alternative I see is printing a hex dump of the GreyImage object and re-convert that to binary data. You should know the compile-time constant size of GreyImage (e.g., 1000 bytes), so you can use something like
set logging file /home/<user>/image_dump.txt
set logging on
set logging off
To start logging in a file, examine 1000 bytes in hex form (x/1000bx), which should then get saved in a file.
And I executed the four commands as you suggested with the following output:
39^error,msg=“Invalid thread id: 1”
41^error,msg=“Invalid thread id: 1”
Yes and that can’t be correct, since previously you had non-zero content in there.
You have to know the byte size of the GreyImage object, it’s likely a one or two-dimensional array of bytes defined somewhere in the code, lookup the definition in code and you should see the size of it.
Or if you have serial output available, use printf("sizeof(GreyImage) = %d\n", (int) sizeof(GreyImage)); to print it out.
The command sizeof(GreyImage) returned 16384, so I executed the command: x/16384bx GreyImage.
And the logging values are:
It seems that it works normally.