* Debuggers and mmap'd regions
@ 1995-07-11 4:00 Malcolm Beattie
0 siblings, 0 replies; only message in thread
From: Malcolm Beattie @ 1995-07-11 4:00 UTC (permalink / raw)
If I use mmap(2) to map /dev/zero as follows:
addr = mmap((caddr_t) 0, size, PROT_READ|PROT_WRITE,
MAP_PRIVATE, fd, (off_t) 0);
then the system chooses an address of 2Tb (0x20000000000) and
none of the debuggers dbx, gdb, decladebug can dereference
addresses in the region, although the program itself can do so.
If I use mmap(2) to map an anonymous region as follows:
addr = mmap((caddr_t) 0, size, PROT_READ|PROT_WRITE,
MAP_ANONYMOUS|MAP_PRIVATE, -1, (off_t) 0);
then the system chooses an address of 64k (0x10000) and all
of the debuggers dbx, gdb, decladebug can dereference
addresses in the region.
Is there a good reason and/or fix as to why the former method
(which is slightly more portable than the latter) doesn't work
in the way I would expect? This is OSF/1 3.0.
--Malcolm
--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-07-11 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-07-11 4:00 Debuggers and mmap'd regions Malcolm Beattie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox