mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-08 18:37:11 +00:00
[codeview] Dump the type index on the first line of each record
This will make it easier to write FileCheck tests. llvm-svn: 269444
This commit is contained in:
parent
97ae10c67c
commit
bab3fab806
@ -254,10 +254,10 @@ void CVTypeDumperImpl::visitTypeBegin(TypeLeafKind Leaf,
|
||||
// Reset Name to the empty string. If the visitor sets it, we know it.
|
||||
Name = "";
|
||||
|
||||
W.startLine() << getLeafTypeName(Leaf) << " {\n";
|
||||
W.startLine() << getLeafTypeName(Leaf) << " ("
|
||||
<< HexNumber(CVTD.getNextTypeIndex()) << ") {\n";
|
||||
W.indent();
|
||||
W.printEnum("TypeLeafKind", unsigned(Leaf), makeArrayRef(LeafTypeNames));
|
||||
W.printHex("TypeIndex", CVTD.getNextTypeIndex());
|
||||
}
|
||||
|
||||
void CVTypeDumperImpl::visitTypeEnd(TypeLeafKind Leaf,
|
||||
|
@ -72,28 +72,24 @@
|
||||
; We should only the LF_FUNC_ID records that we needed to reference.
|
||||
; OBJ: CodeViewTypes [
|
||||
; OBJ: Section: .debug$T (4)
|
||||
; OBJ: ArgList {
|
||||
; OBJ: ArgList (0x1000) {
|
||||
; OBJ: TypeLeafKind: LF_ARGLIST (0x1201)
|
||||
; OBJ: TypeIndex: 0x1000
|
||||
; OBJ: NumArgs: 0
|
||||
; OBJ: }
|
||||
; OBJ: ProcedureType {
|
||||
; OBJ: ProcedureType (0x1001) {
|
||||
; OBJ: TypeLeafKind: LF_PROCEDURE (0x1008)
|
||||
; OBJ: TypeIndex: 0x1001
|
||||
; OBJ: ReturnType: void (0x3)
|
||||
; OBJ: NumParameters: 0
|
||||
; OBJ: ArgListType: () (0x1000)
|
||||
; OBJ: }
|
||||
; OBJ: FuncId {
|
||||
; OBJ: FuncId (0x1002) {
|
||||
; OBJ: TypeLeafKind: LF_FUNC_ID (0x1601)
|
||||
; OBJ: TypeIndex: 0x1002
|
||||
; OBJ: ParentScope: 0x0
|
||||
; OBJ: FunctionType: void () (0x1001)
|
||||
; OBJ: Name: bar
|
||||
; OBJ: }
|
||||
; OBJ: FuncId {
|
||||
; OBJ: FuncId (0x1003) {
|
||||
; OBJ: TypeLeafKind: LF_FUNC_ID (0x1601)
|
||||
; OBJ: TypeIndex: 0x1003
|
||||
; OBJ: ParentScope: 0x0
|
||||
; OBJ: FunctionType: void () (0x1001)
|
||||
; OBJ: Name: foo
|
||||
|
@ -246,9 +246,8 @@
|
||||
; EMPTY-NEXT: Record count: 75
|
||||
; EMPTY-NEXT: Records [
|
||||
; EMPTY-NEXT: {
|
||||
; EMPTY-NEXT: ArgList {
|
||||
; EMPTY-NEXT: ArgList (0x1000) {
|
||||
; EMPTY-NEXT: TypeLeafKind: LF_ARGLIST (0x1201)
|
||||
; EMPTY-NEXT: TypeIndex: 0x1000
|
||||
; EMPTY-NEXT: NumArgs: 0
|
||||
; EMPTY-NEXT: Arguments [
|
||||
; EMPTY-NEXT: ]
|
||||
@ -258,9 +257,8 @@
|
||||
; EMPTY-NEXT: )
|
||||
; EMPTY-NEXT: }
|
||||
; EMPTY-NEXT: {
|
||||
; EMPTY-NEXT: ProcedureType {
|
||||
; EMPTY-NEXT: ProcedureType (0x1001) {
|
||||
; EMPTY-NEXT: TypeLeafKind: LF_PROCEDURE (0x1008)
|
||||
; EMPTY-NEXT: TypeIndex: 0x1001
|
||||
; EMPTY-NEXT: ReturnType: int (0x74)
|
||||
; EMPTY-NEXT: CallingConvention: NearC (0x0)
|
||||
; EMPTY-NEXT: FunctionOptions [ (0x0)
|
||||
@ -273,9 +271,8 @@
|
||||
; EMPTY-NEXT: )
|
||||
; EMPTY-NEXT: }
|
||||
; EMPTY-NEXT: {
|
||||
; EMPTY-NEXT: UnknownLeaf {
|
||||
; EMPTY-NEXT: UnknownLeaf (0x1002) {
|
||||
; EMPTY-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
|
||||
; EMPTY-NEXT: TypeIndex: 0x1002
|
||||
; EMPTY-NEXT: Enumerator {
|
||||
; EMPTY-NEXT: AccessSpecifier: Public (0x3)
|
||||
; EMPTY-NEXT: EnumValue: 1
|
||||
|
@ -19,18 +19,16 @@
|
||||
|
||||
RUN: llvm-readobj -codeview %p/Inputs/codeview-vftable.obj.coff | FileCheck %s
|
||||
|
||||
CHECK: VFTableType {
|
||||
CHECK: VFTableType (0x10F0) {
|
||||
CHECK-NEXT: TypeLeafKind: LF_VFTABLE (0x151D)
|
||||
CHECK-NEXT: TypeIndex: 0x10F0
|
||||
CHECK-NEXT: CompleteClass: A
|
||||
CHECK-NEXT: OverriddenVFTable: 0x0
|
||||
CHECK-NEXT: VFPtrOffset: 0x0
|
||||
CHECK-NEXT: VFTableName: ??_7A@@6B@
|
||||
CHECK-NEXT: MethodName: ?f@A@@UEAAXXZ
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: VFTableType {
|
||||
CHECK-NEXT: VFTableType (0x10F1) {
|
||||
CHECK-NEXT: TypeLeafKind: LF_VFTABLE (0x151D)
|
||||
CHECK-NEXT: TypeIndex: 0x10F1
|
||||
CHECK-NEXT: CompleteClass: B
|
||||
CHECK-NEXT: OverriddenVFTable: ??_7A@@6B@ (0x10F0)
|
||||
CHECK-NEXT: VFPtrOffset: 0x0
|
||||
@ -38,9 +36,8 @@ CHECK-NEXT: VFTableName: ??_7B@@6B@
|
||||
CHECK-NEXT: MethodName: ?f@B@@UEAAXXZ
|
||||
CHECK-NEXT: MethodName: ?g@B@@UEAAXXZ
|
||||
CHECK-NEXT: }
|
||||
CHECK-NEXT: VFTableType {
|
||||
CHECK-NEXT: VFTableType (0x10F2) {
|
||||
CHECK-NEXT: TypeLeafKind: LF_VFTABLE (0x151D)
|
||||
CHECK-NEXT: TypeIndex: 0x10F2
|
||||
CHECK-NEXT: CompleteClass: C
|
||||
CHECK-NEXT: OverriddenVFTable: ??_7B@@6B@ (0x10F1)
|
||||
CHECK-NEXT: VFPtrOffset: 0x0
|
||||
|
Loading…
x
Reference in New Issue
Block a user