dbghelp: Extended CPU structure by adding a default register number for frame.

This commit is contained in:
Eric Pouech 2011-04-11 20:47:19 +02:00 committed by Alexandre Julliard
parent 8fecef8757
commit 9c09f14270
9 changed files with 13 additions and 5 deletions

View File

@ -73,6 +73,7 @@ static const char* arm_fetch_regname(unsigned regno)
struct cpu cpu_arm = {
IMAGE_FILE_MACHINE_ARM,
4,
CV_ARM_NOREG, /* FIXME */
arm_get_addr,
arm_stack_walk,
NULL,

View File

@ -635,6 +635,7 @@ static const char* i386_fetch_regname(unsigned regno)
struct cpu cpu_i386 = {
IMAGE_FILE_MACHINE_I386,
4,
CV_REG_EBP,
i386_get_addr,
i386_stack_walk,
NULL,

View File

@ -75,6 +75,7 @@ static const char* ppc_fetch_regname(unsigned regno)
struct cpu cpu_ppc = {
IMAGE_FILE_MACHINE_POWERPC,
4,
CV_REG_NONE, /* FIXME */
ppc_get_addr,
ppc_stack_walk,
NULL,

View File

@ -70,6 +70,7 @@ static const char* sparc_fetch_regname(unsigned regno)
struct cpu cpu_sparc = {
IMAGE_FILE_MACHINE_SPARC,
4,
CV_REG_NONE, /* FIXME */
sparc_get_addr,
sparc_stack_walk,
NULL,

View File

@ -799,6 +799,7 @@ static const char* x86_64_fetch_regname(unsigned regno)
struct cpu cpu_x86_64 = {
IMAGE_FILE_MACHINE_AMD64,
8,
CV_AMD64_RSP,
x86_64_get_addr,
x86_64_stack_walk,
x86_64_find_runtime_function,

View File

@ -470,6 +470,8 @@ struct cpu
{
DWORD machine;
DWORD word_size;
DWORD frame_regno;
/* address manipulation */
unsigned (*get_addr)(HANDLE hThread, const CONTEXT* ctx,
enum cpu_addr, ADDRESS64* addr);

View File

@ -1899,7 +1899,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
{
/* on stack !! */
subpgm.frame.kind = loc_regrel;
subpgm.frame.reg = 0;
subpgm.frame.reg = dbghelp_current_cpu->frame_regno;
subpgm.frame.offset = 0;
}
subpgm.non_computed_variable = FALSE;

View File

@ -1417,7 +1417,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
struct symt* param_type = stabs_parse_type(ptr);
stab_strcpy(symname, sizeof(symname), ptr);
loc.kind = loc_regrel;
loc.reg = 0; /* FIXME */
loc.reg = dbghelp_current_cpu->frame_regno;
loc.offset = stab_ptr->n_value;
symt_add_func_local(module, curr_func,
(int)stab_ptr->n_value >= 0 ? DataIsParam : DataIsLocal,
@ -1492,7 +1492,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
case N_LSYM:
/* These are local variables */
loc.kind = loc_regrel;
loc.reg = 0; /* FIXME */
loc.reg = dbghelp_current_cpu->frame_regno;
loc.offset = stab_ptr->n_value;
if (curr_func != NULL) pending_add_var(&pending_block, ptr, DataIsLocal, &loc);
break;

View File

@ -721,8 +721,9 @@ static void symt_fill_sym_info(struct module_pair* pair,
break;
case loc_regrel:
sym_info->Flags |= SYMFLAG_LOCAL | SYMFLAG_REGREL;
/* FIXME: it's i386 dependent !!! */
sym_info->Register = loc.reg ? loc.reg : CV_REG_EBP;
sym_info->Register = loc.reg;
if (loc.reg == CV_REG_NONE || (int)loc.reg < 0 /* error */)
FIXME("suspicious register value %x\n", loc.reg);
sym_info->Address = loc.offset;
break;
case loc_absolute: