This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: Memory-mapped peripheral registers, remote protocol and memory maps
Hi Yao,
> I don't understand your problem. Anything wrong when you use 'm' packet
> to read the content of memory-mapped register? Supposing a 32-bit register
> is mapped at address 0x00d000, packet 'm 0x0x00d000 4' should be able read
> the contents of this register. Your stub should know where each register is
> mapped, and when gets a 'm' packet, get the content of register by some
> way, and reply it to GDB. In this way, the memory-mapped registers are
> transparent to GDB, and user has to access them via address.
In some cases, there might be a large variety of inter-mixed 8/16/32-bit registers, which you might not have the space to cater for in a small stub. Can we be sure that GDB will only generate a 'm 0x0x00d000 4' packet? It would be tricky for a stub to deal with a packet of a larger size (say if the register area is opened in a memory viewer). Also, it would be nice to prevent reads from certain addresses, in case they have side effects (i.e FIFOs, etc).
I would have thought it would be better to have this logic in GDB, rather than each stub, given that it already has the relevant commands.
Cheers,
Jon