views:

743

answers:

3

I do TDD on a daily basis for my C++ development on Solaris10. It has greatly reduced the time I have to spend using my debugger but sometime this is the only option.

DBX is pretty powerful but not that user friendly. Note that I'm talking about console DBX not the SunStudio GUI for DBX).

What are the best productivity tips you can give for dbx C++ debugging?

PS. Changing debugger is not an option.

+3  A: 

I have bookmarked a few sites related to dbx. Here they are, in no particular order in case they might be useful to you:

HTH.

Luc Hermitte
Awesome answer.
John Bellone
+1  A: 

I too have to use dbx at work and understand your frustrations!

A few tips I have discovered which make my life a little easier:

Using the built commands system like this: when stop { print whatever ; }
Obviously doesn't work when whatever is out of scope, but I find it useful enough. I have yet to have much joy with the 'trace' facility, YMMV.

Making your own .dbxrc file makes life much easier, as does the "pathmap" feature.

Finally, this is only obvious if you know it already, but try Sun's manual ; http://docs.sun.com/source/819-3683/

It isn't particularly well written, but still an essential read.

Chris Huang-Leaver
+1  A: 

One of the powerful features of dbx is the built in ksh. You can write shell functions that are as complex as you might want to print customized views of data structures, or follow pointers in a specific route. The shell is an old variation of pdksh, so it's not the nicest for programming, but it's much better than not having any built-in language to use. There is also extensive help available from the command line. One trick for searching the help is to use "vi $helpfile" from within the dbx command shell. Tha tedits the raw helpfile data in one large file. You can see some examples of shell functions in the dbxrc file that ships with dbx and is loaded by default. You can see a more sophisticated example by looking at the libumem integration module. You can find it here:

http://blogs.sun.com/quenelle/entry/using_dbx_and_libumem_to

Chris Quenelle