This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: examining mmap()'d memory regions on linux
- To: khilman at equator dot com
- Subject: Re: examining mmap()'d memory regions on linux
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Wed, 17 May 2000 23:55:21 +0200
- CC: gdb at sourceware dot cygnus dot com
- References: <r23dngrjg9.fsf@bobdog.equator.com>
From: Kevin Hilman <khilman@equator.com>
Date: 17 May 2000 13:49:10 -0700
I have an app that reads/writes to an mmap()'d region. The data
is being read and written fine because it's getting to it's final
location (in this case a hardware device).
However, if I try to examine (via 'x') these memory regions in gdb, I
always get zeros.
Does gdb support mmap()'d regions?
Sure. However, since you mention a hardware device, you're probably
trying to examine memory mapped from that device. The Linux kernel
prevents GDB from reading "non-kernel-mapped video buffers and
similar" (see arch/i386/kernel/ptrace.c in the Linux source tree), and
will return all zeroes instead. Probably because reading from such
memory often has side-effects.
Nothing we can do about that in GDB!
Mark