2009-04-13 6 views
2

GDB 내부에서 유형 속성을 인쇄하는 방법이 있습니까?
예. 정수 크기.GDB에서 유형 속성을 어떻게 인쇄 할 수 있습니까?

+0

gdb 명령 줄에 "print sizeof (int)"를 입력하면 문제가 해결 되었습니까? – dirkgently

+0

질문에 ada라는 태그가 붙어 있기 때문에이 유형 속성을 저에게 알 수없는 ada 특정 것으로 해석합니다. sizeof가 답이라고 생각하지 않습니다. – hlovdal

+0

sizeof()는 C/C++입니다 ... 문제는 분명히 Ada에만 해당됩니다. – paxos1977

답변

8

예 :

(GDB) 페이지 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 

여기 GDB 디버깅의 Ada section의 목록입니다 : 내가 할 수 있기 때문에,

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를 수행합니다.)

관련 문제