I have recently switched my development to Solaris 11. While the Sun Studio seems a nice environment, I got used to emacs and prefer it for development. When I tried to run dbx from within emacs's GUD mode, I have immediately encountered a problem: emacs would not display the source file containing the currently executing code. After some more tinkering around, I discovered that the GUD mode works OK if I debug the executable which is in the same directory as the source file.

So, GUD broke down on my multi-directory project. dbx reports by default only the base name of the source file (so, for example, it will report only "blah.c" for "/home/somewhere/something/blah.c"). This results in that emacs does not find the file, unless it is in the current working directory.

The man page of dbx doesn't mention the relevant options, but it does mention that the dbx interface is built over ksh. So I executed the "set" command to list defined internal variables and saw the DBX_output_short_file_name=on line.

Then I put


in my .dbxrc, restarted DBX in emacs, and everything started working as it should.

Also, add this to your .dbxrc to not nag with pager while running inside emacs:

if [ ! -z "$INSIDE_EMACS" ]; then