どのように私は、GDBにおけるタイプ属性を印刷することができますか?

StackOverflow https://stackoverflow.com/questions/745195

  •  09-09-2019
  •  | 
  •  

質問

GDB内部からtype属性を印刷する方法はありますか?
例えば。 Integer'Size。

役に立ちましたか?

解決

はいます:

(GDB)P thing'attribute

一部の属性が認識され、そして他の人はそうではありません。 (何で見つかったがブール変数であり、以下のとおりです。)

gdb) p integer'size
Attempt to use a type name as an expression
(gdb) p found'size
$2 = 8
(gdb) p integer'first
$3 = -2147483648
(gdb) p integer'last
$4 = 2147483647

ここでのデバッグのhref="http://sources.redhat.com/gdb/current/onlinedocs/gdb_14.html#SEC149" rel="noreferrer">エイダセクションの

Only a subset of the attributes are supported:

     * 'First, 'Last, and 'Length on array objects (not on types and subtypes).
     * 'Min and 'Max.
     * 'Pos and 'Val.
     * 'Tag.
     * 'Range on array objects (not subtypes), but only as the right operand of the membership (in) operator.
     * 'Access, 'Unchecked_Access, and 'Unrestricted_Access (a GNAT extension).
     * 'Address.

(私はInteger'Lastを行うことができますので、うーん、そのリストは、それが型に有効ではないことを言って最初の箇条書きにもかかわらず、日付けすることができる。)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top