Search code examples
cdebuggingsolarisdbx

Dumping structure using dbx


I'm debugging my C program using dbx on Solaris, and I'd like to be able to see the contents of a data structure.

It's a local data structure in the function that's in scope, so typing "dump" shows a pointer to the structure. However, I'd like to look at the contents of various fields within it. How can I do that?


Solution

  • Generally the 'print' command offers the best functionality for this kind of thing. If your local pointer variable is called 'p', then use "print *p". The argument to print can be any language expression, for example "print p->buf" or "print p->buf[3]"