Commit 9c09f142 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

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

parent 8fecef87
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment