dbghelp: MSC handling of function signature's parameters.

- now correctly parsing parameters types for a function
  signature and storing them in dbghelp internal structures
This commit is contained in:
Eric Pouech 2006-03-18 13:33:00 +01:00 committed by Alexandre Julliard
parent 209e175d83
commit 9e6573315d
2 changed files with 56 additions and 11 deletions

View File

@ -684,14 +684,39 @@ static int codeview_add_type_struct(struct codeview_type_parse* ctp, unsigned in
return codeview_add_type(typeno, &symt->symt); return codeview_add_type(typeno, &symt->symt);
} }
static int codeview_new_func_signature(struct module* module, unsigned typeno, static int codeview_new_func_signature(struct codeview_type_parse* ctp,
unsigned ret_type, enum CV_call_e call_conv) unsigned typeno, unsigned ret_type,
unsigned args_list, enum CV_call_e call_conv)
{ {
struct symt* symt; struct symt_function_signature* sym;
symt = &symt_new_function_signature(module, const union codeview_reftype* reftype;
codeview_get_type(ret_type, FALSE),
call_conv)->symt; sym = symt_new_function_signature(ctp->module, codeview_get_type(ret_type, FALSE),
return codeview_add_type(typeno, symt); call_conv);
reftype = codeview_jump_to_type(ctp, args_list);
if (reftype)
{
int i;
switch (reftype->generic.id)
{
case LF_ARGLIST_V1:
for (i = 0; i < reftype->arglist_v1.num; i++)
symt_add_function_signature_parameter(ctp->module, sym,
codeview_get_type(reftype->arglist_v1.args[i],
FALSE));
break;
case LF_ARGLIST_V2:
for (i = 0; i < reftype->arglist_v2.num; i++)
symt_add_function_signature_parameter(ctp->module, sym,
codeview_get_type(reftype->arglist_v2.args[i],
FALSE));
break;
default:
FIXME("Unexpected leaf %x for signature's pmt\n", reftype->generic.id);
}
}
return codeview_add_type(typeno, &sym->symt);
} }
static int codeview_parse_type_table(struct codeview_type_parse* ctp) static int codeview_parse_type_table(struct codeview_type_parse* ctp)
@ -854,29 +879,33 @@ static int codeview_parse_type_table(struct codeview_type_parse* ctp)
break; break;
case LF_PROCEDURE_V1: case LF_PROCEDURE_V1:
retv = codeview_new_func_signature(ctp->module, curr_type, retv = codeview_new_func_signature(ctp, curr_type,
type->procedure_v1.rvtype, type->procedure_v1.rvtype,
type->procedure_v1.arglist,
type->procedure_v1.call); type->procedure_v1.call);
break; break;
case LF_PROCEDURE_V2: case LF_PROCEDURE_V2:
retv = codeview_new_func_signature(ctp->module, curr_type, retv = codeview_new_func_signature(ctp, curr_type,
type->procedure_v2.rvtype, type->procedure_v2.rvtype,
type->procedure_v2.arglist,
type->procedure_v2.call); type->procedure_v2.call);
break; break;
case LF_MFUNCTION_V1: case LF_MFUNCTION_V1:
/* FIXME: for C++, this is plain wrong, but as we don't use arg types /* FIXME: for C++, this is plain wrong, but as we don't use arg types
* nor class information, this would just do for now * nor class information, this would just do for now
*/ */
retv = codeview_new_func_signature(ctp->module, curr_type, retv = codeview_new_func_signature(ctp, curr_type,
type->mfunction_v1.rvtype, type->mfunction_v1.rvtype,
type->mfunction_v1.arglist,
type->mfunction_v1.call); type->mfunction_v1.call);
break; break;
case LF_MFUNCTION_V2: case LF_MFUNCTION_V2:
/* FIXME: for C++, this is plain wrong, but as we don't use arg types /* FIXME: for C++, this is plain wrong, but as we don't use arg types
* nor class information, this would just do for now * nor class information, this would just do for now
*/ */
retv = codeview_new_func_signature(ctp->module, curr_type, retv = codeview_new_func_signature(ctp, curr_type,
type->mfunction_v2.rvtype, type->mfunction_v2.rvtype,
type->mfunction_v2.arglist,
type->mfunction_v2.call); type->mfunction_v2.call);
break; break;

View File

@ -387,6 +387,22 @@ union codeview_reftype
unsigned char bitoff; unsigned char bitoff;
} bitfield_v2; } bitfield_v2;
struct
{
unsigned short int len;
short int id;
unsigned short num;
unsigned short args[1];
} arglist_v1;
struct
{
unsigned short int len;
short int id;
unsigned num;
unsigned args[1];
} arglist_v2;
}; };
union codeview_fieldtype union codeview_fieldtype