mscvpdb.h: Use bitfield for defrange's variable flag.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
This commit is contained in:
Eric Pouech 2022-07-12 09:28:57 +02:00 committed by Alexandre Julliard
parent bf68ec1f8a
commit 437e73883b
3 changed files with 35 additions and 17 deletions

View file

@ -2569,7 +2569,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg,
case S_LOCAL:
length += codeview_transform_defrange(msc_dbg, curr_func, sym, &loc);
symt_add_func_local(msc_dbg->module, curr_func,
sym->local_v3.varflags & 0x0001 ? DataIsParam : DataIsLocal,
sym->local_v3.varflags.is_param ? DataIsParam : DataIsLocal,
&loc, block,
codeview_get_type(sym->local_v3.symtype, FALSE),
sym->local_v3.name);

View file

@ -1374,6 +1374,24 @@ struct cv_addr_gap
unsigned short cbRange;
};
struct cv_local_varflag
{
unsigned short is_param : 1;
unsigned short address_taken : 1;
unsigned short from_compiler : 1; /* generated by compiler */
unsigned short is_aggregate : 1; /* splitted in several variables by compiler */
unsigned short from_aggregate : 1; /* marks a temporary from an aggregate */
unsigned short is_aliased : 1;
unsigned short from_alias : 1;
unsigned short is_return_value : 1;
unsigned short optimized_out : 1;
unsigned short enreg_global : 1; /* global variable accessed from register */
unsigned short enreg_static : 1;
unsigned short unused : 5;
};
union codeview_symbol
{
struct
@ -1874,7 +1892,7 @@ union codeview_symbol
unsigned short int len;
unsigned short int id;
cv_typ_t symtype;
unsigned short varflags;
struct cv_local_varflag varflags;
char name[1];
} local_v3;
@ -2003,7 +2021,7 @@ union codeview_symbol
unsigned short int id;
cv_typ_t typind;
unsigned int modOffset;
unsigned short varflags;
struct cv_local_varflag varflags;
char name[1];
} file_static_v3;

View file

@ -275,27 +275,27 @@ static const char* get_funcattr(unsigned attr)
return tmp;
}
static const char* get_varflags(unsigned flags)
static const char* get_varflags(struct cv_local_varflag 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-aggregate");
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);
if (flags.is_param) X("param");
if (flags.address_taken) X("addr-taken");
if (flags.from_compiler) X("compiler-gen");
if (flags.is_aggregate) X("aggregated");
if (flags.from_aggregate) X("in-aggregate");
if (flags.is_aliased) X("aliased");
if (flags.from_alias) X("alias");
if (flags.is_return_value) X("retval");
if (flags.optimized_out) X("optimized-out");
if (flags.enreg_global) X("enreg-global");
if (flags.enreg_static) X("enreg-static");
if (flags.unused) pos += sprintf(tmp, "unk:%x", flags.unused);
#undef X
if (!pos) return "none";
tmp[pos] = '\0';
assert(pos < sizeof(tmp));