winedump: Add support for dumping S_LOCAL symbol record.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2021-08-24 11:11:31 +02:00 committed by Alexandre Julliard
parent 0003c64e5b
commit 5c9c342858
2 changed files with 43 additions and 0 deletions

View File

@ -1727,6 +1727,15 @@ union codeview_symbol
unsigned short inst_len;
unsigned int index;
} heap_alloc_site;
struct
{
unsigned short int len;
unsigned short int id;
cv_typ_t symtype;
unsigned short varflags;
char name[1];
} local_v3;
};
#define S_COMPILE 0x0001

View File

@ -288,6 +288,33 @@ static const char* get_funcattr(unsigned attr)
return tmp;
}
static const char* get_varflags(unsigned flags)
{
static char tmp[1024];
unsigned pos = 0;
if (!flags) return "none";
#define X(s) {if (pos) tmp[pos++] = ';'; strcpy(tmp + pos, s); pos += strlen(s);}
if (flags & 0x0001) X("param");
if (flags & 0x0002) X("addr-taken");
if (flags & 0x0004) X("compiler-gen");
if (flags & 0x0008) X("aggregated");
if (flags & 0x0010) X("in-aggreate");
if (flags & 0x0020) X("aliased");
if (flags & 0x0040) X("alias");
if (flags & 0x0080) X("retval");
if (flags & 0x0100) X("optimized-out");
if (flags & 0x0200) X("enreg-global");
if (flags & 0x0400) X("enreg-static");
if (flags & 0xf800) pos += sprintf(tmp, "unk:%x", flags & 0xf800);
#undef X
tmp[pos] = '\0';
assert(pos < sizeof(tmp));
return tmp;
}
static const char* get_machine(unsigned m)
{
const char* machine;
@ -1564,6 +1591,13 @@ BOOL codeview_dump_symbols(const void* root, unsigned long size)
sym->thread_v3.segment, sym->thread_v3.offset, sym->thread_v3.symtype);
break;
case S_LOCAL:
printf("\tS-Local V3 '%s' type=%x flags=%s\n",
sym->local_v3.name, sym->local_v3.symtype,
get_varflags(sym->local_v3.varflags));
break;
default:
printf(">>> Unsupported symbol-id %x sz=%d\n", sym->generic.id, sym->generic.len + 2);
dump_data((const void*)sym, sym->generic.len + 2, " ");