This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Mappings with gdbserver
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Robert Schwebel <robert at schwebel dot de>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 12 Jan 2004 09:15:29 -0500
- Subject: Re: Mappings with gdbserver
- References: <20040112135550.GK5139@pengutronix.de>
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