Some question about gdb unknown memory

Luis Machado
Fri Jun 17 10:40:40 GMT 2022

[switching to gdb@]

On 5/20/22 07:51, joe jo wrote:
> Hi
> I met some questions when I used GDB to debugging my project. I'm writing this mail for some help.
> At first I set up my one gdb-server and use GDB to connect it.
> The problem happened when I use 'x' command to observe some unknown memory.
> In my design, when gdb ask for some unknown memorys or registers, my server will return '?' or some other signal. For instance, when my gdbserver receive command 'm90000000,4' and memory after 90000002 is unknown, the server will return XXXX????. Otherwise, the server will return unknown register like 1234???000?0000 when receive 'g' command
> However, when recieve ?, GDB will report errors like "Invalid hex digit 63".
> I have read the source code of binutils-gdb/gdb/remote.c to find the reason of error, but I still don't know how can I notice GDB about those unknown memory.
> In addition, I wonder how to use MI to sent the information about unknow memory to a eclipse-based front-end
> I look forward to hearing from you soon.
> Joe Jo

Only registers can have unknown/unavailable values, marked as lowercase 'x' in the register packet reply. Memory reads don't have such support, so '?' is essentially not recognized as something valid.

More information about the Gdb mailing list