From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30172 invoked by alias); 13 May 2002 19:24:51 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30165 invoked from network); 13 May 2002 19:24:49 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 13 May 2002 19:24:49 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 177LRB-0000Sl-00; Mon, 13 May 2002 15:24:49 -0400 Date: Mon, 13 May 2002 12:24:00 -0000 From: Daniel Jacobowitz To: David Stroupe Cc: gdb@sources.redhat.com Subject: Re: gdb and mmap Message-ID: <20020513192449.GA1757@nevyn.them.org> Mail-Followup-To: David Stroupe , gdb@sources.redhat.com References: <3CE011C3.6060807@keyed-upsoftware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3CE011C3.6060807@keyed-upsoftware.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-05/txt/msg00144.txt.bz2 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