Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Solaris で dbx を使用して C プログラムをデバッグしていますが、データ構造の内容を表示できるようにしたいと考えています。
これはスコープ内の関数内のローカル データ構造であるため、「dump」と入力すると構造へのポインターが表示されます。しかし、その中のさまざまなフィールドの内容を見てみたいと思います。どうやってやるの?
一般に、「印刷」コマンドは、この種のものに最適な機能を提供します。ローカル ポインター変数の名前が「p」の場合は、"print *p" を使用します。print の引数は、「print p->buf」や「print p->buf[3]」など、任意の言語表現にすることができます。
構造ポインタ変数が呼び出されたと仮定するとstruct_ptr、これは機能しますか?
struct_ptr
dump *struct_ptr