This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb and mmap
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: David Stroupe <dstroupe at keyed-upsoftware dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 13 May 2002 15:24:49 -0400
- Subject: Re: gdb and mmap
- References: <3CE011C3.6060807@keyed-upsoftware.com>
On Mon, May 13, 2002 at 02:19:31PM -0500, David Stroupe wrote:
> I am mmap()ing a memory range proovided by a driver. In gdb if I do a
> /x address I get an Cannot access memory at address 0x4001b000 error.
> If on the other hand I do somethink like
> str = (char*) address;
> printf("%s\n", str);
>
> I see the string that is stored in the address.
>
> Is there a way for me to tell gdb that the mmap()ped address is a valid one?
This is not a bug in GDB but a limitation of your operating system.
For instance, GNU/Linux chooses not to expose I/O mappings to ptrace().
I believe it can't generically be done safely, without some significant
kernel rewrite.
You can just write a function to peek at the address and call it via
'call' or 'print' at the GDB prompt.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer