winedbg: Force 64bit line number information throughout the code to ease 64bit portability.
This commit is contained in:
parent
91c7ff2994
commit
12c3a012cb
|
@ -299,14 +299,14 @@ void break_add_break_from_lineno(int lineno, BOOL swbp)
|
|||
|
||||
if (lineno != -1)
|
||||
{
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
|
||||
|
||||
DWORD disp;
|
||||
DWORD_PTR linear = (DWORD_PTR)memory_to_linear_addr(&bkln.addr);
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (!SymGetLineFromAddr(dbg_curr_process->handle, linear, &disp, &il))
|
||||
if (!SymGetLineFromAddr64(dbg_curr_process->handle, linear, &disp, &il))
|
||||
{
|
||||
dbg_printf("Unable to add breakpoint (unknown address %lx)\n", linear);
|
||||
return;
|
||||
|
|
|
@ -46,7 +46,7 @@ static void parser(const char*);
|
|||
struct dbg_lvalue lvalue;
|
||||
char* string;
|
||||
INT_PTR integer;
|
||||
IMAGEHLP_LINE listing;
|
||||
IMAGEHLP_LINE64 listing;
|
||||
struct expr* expression;
|
||||
struct type_expr_t type;
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ list_arg:
|
|||
| pathname ':' identifier { symbol_get_line($1, $3, &$$); }
|
||||
| '*' expr_lvalue { DWORD disp; ADDRESS64 addr; $$.SizeOfStruct = sizeof($$);
|
||||
types_extract_as_address(&$2, &addr);
|
||||
SymGetLineFromAddr(dbg_curr_process->handle, (unsigned long)memory_to_linear_addr(& addr), &disp, & $$); }
|
||||
SymGetLineFromAddr64(dbg_curr_process->handle, (unsigned long)memory_to_linear_addr(& addr), &disp, & $$); }
|
||||
;
|
||||
|
||||
run_command:
|
||||
|
|
|
@ -375,7 +375,7 @@ extern void print_address(const ADDRESS64* addr, BOOLEAN with_line);
|
|||
extern void print_basic(const struct dbg_lvalue* value, char format);
|
||||
|
||||
/* source.c */
|
||||
extern void source_list(IMAGEHLP_LINE* src1, IMAGEHLP_LINE* src2, int delta);
|
||||
extern void source_list(IMAGEHLP_LINE64* src1, IMAGEHLP_LINE64* src2, int delta);
|
||||
extern void source_list_from_addr(const ADDRESS64* addr, int nlines);
|
||||
extern void source_show_path(void);
|
||||
extern void source_add_path(const char* path);
|
||||
|
@ -395,7 +395,7 @@ extern BOOL stack_get_current_symbol(SYMBOL_INFO* sym);
|
|||
extern enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno, struct dbg_lvalue* addr, BOOL bp_disp);
|
||||
extern void symbol_read_symtable(const char* filename, unsigned long offset);
|
||||
extern enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr);
|
||||
extern BOOL symbol_get_line(const char* filename, const char* func, IMAGEHLP_LINE* ret);
|
||||
extern BOOL symbol_get_line(const char* filename, const char* func, IMAGEHLP_LINE64* ret);
|
||||
extern void symbol_info(const char* str);
|
||||
extern void symbol_print_local(const SYMBOL_INFO* sym, ULONG_PTR base, BOOL detailed);
|
||||
extern int symbol_info_locals(void);
|
||||
|
|
|
@ -588,11 +588,11 @@ void print_address(const ADDRESS64* addr, BOOLEAN with_line)
|
|||
if (disp64) dbg_printf("+0x%lx", (DWORD_PTR)disp64);
|
||||
if (with_line)
|
||||
{
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
IMAGEHLP_MODULE im;
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (SymGetLineFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
||||
if (SymGetLineFromAddr64(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
||||
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
|
||||
im.SizeOfStruct = sizeof(im);
|
||||
if (SymGetModuleInfo(dbg_curr_process->handle, (DWORD_PTR)lin, &im))
|
||||
|
|
|
@ -286,7 +286,7 @@ static int source_display(const char* sourcefile, int start, int end)
|
|||
return rtn;
|
||||
}
|
||||
|
||||
void source_list(IMAGEHLP_LINE* src1, IMAGEHLP_LINE* src2, int delta)
|
||||
void source_list(IMAGEHLP_LINE64* src1, IMAGEHLP_LINE64* src2, int delta)
|
||||
{
|
||||
int end;
|
||||
int start;
|
||||
|
@ -344,7 +344,7 @@ void source_list(IMAGEHLP_LINE* src1, IMAGEHLP_LINE* src2, int delta)
|
|||
|
||||
void source_list_from_addr(const ADDRESS64* addr, int nlines)
|
||||
{
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
ADDRESS64 la;
|
||||
DWORD disp;
|
||||
|
||||
|
@ -355,8 +355,8 @@ void source_list_from_addr(const ADDRESS64* addr, int nlines)
|
|||
}
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (SymGetLineFromAddr(dbg_curr_process->handle,
|
||||
(unsigned long)memory_to_linear_addr(addr),
|
||||
if (SymGetLineFromAddr64(dbg_curr_process->handle,
|
||||
(DWORD_PTR)memory_to_linear_addr(addr),
|
||||
&disp, &il))
|
||||
source_list(&il, NULL, nlines);
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ static void stack_print_addr_and_args(int nf)
|
|||
char buffer[sizeof(SYMBOL_INFO) + 256];
|
||||
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
|
||||
IMAGEHLP_STACK_FRAME ihsf;
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
IMAGEHLP_MODULE im;
|
||||
DWORD64 disp64;
|
||||
|
||||
|
@ -263,8 +263,8 @@ static void stack_print_addr_and_args(int nf)
|
|||
dbg_printf(")");
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (SymGetLineFromAddr(dbg_curr_process->handle, ihsf.InstructionOffset,
|
||||
&disp, &il))
|
||||
if (SymGetLineFromAddr64(dbg_curr_process->handle,
|
||||
ihsf.InstructionOffset, &disp, &il))
|
||||
dbg_printf(" [%s:%u]", il.FileName, il.LineNumber);
|
||||
dbg_printf(" in %s", im.ModuleName);
|
||||
}
|
||||
|
|
|
@ -403,11 +403,11 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
|
|||
else
|
||||
{
|
||||
DWORD disp;
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
BOOL found = FALSE;
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
SymGetLineFromAddr(dbg_curr_process->handle,
|
||||
SymGetLineFromAddr64(dbg_curr_process->handle,
|
||||
(DWORD_PTR)memory_to_linear_addr(&sgv.syms[i].lvalue.addr),
|
||||
&disp, &il);
|
||||
do
|
||||
|
@ -418,7 +418,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
|
|||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
} while (SymGetLineNext(dbg_curr_process->handle, &il));
|
||||
} while (SymGetLineNext64(dbg_curr_process->handle, &il));
|
||||
if (!found)
|
||||
WINE_FIXME("No line (%d) found for %s (setting to symbol start)\n",
|
||||
lineno, name);
|
||||
|
@ -521,7 +521,7 @@ void symbol_read_symtable(const char* filename, unsigned long offset)
|
|||
*/
|
||||
enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr)
|
||||
{
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
DWORD disp;
|
||||
ULONG64 disp64, start;
|
||||
DWORD_PTR lin = (DWORD_PTR)memory_to_linear_addr(addr);
|
||||
|
@ -552,7 +552,7 @@ enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr)
|
|||
return dbg_no_line_info;
|
||||
}
|
||||
/* we should have a function now */
|
||||
if (!SymGetLineFromAddr(dbg_curr_process->handle, lin, &disp, &il))
|
||||
if (!SymGetLineFromAddr64(dbg_curr_process->handle, lin, &disp, &il))
|
||||
return dbg_no_line_info;
|
||||
|
||||
func.module = sym->ModBase;
|
||||
|
@ -575,13 +575,14 @@ enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr)
|
|||
* Returns sourcefile name and line number in a format that the listing
|
||||
* handler can deal with.
|
||||
*/
|
||||
BOOL symbol_get_line(const char* filename, const char* name, IMAGEHLP_LINE* line)
|
||||
BOOL symbol_get_line(const char* filename, const char* name,
|
||||
IMAGEHLP_LINE64* line)
|
||||
{
|
||||
struct sgv_data sgv;
|
||||
char buffer[512];
|
||||
DWORD opt, disp;
|
||||
unsigned i, found = FALSE;
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
|
||||
sgv.num = 0;
|
||||
sgv.num_thunks = 0;
|
||||
|
@ -619,7 +620,7 @@ BOOL symbol_get_line(const char* filename, const char* name, IMAGEHLP_LINE* line
|
|||
DWORD_PTR linear = (DWORD_PTR)memory_to_linear_addr(&sgv.syms[i].lvalue.addr);
|
||||
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (!SymGetLineFromAddr(dbg_curr_process->handle, linear, &disp, &il))
|
||||
if (!SymGetLineFromAddr64(dbg_curr_process->handle, linear, &disp, &il))
|
||||
continue;
|
||||
if (filename && strcmp(il.FileName, filename)) continue;
|
||||
if (found)
|
||||
|
|
|
@ -196,14 +196,14 @@ static unsigned dbg_exception_prolog(BOOL is_debug, BOOL first_chance, const EXC
|
|||
SYMBOL_INFO* si = (SYMBOL_INFO*)buffer;
|
||||
void* lin = memory_to_linear_addr(&addr);
|
||||
DWORD64 disp64;
|
||||
IMAGEHLP_LINE il;
|
||||
IMAGEHLP_LINE64 il;
|
||||
DWORD disp;
|
||||
|
||||
si->SizeOfStruct = sizeof(*si);
|
||||
si->MaxNameLen = 256;
|
||||
il.SizeOfStruct = sizeof(il);
|
||||
if (SymFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp64, si) &&
|
||||
SymGetLineFromAddr(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
||||
SymGetLineFromAddr64(dbg_curr_process->handle, (DWORD_PTR)lin, &disp, &il))
|
||||
{
|
||||
if ((!last_name || strcmp(last_name, si->Name)) ||
|
||||
(!last_file || strcmp(last_file, il.FileName)))
|
||||
|
|
Loading…
Reference in New Issue