* Re: examining mmap()'d memory regions on linux
@ 2000-06-05 18:01 j_clifton
0 siblings, 0 replies; 3+ messages in thread
From: j_clifton @ 2000-06-05 18:01 UTC (permalink / raw)
To: gdb
>Kevin Hilman wrote on 17 May 2000:
>>
>> 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?
>
>Not a GDB problem. GDB asks the kernel ``can I have memory at address X
>with process P''. If the kernel doesn't return it there is little GDB
>can do :-)
>
>As a work around, you may want to add a small function to your program
>that dumps out the relevant data. You can then call that from the gdb
>command line.
>
> enjoy,
> Andrew
Can you elaborate on what/how the kernel (ptrace) returns zero for mmapped
memory?
I read the ptrace.c code for i386 and didn't see the relationship between the
comments and mmap. I have the same problem with unable to examine a PCI
reflective memory. I also tried a program which just mallocs memory and I
couldn't see it's contents either.
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <r23dngrjg9.fsf@bobdog.equator.com>]
* Re: examining mmap()'d memory regions on linux
[not found] <r23dngrjg9.fsf@bobdog.equator.com>
@ 2000-05-17 14:55 ` Mark Kettenis
2000-05-17 16:34 ` Andrew Cagney
1 sibling, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2000-05-17 14:55 UTC (permalink / raw)
To: khilman; +Cc: gdb
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: examining mmap()'d memory regions on linux
[not found] <r23dngrjg9.fsf@bobdog.equator.com>
2000-05-17 14:55 ` Mark Kettenis
@ 2000-05-17 16:34 ` Andrew Cagney
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2000-05-17 16:34 UTC (permalink / raw)
To: Kevin Hilman; +Cc: gdb
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2349 bytes --]
Kevin Hilman wrote:
>
> 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?
Not a GDB problem. GDB asks the kernel ``can I have memory at address X
with process P''. If the kernel doesn't return it there is little GDB
can do :-)
As a work around, you may want to add a small function to your program
that dumps out the relevant data. You can then call that from the gdb
command line.
enjoy,
Andrew
From ac131313@cygnus.com Thu May 18 01:08:00 2000
From: Andrew Cagney <ac131313@cygnus.com>
To: GDB Discussion <gdb@sourceware.cygnus.com>
Subject: GDB diagram
Date: Thu, 18 May 2000 01:08:00 -0000
Message-id: <3923A4A7.8506C817@cygnus.com>
X-SW-Source: 2000-05/msg00084.html
Content-length: 365
Just FYI,
http://www.cygnus.com/~cagney/gdb-1999-07.jpg
this is something that I copied from a white board during a GDB
discussion. Some 8 months later it is interesting to see what has and
what hasn't worked.
In the next week I'll try to come up with something that more closely
resembles reality.
Andrew
PS: Yes the top left does say ``visual basic''.
From robert.melchers@drives.eurotherm.co.uk Thu May 18 08:05:00 2000
From: "Robert" <robert.melchers@drives.eurotherm.co.uk>
To: "Gdb Mailing list (E-mail)" <gdb@sourceware.cygnus.com>
Subject: gdb/mi question
Date: Thu, 18 May 2000 08:05:00 -0000
Message-id: <000301bfc0da$a244e1d0$c9a87995@rmelch.drives.eurotherm.co.uk>
X-SW-Source: 2000-05/msg00085.html
Content-length: 625
I have build gdb
with -DUI_OUT=1 and now I get the following error when I
type
Â
/tools/H-i686-pc-cygwin/bin/sh-coff-gdb --ui=mi
--nw Interpreter `mi' unrecognized.
Â
All other
combinations of --interpreter --i --ui all generate the same
message.
Â
I passed the
following to configure --enable-build-warnings=-DUI_OUT=1
Â
I want to do this so
that I my pipe commands to and from gdb. Have I entirely missed the point ?? or
am I on the right track ?
Â
Also I cant see
where _initialize_mi_main() is called from. I am guessing that once I understand
this The rest may fall into place.
Robert Melchers R&D
Â
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-06-05 18:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-05 18:01 examining mmap()'d memory regions on linux j_clifton
[not found] <r23dngrjg9.fsf@bobdog.equator.com>
2000-05-17 14:55 ` Mark Kettenis
2000-05-17 16:34 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox