Commit 1e0af22a authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

dbghelp: dwarf debug info: a few more fixes to dwarf parsing.

parent 1bfd8998
......@@ -132,6 +132,7 @@ enum location_error {loc_err_internal = -1, /* internal while computing */
loc_err_too_complex = -2, /* couldn't compute location (even at runtime) */
loc_err_out_of_scope = -3, /* variable isn't available at current address */
loc_err_cant_read = -4, /* couldn't read memory at given address */
loc_err_no_location = -5, /* likely optimized away (by compiler) */
};
struct location
......
......@@ -1511,6 +1511,22 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm,
di->symt = &symt_new_constant(subpgm->ctx->module, subpgm->compiland,
name.u.string, param_type, &v)->symt;
}
else
{
/* variable has been optimiezd away... report anyway */
loc.kind = loc_error;
loc.reg = loc_err_no_location;
if (subpgm->func)
{
symt_add_func_local(subpgm->ctx->module, subpgm->func,
is_pmt ? DataIsParam : DataIsLocal,
&loc, block, param_type, name.u.string);
}
else
{
WARN("dropping global variable %s which has been optimized away\n", name.u.string);
}
}
if (is_pmt && subpgm->func && subpgm->func->type)
symt_add_function_signature_parameter(subpgm->ctx->module,
(struct symt_function_signature*)subpgm->func->type,
......
......@@ -676,7 +676,7 @@ BOOL memory_get_register(DWORD regno, DWORD_PTR** value, char* buffer, int len)
const struct dbg_internal_var* div;
/* negative register values are wine's dbghelp hacks
* see dlls/dbghelp/dbghelp_internal.h for the details
* see dlls/dbghelp/dbghelp_private.h for the details
*/
switch (regno)
{
......@@ -692,6 +692,9 @@ BOOL memory_get_register(DWORD regno, DWORD_PTR** value, char* buffer, int len)
case -4:
if (buffer) snprintf(buffer, len, "<couldn't read memory>");
return FALSE;
case -5:
if (buffer) snprintf(buffer, len, "<has been optimized away by compiler>");
return FALSE;
}
for (div = be_cpu->context_vars; div->name; div++)
......
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