2 * dump.c: Dumping routines for the disassembler.
5 * Miguel de Icaza (miguel@ximian.com)
7 * (C) 2001 Ximian, Inc.
19 #include "mono/metadata/loader.h"
20 #include "mono/metadata/class.h"
21 #include "mono/metadata/class-internals.h"
22 #include "mono/utils/mono-compiler.h"
23 #include "mono/utils/mono-error-internals.h"
24 #include "mono/utils/mono-math.h"
27 dump_table_assembly (MonoImage
*m
)
29 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_ASSEMBLY
];
30 guint32 cols
[MONO_ASSEMBLY_SIZE
];
34 fprintf (output
, "Assembly Table\n");
39 mono_metadata_decode_row (t
, 0, cols
, MONO_ASSEMBLY_SIZE
);
41 fprintf (output
, "Name: %s\n", mono_metadata_string_heap (m
, cols
[MONO_ASSEMBLY_NAME
]));
42 fprintf (output
, "Hash Algoritm: 0x%08x\n", cols
[MONO_ASSEMBLY_HASH_ALG
]);
43 fprintf (output
, "Version: %d.%d.%d.%d\n", cols
[MONO_ASSEMBLY_MAJOR_VERSION
],
44 cols
[MONO_ASSEMBLY_MINOR_VERSION
],
45 cols
[MONO_ASSEMBLY_BUILD_NUMBER
],
46 cols
[MONO_ASSEMBLY_REV_NUMBER
]);
47 fprintf (output
, "Flags: 0x%08x\n", cols
[MONO_ASSEMBLY_FLAGS
]);
48 fprintf (output
, "PublicKey: BlobPtr (0x%08x)\n", cols
[MONO_ASSEMBLY_PUBLIC_KEY
]);
50 ptr
= mono_metadata_blob_heap (m
, cols
[MONO_ASSEMBLY_PUBLIC_KEY
]);
51 len
= mono_metadata_decode_value (ptr
, &ptr
);
53 fprintf (output
, "\tDump:");
54 hex_dump (ptr
, 0, len
);
55 fprintf (output
, "\n");
57 fprintf (output
, "\tZero sized public key\n");
59 fprintf (output
, "Culture: %s\n", mono_metadata_string_heap (m
, cols
[MONO_ASSEMBLY_CULTURE
]));
60 fprintf (output
, "\n");
64 dump_table_typeref (MonoImage
*m
)
66 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_TYPEREF
];
69 fprintf (output
, "Typeref Table\n");
71 for (i
= 1; i
<= t
->rows
; i
++){
72 char *s
= get_typeref (m
, i
);
74 fprintf (output
, "%d: %s\n", i
, s
);
77 fprintf (output
, "\n");
81 dump_table_typedef (MonoImage
*m
)
83 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_TYPEDEF
];
86 fprintf (output
, "Typedef Table\n");
88 for (i
= 1; i
<= t
->rows
; i
++){
89 char *s
= get_typedef (m
, i
);
90 guint32 cols
[MONO_TYPEDEF_SIZE
];
92 mono_metadata_decode_row (&m
->tables
[MONO_TABLE_TYPEDEF
], i
- 1, cols
, MONO_TYPEDEF_SIZE
);
94 fprintf (output
, "%d: %s (flist=%d, mlist=%d, flags=0x%x, extends=0x%x)\n", i
, s
,
95 cols
[MONO_TYPEDEF_FIELD_LIST
], cols
[MONO_TYPEDEF_METHOD_LIST
],
96 cols
[MONO_TYPEDEF_FLAGS
], cols
[MONO_TYPEDEF_EXTENDS
]);
99 fprintf (output
, "\n");
103 dump_table_typespec (MonoImage
*m
)
105 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_TYPESPEC
];
108 fprintf (output
, "Typespec Table\n");
110 for (i
= 1; i
<= t
->rows
; i
++){
111 char *typespec
= get_typespec (m
, i
, TRUE
, NULL
);
113 fprintf (output
, "%d: %s\n", i
, typespec
);
116 fprintf (output
, "\n");
120 dump_table_assemblyref (MonoImage
*m
)
122 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_ASSEMBLYREF
];
125 fprintf (output
, "AssemblyRef Table\n");
127 for (i
= 0; i
< t
->rows
; i
++){
130 guint32 cols
[MONO_ASSEMBLYREF_SIZE
];
132 mono_metadata_decode_row (t
, i
, cols
, MONO_ASSEMBLYREF_SIZE
);
133 fprintf (output
, "%d: Version=%d.%d.%d.%d\n\tName=%s\n", i
+ 1,
134 cols
[MONO_ASSEMBLYREF_MAJOR_VERSION
],
135 cols
[MONO_ASSEMBLYREF_MINOR_VERSION
],
136 cols
[MONO_ASSEMBLYREF_BUILD_NUMBER
],
137 cols
[MONO_ASSEMBLYREF_REV_NUMBER
],
138 mono_metadata_string_heap (m
, cols
[MONO_ASSEMBLYREF_NAME
]));
139 fprintf (output
, "\tFlags=0x%08x\n", cols
[MONO_ASSEMBLYREF_FLAGS
]);
140 ptr
= mono_metadata_blob_heap (m
, cols
[MONO_ASSEMBLYREF_PUBLIC_KEY
]);
141 len
= mono_metadata_decode_value (ptr
, &ptr
);
143 fprintf (output
, "\tPublic Key:");
144 hex_dump (ptr
, 0, len
);
145 fprintf (output
, "\n");
147 fprintf (output
, "\tZero sized public key\n");
150 fprintf (output
, "\n");
154 dump_table_param (MonoImage
*m
)
156 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_PARAM
];
159 fprintf (output
, "Param Table\n");
161 for (i
= 0; i
< t
->rows
; i
++){
162 guint32 cols
[MONO_PARAM_SIZE
];
164 mono_metadata_decode_row (t
, i
, cols
, MONO_PARAM_SIZE
);
165 fprintf (output
, "%d: 0x%04x %d %s\n",
167 cols
[MONO_PARAM_FLAGS
], cols
[MONO_PARAM_SEQUENCE
],
168 mono_metadata_string_heap (m
, cols
[MONO_PARAM_NAME
]));
170 fprintf (output
, "\n");
174 dump_table_field (MonoImage
*m
)
176 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_FIELD
];
177 MonoTableInfo
*td
= &m
->tables
[MONO_TABLE_TYPEDEF
];
178 MonoTableInfo
*fl
= &m
->tables
[MONO_TABLE_FIELDLAYOUT
];
179 MonoTableInfo
*rva
= &m
->tables
[MONO_TABLE_FIELDRVA
];
180 int i
, current_type
, offset_row
, rva_row
;
181 guint32 first_m
, last_m
;
183 fprintf (output
, "Field Table (1..%d)\n", t
->rows
);
185 rva_row
= offset_row
= current_type
= 1;
186 last_m
= first_m
= 1;
187 for (i
= 1; i
<= t
->rows
; i
++){
188 guint32 cols
[MONO_FIELD_SIZE
];
192 * Find the next type.
194 while (current_type
<= td
->rows
&& i
>= (last_m
= mono_metadata_decode_row_col (td
, current_type
- 1, MONO_TYPEDEF_FIELD_LIST
))) {
198 fprintf (output
, "########## %s.%s\n",
199 mono_metadata_string_heap (m
, mono_metadata_decode_row_col (td
, current_type
- 2, MONO_TYPEDEF_NAMESPACE
)),
200 mono_metadata_string_heap (m
, mono_metadata_decode_row_col (td
, current_type
- 2, MONO_TYPEDEF_NAME
)));
203 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_FIELD_SIZE
);
204 sig
= get_field_signature (m
, cols
[MONO_FIELD_SIGNATURE
], NULL
);
205 flags
= field_flags (cols
[MONO_FIELD_FLAGS
]);
206 fprintf (output
, "%d: %s %s: %s\n",
209 mono_metadata_string_heap (m
, cols
[MONO_FIELD_NAME
]),
213 if (offset_row
<= fl
->rows
&& (mono_metadata_decode_row_col (fl
, offset_row
- 1, MONO_FIELD_LAYOUT_FIELD
) == i
)) {
214 fprintf (output
, "\texplicit offset: %d\n", mono_metadata_decode_row_col (fl
, offset_row
- 1, MONO_FIELD_LAYOUT_OFFSET
));
217 if (rva_row
<= rva
->rows
&& (mono_metadata_decode_row_col (rva
, rva_row
- 1, MONO_FIELD_RVA_FIELD
) == i
)) {
218 fprintf (output
, "\trva: %d\n", mono_metadata_decode_row_col (rva
, rva_row
- 1, MONO_FIELD_RVA_RVA
));
222 fprintf (output
, "\n");
226 dump_table_memberref (MonoImage
*m
)
228 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_MEMBERREF
];
232 const char *blob
, *ks
= NULL
;
234 fprintf (output
, "MemberRef Table (1..%d)\n", t
->rows
);
236 for (i
= 0; i
< t
->rows
; i
++){
237 guint32 cols
[MONO_MEMBERREF_SIZE
];
239 mono_metadata_decode_row (t
, i
, cols
, MONO_MEMBERREF_SIZE
);
241 kind
= cols
[MONO_MEMBERREF_CLASS
] & 7;
242 idx
= cols
[MONO_MEMBERREF_CLASS
] >> 3;
244 x
= g_strdup ("UNHANDLED CASE");
249 xx
= get_typedef (m
, idx
);
250 x
= g_strconcat (xx
, ".", mono_metadata_string_heap (m
, cols
[MONO_MEMBERREF_NAME
]), NULL
);
255 xx
= get_typeref (m
, idx
);
256 x
= g_strconcat (xx
, ".", mono_metadata_string_heap (m
, cols
[MONO_MEMBERREF_NAME
]), NULL
);
260 ks
= "ModuleRef"; break;
263 x
= get_methoddef (m
, idx
);
267 xx
= get_typespec (m
, idx
, FALSE
, NULL
);
268 x
= g_strconcat (xx
, ".", mono_metadata_string_heap (m
, cols
[MONO_MEMBERREF_NAME
]), NULL
);
272 g_error ("Unknown tag: %d\n", kind
);
274 blob
= mono_metadata_blob_heap (m
, cols
[MONO_MEMBERREF_SIGNATURE
]);
275 mono_metadata_decode_blob_size (blob
, &blob
);
276 if (*blob
== 0x6) { /* it's a field */
277 sig
= get_field_signature (m
, cols
[MONO_MEMBERREF_SIGNATURE
], NULL
);
279 sig
= get_methodref_signature (m
, cols
[MONO_MEMBERREF_SIGNATURE
], NULL
);
281 fprintf (output
, "%d: %s[%d] %s\n\tResolved: %s\n\tSignature: %s\n\t\n",
284 mono_metadata_string_heap (m
, cols
[MONO_MEMBERREF_NAME
]),
294 dump_table_class_layout (MonoImage
*m
)
296 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_CLASSLAYOUT
];
298 fprintf (output
, "ClassLayout Table (1..%d)\n", t
->rows
);
300 for (i
= 0; i
< t
->rows
; i
++){
301 guint32 cols
[MONO_CLASS_LAYOUT_SIZE
];
303 mono_metadata_decode_row (t
, i
, cols
, MONO_CLASS_LAYOUT_SIZE
);
305 fprintf (output
, "%d: PackingSize=%d ClassSize=%d Parent=%s\n",
306 i
+ 1, cols
[MONO_CLASS_LAYOUT_PACKING_SIZE
],
307 cols
[MONO_CLASS_LAYOUT_CLASS_SIZE
],
308 get_typedef (m
, cols
[MONO_CLASS_LAYOUT_PARENT
]));
313 dump_table_constant (MonoImage
*m
)
315 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_CONSTANT
];
317 const char *desc
[] = {
323 fprintf (output
, "Constant Table (1..%d)\n", t
->rows
);
325 for (i
= 0; i
< t
->rows
; i
++){
326 guint32 cols
[MONO_CONSTANT_SIZE
];
328 mono_metadata_decode_row (t
, i
, cols
, MONO_CONSTANT_SIZE
);
329 parent
= desc
[cols
[MONO_CONSTANT_PARENT
] & MONO_HASCONSTANT_MASK
];
331 fprintf (output
, "%d: Parent= %s: %d %s\n",
332 i
+ 1, parent
, cols
[MONO_CONSTANT_PARENT
] >> MONO_HASCONSTANT_BITS
,
333 get_constant (m
, (MonoTypeEnum
) cols
[MONO_CONSTANT_TYPE
], cols
[MONO_CONSTANT_VALUE
]));
339 dump_table_property_map (MonoImage
*m
)
341 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_PROPERTYMAP
];
345 fprintf (output
, "Property Map Table (1..%d)\n", t
->rows
);
347 for (i
= 0; i
< t
->rows
; i
++){
348 guint32 cols
[MONO_PROPERTY_MAP_SIZE
];
350 mono_metadata_decode_row (t
, i
, cols
, MONO_PROPERTY_MAP_SIZE
);
351 s
= get_typedef (m
, cols
[MONO_PROPERTY_MAP_PARENT
]);
352 fprintf (output
, "%d: %s (%d) %d\n", i
+ 1, s
, cols
[MONO_PROPERTY_MAP_PARENT
], cols
[MONO_PROPERTY_MAP_PROPERTY_LIST
]);
358 dump_table_property (MonoImage
*m
)
360 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_PROPERTY
];
365 fprintf (output
, "Property Table (1..%d)\n", t
->rows
);
367 for (i
= 0; i
< t
->rows
; i
++){
368 guint32 cols
[MONO_PROPERTY_SIZE
];
372 mono_metadata_decode_row (t
, i
, cols
, MONO_PROPERTY_SIZE
);
374 prop_flags
= cols
[MONO_PROPERTY_FLAGS
];
375 if (prop_flags
& 0x0200)
376 strcat (flags
, "special ");
377 if (prop_flags
& 0x0400)
378 strcat (flags
, "runtime ");
379 if (prop_flags
& 0x1000)
380 strcat (flags
, "hasdefault ");
382 ptr
= mono_metadata_blob_heap (m
, cols
[MONO_PROPERTY_TYPE
]);
383 /* bsize = */ mono_metadata_decode_blob_size (ptr
, &ptr
);
384 /* ECMA claims 0x08 ... */
385 if (*ptr
!= 0x28 && *ptr
!= 0x08)
386 g_warning("incorrect signature in propert blob: 0x%x", *ptr
);
388 pcount
= mono_metadata_decode_value (ptr
, &ptr
);
389 ptr
= get_type (m
, ptr
, &type
, FALSE
, NULL
);
390 fprintf (output
, "%d: %s %s (",
391 i
+ 1, type
, mono_metadata_string_heap (m
, cols
[MONO_PROPERTY_NAME
]));
394 for (j
= 0; j
< pcount
; j
++){
395 ptr
= get_param (m
, ptr
, &type
, NULL
);
396 fprintf (output
, "%s%s", j
> 0? ", " : "",type
);
399 fprintf (output
, ") %s\n", flags
);
404 dump_table_event (MonoImage
*m
)
406 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_EVENT
];
408 fprintf (output
, "Event Table (1..%d)\n", t
->rows
);
410 for (i
= 0; i
< t
->rows
; i
++){
411 guint32 cols
[MONO_EVENT_SIZE
];
415 mono_metadata_decode_row (t
, i
, cols
, MONO_EVENT_SIZE
);
417 name
= mono_metadata_string_heap (m
, cols
[MONO_EVENT_NAME
]);
418 type
= get_typedef_or_ref (m
, cols
[MONO_EVENT_TYPE
], NULL
);
419 fprintf (output
, "%d: %s %s %s\n", i
+ 1, type
, name
,
420 cols
[MONO_EVENT_FLAGS
] & 0x200 ? "specialname " : "");
427 dump_table_file (MonoImage
*m
)
429 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_FILE
];
431 fprintf (output
, "File Table (1..%d)\n", t
->rows
);
433 for (i
= 0; i
< t
->rows
; i
++){
434 guint32 cols
[MONO_FILE_SIZE
];
435 const char *name
, *hash
;
437 mono_metadata_decode_row (t
, i
, cols
, MONO_FILE_SIZE
);
439 name
= mono_metadata_string_heap (m
, cols
[MONO_FILE_NAME
]);
440 fprintf (output
, "%d: %s %s [", i
+ 1, name
,
441 cols
[MONO_FILE_FLAGS
] & 0x1 ? "nometadata" : "containsmetadata");
442 hash
= mono_metadata_blob_heap (m
, cols
[MONO_FILE_HASH_VALUE
]);
443 len
= mono_metadata_decode_blob_size (hash
, &hash
);
444 for (j
= 0; j
< len
; ++j
)
445 fprintf (output
, "%s%02X", j
? " ": "", hash
[j
] & 0xff);
446 fprintf (output
, "]\n");
452 get_manifest_implementation (MonoImage
*m
, guint32 idx
)
455 const char* table
= "";
457 return g_strdup ("current module");
458 row
= idx
>> MONO_IMPLEMENTATION_BITS
;
459 switch (idx
& MONO_IMPLEMENTATION_MASK
) {
460 case MONO_IMPLEMENTATION_FILE
:
463 case MONO_IMPLEMENTATION_ASSEMBLYREF
:
464 table
= "assemblyref";
466 case MONO_IMPLEMENTATION_EXP_TYPE
:
467 table
= "exportedtype";
470 g_assert_not_reached ();
472 return g_strdup_printf ("%s %d", table
, row
);
476 get_manifest_flags (guint32 mf
)
480 case 1: return "public";
481 case 2: return "private";
488 dump_table_manifest (MonoImage
*m
)
490 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_MANIFESTRESOURCE
];
492 fprintf (output
, "Manifestresource Table (1..%d)\n", t
->rows
);
494 for (i
= 0; i
< t
->rows
; i
++){
495 guint32 cols
[MONO_MANIFEST_SIZE
];
496 const char *name
, *mf
;
499 mono_metadata_decode_row (t
, i
, cols
, MONO_MANIFEST_SIZE
);
501 name
= mono_metadata_string_heap (m
, cols
[MONO_MANIFEST_NAME
]);
502 mf
= get_manifest_flags (cols
[MONO_MANIFEST_FLAGS
]);
503 impl
= get_manifest_implementation (m
, cols
[MONO_MANIFEST_IMPLEMENTATION
]);
504 fprintf (output
, "%d: %s '%s' at offset %u in %s\n", i
+ 1, mf
, name
, cols
[MONO_MANIFEST_OFFSET
], impl
);
511 dump_table_moduleref (MonoImage
*m
)
513 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_MODULEREF
];
515 fprintf (output
, "ModuleRef Table (1..%d)\n", t
->rows
);
517 for (i
= 0; i
< t
->rows
; i
++){
518 guint32 cols
[MONO_MODULEREF_SIZE
];
521 mono_metadata_decode_row (t
, i
, cols
, MONO_MODULEREF_SIZE
);
523 name
= mono_metadata_string_heap (m
, cols
[MONO_MODULEREF_NAME
]);
524 fprintf (output
, "%d: %s\n", i
+ 1, name
);
530 dump_table_module (MonoImage
*m
)
532 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_MODULE
];
534 fprintf (output
, "Module Table (1..%d)\n", t
->rows
);
536 for (i
= 0; i
< t
->rows
; i
++){
537 guint32 cols
[MONO_MODULE_SIZE
];
541 mono_metadata_decode_row (t
, i
, cols
, MONO_MODULE_SIZE
);
543 name
= mono_metadata_string_heap (m
, cols
[MONO_MODULE_NAME
]);
544 guid
= get_guid (m
, cols
[MONO_MODULE_MVID
]);
545 fprintf (output
, "%d: %s %d %s\n", i
+ 1, name
, cols
[MONO_MODULE_MVID
], guid
);
550 dump_table_method (MonoImage
*m
)
552 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_METHOD
];
553 MonoTableInfo
*td
= &m
->tables
[MONO_TABLE_TYPEDEF
];
555 guint32 first_m
, last_m
;
556 /* Generic container for Type & method */
557 MonoGenericContainer
*type_container
= NULL
, *method_container
= NULL
;
559 fprintf (output
, "Method Table (1..%d)\n", t
->rows
);
562 last_m
= first_m
= 1;
563 for (i
= 1; i
<= t
->rows
; i
++){
565 guint32 cols
[MONO_METHOD_SIZE
];
566 char *sig
, *impl_flags
;
568 MonoMethodSignature
*method
;
571 * Find the next type.
573 while (current_type
<= td
->rows
&& i
>= (last_m
= mono_metadata_decode_row_col (td
, current_type
- 1, MONO_TYPEDEF_METHOD_LIST
))) {
577 fprintf (output
, "########## %s.%s\n",
578 mono_metadata_string_heap (m
, mono_metadata_decode_row_col (td
, current_type
- 2, MONO_TYPEDEF_NAMESPACE
)),
579 mono_metadata_string_heap (m
, mono_metadata_decode_row_col (td
, current_type
- 2, MONO_TYPEDEF_NAME
)));
581 type_container
= mono_metadata_load_generic_params (m
, MONO_TOKEN_TYPE_DEF
| (current_type
- 1), NULL
, NULL
);
582 if (type_container
) {
583 mono_metadata_load_generic_param_constraints_checked (m
, MONO_TOKEN_TYPE_DEF
| (current_type
- 1), type_container
, error
);
584 g_assert (mono_error_ok (error
)); /*FIXME don't swallow the error message*/
588 method_container
= mono_metadata_load_generic_params (m
, MONO_TOKEN_METHOD_DEF
| i
, type_container
, NULL
);
589 if (method_container
) {
590 mono_metadata_load_generic_param_constraints_checked (m
, MONO_TOKEN_METHOD_DEF
| i
, method_container
, error
);
591 g_assert (mono_error_ok (error
)); /*FIXME don't swallow the error message*/
593 mono_metadata_decode_table_row (m
, MONO_TABLE_METHOD
, i
- 1, cols
, MONO_METHOD_SIZE
);
594 sigblob
= mono_metadata_blob_heap (m
, cols
[MONO_METHOD_SIGNATURE
]);
595 mono_metadata_decode_blob_size (sigblob
, &sigblob
);
596 method
= mono_metadata_parse_method_signature_full (m
, method_container
? method_container
: type_container
, i
, sigblob
, &sigblob
, error
);
597 if (!mono_error_ok (error
)) {
598 fprintf (output
,"%d: failed to parse due to %s\n", i
, mono_error_get_message (error
));
599 mono_error_cleanup (error
);
603 g_assert (mono_error_ok (error
)); /*FIXME don't swallow the error message*/
604 sig
= dis_stringify_method_signature (m
, method
, i
, method_container
? method_container
: type_container
, FALSE
);
605 impl_flags
= get_method_impl_flags (cols
[MONO_METHOD_IMPLFLAGS
]);
606 fprintf (output
, "%d: %s (param: %d impl_flags: %s)\n", i
, sig
, cols
[MONO_METHOD_PARAMLIST
], impl_flags
);
609 mono_metadata_free_method_signature (method
);
615 dump_table_implmap (MonoImage
*m
)
617 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_IMPLMAP
];
618 MonoTableInfo
*td
= &m
->tables
[MONO_TABLE_MODULEREF
];
621 fprintf (output
, "ImplMap Table (1..%d)\n", t
->rows
);
623 for (i
= 1; i
<= t
->rows
; i
++){
624 guint32 cols
[MONO_IMPLMAP_SIZE
];
627 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_IMPLMAP_SIZE
);
629 method
= get_method (m
, MONO_TOKEN_METHOD_DEF
| (cols
[MONO_IMPLMAP_MEMBER
] >> MONO_MEMBERFORWD_BITS
), NULL
);
631 fprintf (output
, "%d: %s %d (%s %s)\n", i
,
633 cols
[MONO_IMPLMAP_FLAGS
],
634 mono_metadata_string_heap (m
, cols
[MONO_IMPLMAP_NAME
]),
635 mono_metadata_string_heap (m
, mono_metadata_decode_row_col (td
, cols
[MONO_IMPLMAP_SCOPE
] - 1, MONO_MODULEREF_NAME
)));
640 dump_table_fieldrva (MonoImage
*m
)
642 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_FIELDRVA
];
645 fprintf (output
, "FieldRVA Table (1..%d)\n", t
->rows
);
647 for (i
= 1; i
<= t
->rows
; i
++){
648 guint32 cols
[MONO_FIELD_RVA_SIZE
];
650 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_FIELD_RVA_SIZE
);
651 fprintf (output
, "%d: Field %d: %x\n", i
, cols
[MONO_FIELD_RVA_FIELD
], cols
[MONO_FIELD_RVA_RVA
]);
656 dump_table_methodimpl (MonoImage
*m
)
658 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_METHODIMPL
];
659 /*MonoTableInfo *td = &m->tables [MONO_TABLE_TYPEDEF];*/
662 fprintf (output
, "MethodImpl Table (1..%d)\n", t
->rows
);
664 for (i
= 1; i
<= t
->rows
; i
++){
665 guint32 cols
[MONO_METHODIMPL_SIZE
];
666 char *klass
, *impl
, *decl
;
668 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_METHODIMPL_SIZE
);
669 klass
= get_typedef (m
, cols
[MONO_METHODIMPL_CLASS
]);
670 impl
= get_method (m
, method_dor_to_token (cols
[MONO_METHODIMPL_BODY
]), NULL
);
671 decl
= get_method (m
, method_dor_to_token (cols
[MONO_METHODIMPL_DECLARATION
]), NULL
);
672 fprintf (output
, "%d: %s\n\tdecl: %s\n\timpl: %s\n", i
, klass
, decl
, impl
);
680 static dis_map_t semantics_map
[] = {
691 dump_table_methodsem (MonoImage
*m
)
693 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_METHODSEMANTICS
];
694 int i
, is_property
, index
;
695 const char *semantics
;
697 fprintf (output
, "Method Semantics Table (1..%d)\n", t
->rows
);
698 for (i
= 1; i
<= t
->rows
; i
++){
699 guint32 cols
[MONO_METHOD_SEMA_SIZE
];
701 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_METHOD_SEMA_SIZE
);
702 semantics
= flags (cols
[MONO_METHOD_SEMA_SEMANTICS
], semantics_map
);
703 is_property
= cols
[MONO_METHOD_SEMA_ASSOCIATION
] & MONO_HAS_SEMANTICS_MASK
;
704 index
= cols
[MONO_METHOD_SEMA_ASSOCIATION
] >> MONO_HAS_SEMANTICS_BITS
;
705 fprintf (output
, "%d: [%d] %s method: %d %s %d\n", i
, cols
[MONO_METHOD_SEMA_ASSOCIATION
], semantics
,
706 cols
[MONO_METHOD_SEMA_METHOD
] - 1,
707 is_property
? "property" : "event",
713 dump_table_interfaceimpl (MonoImage
*m
)
715 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_INTERFACEIMPL
];
718 fprintf (output
, "Interface Implementation Table (1..%d)\n", t
->rows
);
719 for (i
= 1; i
<= t
->rows
; i
++) {
720 guint32 cols
[MONO_INTERFACEIMPL_SIZE
];
722 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_INTERFACEIMPL_SIZE
);
723 fprintf (output
, "%d: %s implements %s\n", i
,
724 get_typedef (m
, cols
[MONO_INTERFACEIMPL_CLASS
]),
725 get_typedef_or_ref (m
, cols
[MONO_INTERFACEIMPL_INTERFACE
], NULL
));
730 has_cattr_get_table (MonoImage
*m
, guint32 val
)
732 guint32 t
= val
& MONO_CUSTOM_ATTR_MASK
;
733 guint32 index
= val
>> MONO_CUSTOM_ATTR_BITS
;
737 case MONO_CUSTOM_ATTR_METHODDEF
:
740 case MONO_CUSTOM_ATTR_FIELDDEF
:
743 case MONO_CUSTOM_ATTR_TYPEREF
:
746 case MONO_CUSTOM_ATTR_TYPEDEF
:
749 case MONO_CUSTOM_ATTR_PARAMDEF
:
752 case MONO_CUSTOM_ATTR_INTERFACE
:
753 table
= "InterfaceImpl";
755 case MONO_CUSTOM_ATTR_MEMBERREF
:
758 case MONO_CUSTOM_ATTR_MODULE
:
761 case MONO_CUSTOM_ATTR_PERMISSION
:
762 table
= "DeclSecurity?";
764 case MONO_CUSTOM_ATTR_PROPERTY
:
767 case MONO_CUSTOM_ATTR_EVENT
:
770 case MONO_CUSTOM_ATTR_SIGNATURE
:
771 table
= "StandAloneSignature";
773 case MONO_CUSTOM_ATTR_MODULEREF
:
776 case MONO_CUSTOM_ATTR_TYPESPEC
:
779 case MONO_CUSTOM_ATTR_ASSEMBLY
:
782 case MONO_CUSTOM_ATTR_ASSEMBLYREF
:
783 table
= "AssemblyRef";
785 case MONO_CUSTOM_ATTR_FILE
:
788 case MONO_CUSTOM_ATTR_EXP_TYPE
:
789 table
= "ExportedType";
791 case MONO_CUSTOM_ATTR_MANIFEST
:
794 case MONO_CUSTOM_ATTR_GENERICPAR
:
795 table
= "GenericParam";
802 * FIXME: we should decode the index into something more uman-friendly.
804 return g_strdup_printf ("%s: %d", table
, index
);
808 custom_attr_params (MonoImage
*m
, MonoMethodSignature
* sig
, const char* value
)
810 int len
, i
, slen
, type
;
813 const char *p
= value
;
815 len
= mono_metadata_decode_value (p
, &p
);
816 if (len
< 2 || read16 (p
) != 0x0001) /* Prolog */
817 return g_strdup ("");
821 res
= g_string_new ("");
822 for (i
= 0; i
< sig
->param_count
; ++i
) {
824 g_string_append (res
, ", ");
825 type
= sig
->params
[i
]->type
;
829 g_string_append_printf (res
, "%d", (unsigned int)*p
);
833 g_string_append_printf (res
, "%d", *p
);
836 case MONO_TYPE_BOOLEAN
:
837 g_string_append_printf (res
, "%s", *p
?"true":"false");
841 g_string_append_printf (res
, "'%c'", read16 (p
));
845 g_string_append_printf (res
, "%d", read16 (p
));
849 g_string_append_printf (res
, "%d", (gint16
)read16 (p
));
853 g_string_append_printf (res
, "%d", read32 (p
));
857 g_string_append_printf (res
, "%d", (gint32
)read32 (p
));
861 g_string_append_printf (res
, "%lld", (long long)read64 (p
));
865 g_string_append_printf (res
, "%lld", (long long)read64 (p
));
871 const int inf
= mono_isinf (val
);
873 g_string_append_printf (res
, "(00 00 80 ff)"); /* negative infinity */
875 g_string_append_printf (res
, "(00 00 80 7f)"); /* positive infinity */
876 else if (mono_isnan (val
))
877 g_string_append_printf (res
, "(00 00 c0 ff)"); /* NaN */
879 g_string_append_printf (res
, "%g", val
);
886 const int inf
= mono_isinf (val
);
888 g_string_append_printf (res
, "(00 00 00 00 00 00 f0 ff)"); /* negative infinity */
890 g_string_append_printf (res
, "(00 00 00 00 00 00 f0 7f)"); /* positive infinity */
891 else if (mono_isnan (val
))
892 g_string_append_printf (res
, "(00 00 00 00 00 00 f8 ff)"); /* NaN */
894 g_string_append_printf (res
, "%g", val
);
898 case MONO_TYPE_VALUETYPE
:
899 if (m_class_is_enumtype (sig
->params
[i
]->data
.klass
)) {
900 type
= mono_class_enum_basetype_internal (sig
->params
[i
]->data
.klass
)->type
;
903 g_warning ("generic valutype not handled in custom attr value decoding");
906 case MONO_TYPE_CLASS
: /* It must be a Type: check? */
907 case MONO_TYPE_STRING
:
908 if (*p
== (char)0xff) {
909 g_string_append (res
, "null");
913 slen
= mono_metadata_decode_value (p
, &p
);
914 g_string_append_c (res
, '"');
915 g_string_append (res
, p
);
916 g_string_append_c (res
, '"');
920 g_warning ("Type %02x not handled in custom attr value decoding", sig
->params
[i
]->type
);
926 g_string_append_printf (res
, " %d named args: (", slen
);
927 slen
= len
- (p
- value
) + 1;
928 for (i
= 0; i
< slen
; ++i
) {
929 g_string_append_printf (res
, " %02X", (p
[i
] & 0xff));
931 g_string_append_c (res
, ')');
934 g_string_free (res
, FALSE
);
939 dump_table_customattr (MonoImage
*m
)
941 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_CUSTOMATTRIBUTE
];
944 fprintf (output
, "Custom Attributes Table (1..%d)\n", t
->rows
);
945 for (i
= 1; i
<= t
->rows
; i
++) {
947 guint32 cols
[MONO_CUSTOM_ATTR_SIZE
];
954 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_CUSTOM_ATTR_SIZE
);
955 desc
= has_cattr_get_table (m
, cols
[MONO_CUSTOM_ATTR_PARENT
]);
956 mtoken
= cols
[MONO_CUSTOM_ATTR_TYPE
] >> MONO_CUSTOM_ATTR_TYPE_BITS
;
957 switch (cols
[MONO_CUSTOM_ATTR_TYPE
] & MONO_CUSTOM_ATTR_TYPE_MASK
) {
958 case MONO_CUSTOM_ATTR_TYPE_METHODDEF
:
959 mtoken
|= MONO_TOKEN_METHOD_DEF
;
961 case MONO_CUSTOM_ATTR_TYPE_MEMBERREF
:
962 mtoken
|= MONO_TOKEN_MEMBER_REF
;
965 g_warning ("Unknown table for custom attr type %08x", cols
[MONO_CUSTOM_ATTR_TYPE
]);
968 method
= get_method (m
, mtoken
, NULL
);
969 meth
= mono_get_method_checked (m
, mtoken
, NULL
, NULL
, error
);
971 params
= custom_attr_params (m
, mono_method_signature_internal (meth
), mono_metadata_blob_heap (m
, cols
[MONO_CUSTOM_ATTR_VALUE
]));
972 fprintf (output
, "%d: %s: %s [%s]\n", i
, desc
, method
, params
);
975 fprintf (output
, "Could not decode method due to %s", mono_error_get_message (error
));
976 mono_error_cleanup (error
);
985 dump_table_nestedclass (MonoImage
*m
)
987 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_NESTEDCLASS
];
988 guint32 cols
[MONO_NESTED_CLASS_SIZE
];
990 char *nested
, *nesting
;
991 fprintf (output
, "NestedClass Table (1..%d)\n", t
->rows
);
993 for (i
= 1; i
<= t
->rows
; i
++){
994 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_NESTED_CLASS_SIZE
);
995 nested
= get_typedef (m
, cols
[MONO_NESTED_CLASS_NESTED
]);
996 nesting
= get_typedef (m
, cols
[MONO_NESTED_CLASS_ENCLOSING
]);
997 fprintf (output
, "%d: %d %d: %s in %s\n", i
,
998 cols
[MONO_NESTED_CLASS_NESTED
],
999 cols
[MONO_NESTED_CLASS_ENCLOSING
], nested
, nesting
);
1007 dump_table_exported (MonoImage
*m
)
1009 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_EXPORTEDTYPE
];
1010 guint32 cols
[MONO_EXP_TYPE_SIZE
];
1012 const char *name
, *nspace
;
1014 guint32 index
, flags
;
1015 fprintf (output
, "ExportedType Table (1..%d)\n", t
->rows
);
1017 for (i
= 1; i
<= t
->rows
; i
++) {
1018 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_EXP_TYPE_SIZE
);
1019 name
= mono_metadata_string_heap (m
, cols
[MONO_EXP_TYPE_NAME
]);
1020 nspace
= mono_metadata_string_heap (m
, cols
[MONO_EXP_TYPE_NAMESPACE
]);
1021 impl
= get_manifest_implementation (m
, cols
[MONO_EXP_TYPE_IMPLEMENTATION
]);
1022 index
= cols
[MONO_EXP_TYPE_TYPEDEF
];
1023 flags
= cols
[MONO_EXP_TYPE_FLAGS
];
1024 fprintf (output
, "%d: %s%s%s is in %s, index=%x, flags=0x%x\n", i
, nspace
, *nspace
? "." : "", name
, impl
, index
, flags
);
1031 dump_blob (MonoImage
*m
, const char* blob
)
1035 bsize
= mono_metadata_decode_blob_size (blob
, &blob
);
1037 for (j
= 0; j
< bsize
; j
++) {
1038 fprintf (output
, "%02x ", blob
[j
] & 0xff);
1043 dump_table_field_marshal (MonoImage
*m
)
1045 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_FIELDMARSHAL
];
1046 guint32 cols
[MONO_FIELD_MARSHAL_SIZE
];
1047 int i
, is_field
, idx
;
1051 fprintf (output
, "FieldMarshal Table (1..%d)\n", t
->rows
);
1053 for (i
= 1; i
<= t
->rows
; i
++) {
1054 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_FIELD_MARSHAL_SIZE
);
1055 blob
= mono_metadata_blob_heap (m
, cols
[MONO_FIELD_MARSHAL_NATIVE_TYPE
]);
1056 native
= get_marshal_info (m
, blob
);
1057 is_field
= (cols
[MONO_FIELD_MARSHAL_PARENT
] & MONO_HAS_FIELD_MARSHAL_MASK
) == MONO_HAS_FIELD_MARSHAL_FIELDSREF
;
1058 idx
= cols
[MONO_FIELD_MARSHAL_PARENT
] >> MONO_HAS_FIELD_MARSHAL_BITS
;
1059 fprintf (output
, "%d: (0x%04x) %s %d: %s\n", i
, cols
[MONO_FIELD_MARSHAL_PARENT
], is_field
? "Field" : "Param", idx
, native
);
1060 fprintf (output
, "\tblob encoding: ");
1061 dump_blob (m
, blob
);
1062 fprintf (output
, "\n");
1069 get_security_action (int val
) {
1070 static char buf
[32];
1073 case SECURITY_ACTION_DEMAND
:
1075 case SECURITY_ACTION_ASSERT
:
1077 case SECURITY_ACTION_DENY
:
1079 case SECURITY_ACTION_PERMITONLY
:
1080 return "PermitOnly";
1081 case SECURITY_ACTION_LINKDEMAND
:
1082 return "LinkDemand";
1083 case SECURITY_ACTION_INHERITDEMAND
:
1084 return "InheritanceDemand";
1085 case SECURITY_ACTION_REQMIN
:
1086 return "RequestMinimum";
1087 case SECURITY_ACTION_REQOPT
:
1088 return "RequestOptional";
1089 case SECURITY_ACTION_REQREFUSE
:
1090 return "RequestRefuse";
1091 /* Special actions (for non CAS permissions) */
1092 case SECURITY_ACTION_NONCASDEMAND
:
1093 return "NonCasDemand";
1094 case SECURITY_ACTION_NONCASLINKDEMAND
:
1095 return "NonCasLinkDemand";
1096 case SECURITY_ACTION_NONCASINHERITANCE
:
1097 return "NonCasInheritance";
1098 /* Fx 2.0 actions (for both CAS and non-CAS permissions) */
1099 case SECURITY_ACTION_LINKDEMANDCHOICE
:
1100 return "LinkDemandChoice";
1101 case SECURITY_ACTION_INHERITDEMANDCHOICE
:
1102 return "InheritanceDemandChoice";
1103 case SECURITY_ACTION_DEMANDCHOICE
:
1104 return "DemandChoice";
1106 g_snprintf (buf
, sizeof (buf
), "0x%04X", val
);
1112 dump_table_declsec (MonoImage
*m
)
1114 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_DECLSECURITY
];
1115 guint32 cols
[MONO_DECL_SECURITY_SIZE
];
1118 const char *blob
, *action
;
1119 const char* parent
[] = {
1120 "TypeDef", "MethodDef", "Assembly", ""
1123 fprintf (output
, "DeclSecurity Table (1..%d)\n", t
->rows
);
1125 for (i
= 1; i
<= t
->rows
; i
++) {
1126 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_DECL_SECURITY_SIZE
);
1127 blob
= mono_metadata_blob_heap (m
, cols
[MONO_DECL_SECURITY_PERMISSIONSET
]);
1128 len
= mono_metadata_decode_blob_size (blob
, &blob
);
1129 action
= get_security_action (cols
[MONO_DECL_SECURITY_ACTION
]);
1130 idx
= cols
[MONO_DECL_SECURITY_PARENT
];
1131 fprintf (output
, "%d: %s on %s %d%s", i
, action
, parent
[idx
& MONO_HAS_DECL_SECURITY_MASK
], idx
>> MONO_HAS_DECL_SECURITY_BITS
, len
? ":\n\t":"\n");
1134 if (blob
[0] == MONO_DECLSEC_FORMAT_20
) {
1135 /* 2.0 declarative security format */
1136 char *declsec
= dump_declsec_entry20 (m
, blob
, "\t");
1137 fprintf (output
, "%s", declsec
);
1140 /* 1.0 declarative security format - Unicode XML */
1141 for (idx
= 0; idx
< len
; ++idx
)
1142 fprintf (output
, "%c", blob
[idx
]);
1144 fprintf (output
, "\n");
1149 dump_table_genericpar (MonoImage
*m
)
1151 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_GENERICPARAM
];
1152 guint32 cols
[MONO_GENERICPARAM_SIZE
];
1155 fprintf (output
, "GenericParameters (1..%d)\n", t
->rows
);
1157 for (i
= 1; i
<= t
->rows
; i
++) {
1159 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_GENERICPARAM_SIZE
);
1161 // sig = get_type_or_methdef (m, cols [MONO_GENERICPARAM_OWNER]);
1162 sig
= g_strdup_printf ("%x", cols
[MONO_GENERICPARAM_OWNER
]);
1163 fprintf (output
, "%d: %d, flags=%d, owner=%s %s\n", i
,
1164 cols
[MONO_GENERICPARAM_NUMBER
],
1165 cols
[MONO_GENERICPARAM_FLAGS
], sig
,
1166 mono_metadata_string_heap (m
, cols
[MONO_GENERICPARAM_NAME
]));
1172 dump_table_methodspec (MonoImage
*m
)
1174 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_METHODSPEC
];
1175 guint32 cols
[MONO_METHODSPEC_SIZE
];
1178 fprintf (output
, "MethodSpec (1..%d)\n", t
->rows
);
1180 for (i
= 1; i
<= t
->rows
; i
++) {
1185 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_METHODSPEC_SIZE
);
1187 /* build a methodspec token to get the method */
1188 token
= MONO_TOKEN_METHOD_SPEC
| i
;
1189 method
= get_method (m
, token
, NULL
);
1191 sig
= get_method_type_param (m
, cols
[MONO_METHODSPEC_SIGNATURE
], NULL
);
1192 fprintf (output
, "%d: %s, %s\n", i
, method
, sig
);
1199 dump_table_parconstraint (MonoImage
*m
)
1201 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_GENERICPARAMCONSTRAINT
];
1202 guint32 cols
[MONO_GENPARCONSTRAINT_SIZE
];
1205 fprintf (output
, "Generic Param Constraint (1..%d)\n", t
->rows
);
1207 for (i
= 1; i
<= t
->rows
; i
++) {
1209 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_GENPARCONSTRAINT_SIZE
);
1211 // sig = get_typedef_or_ref (m, cols [MONO_GENPARCONSTRAINT_CONSTRAINT], NULL);
1212 sig
= g_strdup_printf ("%x", cols
[MONO_GENPARCONSTRAINT_CONSTRAINT
]);
1213 fprintf (output
, "%d: gen-par=%d, Constraint=%s\n", i
,
1214 cols
[MONO_GENPARCONSTRAINT_GENERICPAR
], sig
);
1220 dump_stream_blob (MonoImage
*m
)
1224 fprintf (output
, "Blob heap contents\n");
1226 for (i
= 0; i
< m
->heap_blob
.size
; i
++) {
1229 fprintf (output
, "\n");
1230 else if ((i
% 8) == 0)
1231 fprintf (output
, "- ");
1233 fprintf (output
, "%02x ", m
->heap_blob
.data
[i
] & 0xff);
1236 fprintf (output
, "\n");
1240 dump_stream_strings (MonoImage
*m
)
1244 fprintf (output
, "Strings heap contents\n");
1246 for (i
= 0; i
< m
->heap_strings
.size
; ) {
1247 const char *str
= mono_metadata_string_heap (m
, i
);
1248 fprintf (output
, "%02x: \"%s\"\n", i
, str
);
1249 i
+= strlen (str
) + 1;
1254 dump_stream_us (MonoImage
*m
)
1258 fprintf (output
, "User Strings heap contents\n");
1260 for (i
= 0; i
< m
->heap_us
.size
; ) {
1261 const char *us_ptr
= mono_metadata_user_string (m
, i
);
1262 int len
= mono_metadata_decode_blob_size (us_ptr
, (const char**)&us_ptr
);
1264 char *str
= get_encoded_user_string_or_bytearray ((const guchar
*)us_ptr
, len
);
1265 fprintf (output
, "%02x: %s\n", i
, str
);
1272 dump_table_standalonesig (MonoImage
*m
)
1274 MonoTableInfo
*t
= &m
->tables
[MONO_TABLE_STANDALONESIG
];
1275 guint32 cols
[MONO_STAND_ALONE_SIGNATURE_SIZE
];
1278 fprintf (output
, "Stand alone signature (1..%d)\n", t
->rows
);
1280 for (i
= 1; i
<= t
->rows
; i
++) {
1281 const char *locals_ptr
;
1284 mono_metadata_decode_row (t
, i
- 1, cols
, MONO_STAND_ALONE_SIGNATURE_SIZE
);
1286 locals_ptr
= mono_metadata_blob_heap (m
, cols
[MONO_STAND_ALONE_SIGNATURE
]);
1287 bsize
= mono_metadata_decode_blob_size (locals_ptr
, &locals_ptr
);
1289 fprintf (output
, "%d: blob[0x%x] = ", i
, cols
[MONO_STAND_ALONE_SIGNATURE
]);
1291 for (j
= 0; j
< bsize
; j
++) {
1292 fprintf (output
, "%02x ", locals_ptr
[j
] & 0xff);
1294 fprintf (output
, "\n");
1299 dump_table_ptr (MonoImage
*m
, int table
, const char *name
)
1301 MonoTableInfo
*t
= &m
->tables
[table
];
1305 fprintf (output
, "%s (1..%d)\n", name
, t
->rows
);
1307 for (i
= 1; i
<= t
->rows
; i
++) {
1308 mono_metadata_decode_row (t
, i
- 1, cols
, 1);
1310 fprintf (output
, "%d: %d\n", i
, cols
[0]);
1315 dump_table_methodptr (MonoImage
*m
)
1317 dump_table_ptr (m
, MONO_TABLE_METHOD_POINTER
, "Method Ptr");
1321 dump_table_fieldptr (MonoImage
*m
)
1323 dump_table_ptr (m
, MONO_TABLE_FIELD_POINTER
, "Field Ptr");
1327 dump_table_paramptr (MonoImage
*m
)
1329 dump_table_ptr (m
, MONO_TABLE_PARAM_POINTER
, "Param Ptr");
1333 dump_table_eventptr (MonoImage
*m
)
1335 dump_table_ptr (m
, MONO_TABLE_EVENT_POINTER
, "Event Ptr");
1339 dump_table_propertyptr (MonoImage
*m
)
1341 dump_table_ptr (m
, MONO_TABLE_PROPERTY_POINTER
, "Property Ptr");