3

GDB内からtype属性を出力する方法はありますか?
例:整数'サイズ。

4

1 に答える 1

9

はい:

(gdb)pthing'属性

一部の属性は認識され、他の属性は認識されません。(以下にリストされているものでは、Foundはブール変数です。)

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

gdbを使用したデバッグのAdaセクションのリストは次のとおりです。

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を実行できたので、そのリストは日付が付けられている可能性があります。)

于 2009-04-14T01:14:36.440 に答える