This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory-mapped peripheral registers, remote protocol and memory maps


On 11/29/2012 03:23 AM, Jon Beniston wrote:
How is the access of memory-mapped peripheral registers handled over the
remote protocol? By this, I mean how can you force a 32-bit read/write,
rather than 4 byte accesses, to read/write a 32-bit memory-mapper register?

I can see that you can define memory regions with the mem command, and set
the memory access size to 32, but how does this map over the remote
protocol?   The remote protocol documentation for the 'm' packet says: "The
stub need not use any particular size or alignment when gathering data from
memory for the response; even if addr is word-aligned and length is a
multiple of the word size, the stub is free to use byte accesses, or not.
For this reason, this packet may not be suitable for accessing memory-mapped
I/O devices.". Is there another packet that is suitable? It doesn't look
like the code in remote.c uses this attribute.

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.


--
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]