Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Debuggers and mmap'd regions
Date: 1995/07/11	[thread overview]
Message-ID: <3tu8fi$pgt@news.ox.ac.uk> (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



                 reply	other threads:[~1995-07-11  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox