From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,9f6112c8fb11675d,start X-Google-Attributes: gidfee84,public From: mbeattie@sable.ox.ac.uk (Malcolm Beattie) Subject: Debuggers and mmap'd regions Date: 1995/07/11 Message-ID: <3tu8fi$pgt@news.ox.ac.uk>#1/1 X-Deja-AN: 106000943 organization: Oxford University, England keywords: debuggers gdb dbx decladebug mmap newsgroups: comp.unix.osf.osf1 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 Oxford University Computing Services "Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee