Mappings with gdbserver
Daniel Jacobowitz
drow@mvista.com
Mon Jan 12 14:15:00 GMT 2004
On Mon, Jan 12, 2004 at 02:55:50PM +0100, Robert Schwebel wrote:
> I currently try to visualize a piece of memory mapped I/O with gdbserver
> and ddd; to get a user space pointer to the device memory I've mmap()ed
> the address space and set a breakpoint afterwards, then started this
> program with gdbserver.
>
> The problem is that the ddd display does only show FFs and when I try to
> write to the addresses I get "cannot access memory". Copying the area
> behind my pointer to somewhere else from the program I see the correct
> content. This lets me assume that the memory mapping gdbserver sees is
> different than what the program-under-test sees.
>
> Can anybody give me a hint how I could visualize and manipulate a piece
> of "physical" memory with ddd?
You can't, at present. This has nothing to do with gdbserver and
everything to do with the Linux kernel. Currently, ptrace will only
access regions backed by a "struct page", and will not access any
regions marked as I/O regions - this is pretty much necessary for
safety. For instance, these sorts of mappings tend to be very picky
about I/O size and GDB has no way to find that out.
I recommend adding little functions to your program to copy to/from the
I/O region and calling them from the GDB prompt in the DDD console
window.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gdb
mailing list