开发者

Dumping structure using dbx

开发者 https://www.devze.com 2023-03-14 00:26 出处:网络
I\'m debugging my C program using dbx on Solaris, and I\'d like to be able t开发者_StackOverflowo see the contents of a data structure.

I'm debugging my C program using dbx on Solaris, and I'd like to be able t开发者_StackOverflowo 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?


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]"


Assuming your structure pointer variable is called struct_ptr, does this work?

dump *struct_ptr
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号