Go to main content
Oracle® Developer Studio 12.5: Debugging a Program with dbx

Exit Print View

Updated: June 2016

mmapfile Command

The mmapfile command views the contents of memory mapped files that are missing from a core dump. It is valid only in native mode.

Oracle Solaris core files do not contain any memory segments that are read-only. Executable read-only segments (that is, text) are dealt with automatically and dbx resolves memory accesses against these by looking into the executable and the relevant shared objects.


mmapfile mmapped-file address offset length

View contents of memory mapped files missing from core dump.


mmapped-file is the file name of a file that was memory mapped during a core dump.

address is the starting address of the address space of the process.

length is length in bytes of the address space to be viewed.

offset is the offset in bytes to the starting address in mmapped-file.


Read-only data segments typically occur when an application memory maps a database. For example:

caddr_t vaddr = NULL;
off_t offset = 0;
size_t = 10 * 1024;
int fd;
fd = open("../DATABASE", ...)
vaddr = mmap(vaddr, size, PROT_READ, MAP_SHARED, fd, offset);
index = (DBIndex *) vaddr;

The following command enables access to the database through the debugger as memory:

mmapfile ../DATABASE $[vaddr] $[offset] $[size]

Then, to look at your database contents in a structured way:

print *index