From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3351 invoked by alias); 27 May 2005 19:02:39 -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 3273 invoked by uid 22791); 27 May 2005 19:02:27 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 27 May 2005 19:02:27 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1Dbk6A-0004lW-5e; Fri, 27 May 2005 15:02:22 -0400 Date: Fri, 27 May 2005 19:02:00 -0000 From: Daniel Jacobowitz To: MCG LU Fengcheng Cc: gdb-discuss@gnu.org, gdb@sourceware.org Subject: Re: [Gdb-discuss] Why GDB can NOT read the content of memory protected(readonly) from the core file Message-ID: <20050527190222.GA18219@nevyn.them.org> Reply-To: gdb@sourceware.org Mail-Followup-To: gdb@sourceware.org References: <7E98B33B3500C0409DBEC5C0E3FDEF1201105A1F@htmail.sbell.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7E98B33B3500C0409DBEC5C0E3FDEF1201105A1F@htmail.sbell.com.cn> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00350.txt.bz2 On Fri, May 27, 2005 at 10:47:26AM +0800, MCG LU Fengcheng wrote: > Hello all Please use the gdb@sourceware.org list for GDB questions, instead. > When I use the GDB to analyze the core file, I encountered one > problem. > In my program, some memory are protected readonly(use mprotect routine). > I want to use the gdb to check the content in these memory, But GDB > always > show ZERO in these memory. For example: > > (gdb) x/32b buf > 0x80499a0 : 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 > 0x80499a8 : 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 > 0x80499b0 : 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 > 0x80499b8 : 0x00 0x00 0x00 0x00 0x00 0x00 > 0x00 0x00 > > > In Fact, there MUST be non-ZERO data in these memory. > > Why? This probably means that your kernel did not dump the contents of those sections in the core file, because it mistakenly assumed they had not been modified. -- Daniel Jacobowitz CodeSourcery, LLC