Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb and mmap
@ 2002-05-13 12:19 David Stroupe
  2002-05-13 12:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: David Stroupe @ 2002-05-13 12:19 UTC (permalink / raw)
  To: gdb

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?

TIA
David


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gdb and mmap
  2002-05-13 12:19 gdb and mmap David Stroupe
@ 2002-05-13 12:24 ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-05-13 12:24 UTC (permalink / raw)
  To: David Stroupe; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB and mmap
  2007-07-13  8:15 GDB " Jan Somr
  2007-07-13 11:44 ` Daniel Jacobowitz
@ 2007-07-17  3:46 ` Rodrigo Rubira Branco
  1 sibling, 0 replies; 5+ messages in thread
From: Rodrigo Rubira Branco @ 2007-07-17  3:46 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

On Fri, 2007-07-13 at 10:15 +0200, Jan Somr wrote:
> Hi all, please help. 
> I have an application which makes cores and uses mapped memory (mmap).  How can I access this memory in GDB? 
> When I try print it I get this message: "Cannot access memory at address xxxxxxxxxx". Is the shared memory dumped in the core?
> Thank you.

If the vm_area_struct of the mapped area have the vm_flags attribute set
to VM_IO, this area will not be dumped...


cya,


Rodrigo (BSDaemon).

-- 
Rodrigo Rubira Branco
Software Engineer 
Advanced Linux Response Team (ALRT) / Linux on Power Toolchain
IBM Linux Technology Center (IBM/LTC)
rrbranco@br.ibm.com

GPG KeyID: 1FCEDEA1

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GDB and mmap
  2007-07-13  8:15 GDB " Jan Somr
@ 2007-07-13 11:44 ` Daniel Jacobowitz
  2007-07-17  3:46 ` Rodrigo Rubira Branco
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-07-13 11:44 UTC (permalink / raw)
  To: Jan Somr; +Cc: gdb

On Fri, Jul 13, 2007 at 10:15:06AM +0200, Jan Somr wrote:
> Hi all, please help. 
> I have an application which makes cores and uses mapped memory (mmap).  How can I access this memory in GDB? 
> When I try print it I get this message: "Cannot access memory at address xxxxxxxxxx". Is the shared memory dumped in the core?

No, it usually is not dumped.  There's nothing GDB can do about that.

Some operating systems have configuration options to control what is
dumped.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 5+ messages in thread

* GDB and mmap
@ 2007-07-13  8:15 Jan Somr
  2007-07-13 11:44 ` Daniel Jacobowitz
  2007-07-17  3:46 ` Rodrigo Rubira Branco
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Somr @ 2007-07-13  8:15 UTC (permalink / raw)
  To: gdb

Hi all, please help. 
I have an application which makes cores and uses mapped memory (mmap).  How can I access this memory in GDB? 
When I try print it I get this message: "Cannot access memory at address xxxxxxxxxx". Is the shared memory dumped in the core?
Thank you.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-16 19:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-13 12:19 gdb and mmap David Stroupe
2002-05-13 12:24 ` Daniel Jacobowitz
2007-07-13  8:15 GDB " Jan Somr
2007-07-13 11:44 ` Daniel Jacobowitz
2007-07-17  3:46 ` Rodrigo Rubira Branco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox