Skip to content

Commit 8a9117e

Browse files
EPouechjulliard
authored andcommitted
winedump: Add support for dumping CodeView types records found in IPI stream (wine-mirror#4).
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
1 parent d3c9d64 commit 8a9117e

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

include/wine/mscvpdb.h

+67
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ union codeview_type
124124
unsigned short int id;
125125
} generic;
126126

127+
/* types found in TPI stream (#2) */
127128
struct
128129
{
129130
unsigned short int len;
@@ -360,6 +361,61 @@ union codeview_type
360361
cv_typ_t arglist;
361362
unsigned int this_adjust;
362363
} mfunction_v2;
364+
365+
/* types found in IPI stream (#4) */
366+
struct
367+
{
368+
unsigned short int len;
369+
unsigned short int id; /* LF_FUNC_ID */
370+
cv_itemid_t scopeId;
371+
cv_typ_t type;
372+
char name[1];
373+
} func_id_v3;
374+
375+
struct
376+
{
377+
unsigned short int len;
378+
unsigned short int id; /* LF_MFUNC_ID */
379+
cv_typ_t parentType;
380+
cv_typ_t type;
381+
char name[1];
382+
} mfunc_id_v3;
383+
384+
struct
385+
{
386+
unsigned short int len;
387+
unsigned short int id; /* LF_STRING_ID */
388+
cv_itemid_t strid;
389+
char name[1];
390+
} string_id_v3;
391+
392+
struct
393+
{
394+
unsigned short int len;
395+
unsigned short int id; /* LF_UDT_SRC_LINE */
396+
cv_typ_t type;
397+
cv_itemid_t src;
398+
unsigned int line;
399+
} udt_src_line_v3;
400+
401+
struct
402+
{
403+
unsigned short int len;
404+
unsigned short int id; /* LF_UDT_MOD_SRC_LINE */
405+
cv_typ_t type;
406+
cv_itemid_t src;
407+
unsigned int line;
408+
unsigned short imod;
409+
} udt_mod_src_line_v3;
410+
411+
struct
412+
{
413+
unsigned short int len;
414+
unsigned short int id; /* LF_BUILDINFO */
415+
unsigned short count;
416+
cv_itemid_t arg[1];
417+
} buildinfo_v3;
418+
363419
};
364420

365421
union codeview_reftype
@@ -1216,6 +1272,17 @@ union codeview_fieldtype
12161272
#define LF_NESTTYPE_V3 0x1510
12171273
#define LF_ONEMETHOD_V3 0x1511
12181274

1275+
/* leaves found in second type type (aka IPI)
1276+
* for simplicity, stored in the same union as other TPI leaves
1277+
*/
1278+
#define LF_FUNC_ID 0x1601
1279+
#define LF_MFUNC_ID 0x1602
1280+
#define LF_BUILDINFO 0x1603
1281+
#define LF_SUBSTR_LIST 0x1604
1282+
#define LF_STRING_ID 0x1605
1283+
#define LF_UDT_SRC_LINE 0x1606
1284+
#define LF_UDT_MOD_SRC_LINE 0x1607
1285+
12191286
#define LF_NUMERIC 0x8000 /* numeric leaf types */
12201287
#define LF_CHAR 0x8000
12211288
#define LF_SHORT 0x8001

tools/winedump/msc.c

+44
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ static void codeview_dump_one_type(unsigned curr_type, const union codeview_type
814814

815815
switch (type->generic.id)
816816
{
817+
/* types from TPI (aka #2) stream */
817818
case LF_POINTER_V1:
818819
printf("\t%x => Pointer V1 to type:%x\n",
819820
curr_type, type->pointer_v1.datatype);
@@ -1099,6 +1100,49 @@ static void codeview_dump_one_type(unsigned curr_type, const union codeview_type
10991100
printf("\n");
11001101
break;
11011102

1103+
/* types from IPI (aka #4) stream */
1104+
case LF_FUNC_ID:
1105+
printf("\t%x => FuncId %s scopeId:%04x type:%04x\n",
1106+
curr_type, type->func_id_v3.name,
1107+
type->func_id_v3.scopeId, type->func_id_v3.type);
1108+
break;
1109+
case LF_MFUNC_ID:
1110+
printf("\t%x => MFuncId %s parent:%04x type:%04x\n",
1111+
curr_type, type->mfunc_id_v3.name,
1112+
type->mfunc_id_v3.parentType, type->mfunc_id_v3.type);
1113+
break;
1114+
case LF_BUILDINFO:
1115+
printf("\t%x => BuildInfo count:%d\n", curr_type, type->buildinfo_v3.count);
1116+
if (type->buildinfo_v3.count >= 1) printf("\t\tcurrent dir: %04x\n", type->buildinfo_v3.arg[0]);
1117+
if (type->buildinfo_v3.count >= 2) printf("\t\tbuild tool: %04x\n", type->buildinfo_v3.arg[1]);
1118+
if (type->buildinfo_v3.count >= 3) printf("\t\tsource file: %04x\n", type->buildinfo_v3.arg[2]);
1119+
if (type->buildinfo_v3.count >= 4) printf("\t\tPDB file: %04x\n", type->buildinfo_v3.arg[3]);
1120+
if (type->buildinfo_v3.count >= 5) printf("\t\tArguments: %04x\n", type->buildinfo_v3.arg[4]);
1121+
break;
1122+
case LF_SUBSTR_LIST:
1123+
printf("\t%x => SubstrList V3(#%u):", curr_type, reftype->arglist_v2.num);
1124+
for (j = 0; j < reftype->arglist_v2.num; j++)
1125+
{
1126+
printf("\t %x", reftype->arglist_v2.args[j]);
1127+
}
1128+
printf("\t\n");
1129+
break;
1130+
case LF_STRING_ID:
1131+
printf("\t%x => StringId %s strid:%04x\n",
1132+
curr_type, type->string_id_v3.name, type->string_id_v3.strid);
1133+
break;
1134+
case LF_UDT_SRC_LINE:
1135+
printf("\t%x => Udt-SrcLine type:%04x src:%04x line:%d\n",
1136+
curr_type, type->udt_src_line_v3.type,
1137+
type->udt_src_line_v3.src, type->udt_src_line_v3.line);
1138+
break;
1139+
case LF_UDT_MOD_SRC_LINE:
1140+
printf("\t%x => Udt-ModSrcLine type:%04x src:%04x line:%d mod:%d\n",
1141+
curr_type, type->udt_mod_src_line_v3.type,
1142+
type->udt_mod_src_line_v3.src, type->udt_mod_src_line_v3.line,
1143+
type->udt_mod_src_line_v3.imod);
1144+
break;
1145+
11021146
default:
11031147
printf(">>> Unsupported type-id %x for %x\n", type->generic.id, curr_type);
11041148
dump_data((const void*)type, type->generic.len + 2, "");

0 commit comments

Comments
 (0)