Go to main content

Oracle® Solaris 64-bit Developer's Guide

Exit Print View

Updated: March 2019
 
 

5.4 Debugging 64-Bit Applications

All of the Oracle Solaris debugging tools have been updated to work with 64-bit applications. This includes the truss(1) command, the /proc tools (proc(1)) and mdb.

The dbx debugger, capable of debugging 64-bit applications, is available as part of the Oracle Developer Studio tool suites. The remaining tools are included with the Oracle Solaris release.

To debug programs that use the amd64 ABI, additional flags such as –preserve_argvalues should be passed to the Oracle Developer Studio compiler. This allows you to save registers on the stack.

A number of enhancements are available in mdb for debugging 64-bit programs. As expected, using "*" to dereference a pointer will dereference 8 bytes for 64-bit programs and 4 bytes for 32-bit programs. In addition, the following modifiers are available:

Additional ?, /, = modifiers:
	
g		(8) Display 8 bytes in unsigned octal	
G		(8) Display 8 bytes in signed octal
e		(8) Display 8 bytes in signed decimal	
E		(8) Display 8 bytes in unsigned decimal
J		(8) Display 8 bytes in hexadecimal
K		(n) Print pointer or long in hexadecimal
		  Display 4 bytes for 32-bit programs
		  and 8 bytes for 64-bit programs.
y		(8) Print 8 bytes in date format
 
Additional ? and / modifiers:
 
M <value> <mask>  Apply <mask> and compare for 8-byte value;
		  move '.' to matching location.
Z		(8) write 8 bytes