[Gdb-discuss] Why GDB can NOT read the content of memory protected(readonly) from the core file
Daniel Jacobowitz
drow@false.org
Fri May 27 19:02:00 GMT 2005
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
More information about the Gdb
mailing list