This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [Gdb-discuss] Why GDB can NOT read the content of memory protected(readonly) from the core file
- From: Daniel Jacobowitz <drow at false dot org>
- To: MCG LU Fengcheng <Fengcheng dot LU at alcatel-sbell dot com dot cn>
- Cc: gdb-discuss at gnu dot org, gdb at sourceware dot org
- Date: Fri, 27 May 2005 15:02:22 -0400
- Subject: Re: [Gdb-discuss] Why GDB can NOT read the content of memory protected(readonly) from the core file
- References: <7E98B33B3500C0409DBEC5C0E3FDEF1201105A1F@htmail.sbell.com.cn>
- Reply-to: gdb at sourceware dot org
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 <buf>: 0x00 0x00 0x00 0x00 0x00 0x00
> 0x00 0x00
> 0x80499a8 <buf+8>: 0x00 0x00 0x00 0x00 0x00 0x00
> 0x00 0x00
> 0x80499b0 <buf+16>: 0x00 0x00 0x00 0x00 0x00 0x00
> 0x00 0x00
> 0x80499b8 <buf+24>: 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