In some 32bit modules, MingW/GCC generates in Dwarf debug information, a cfa address to be computed as: deref(register XX + offset) which is too complicated to be expressed through regular DbgHelp APIs.
So silence the FIXME, and report a 'too complex' error (instead of 'internal').
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52790
Signed-off-by: Eric Pouech eric.pouech@gmail.com
From: Eric Pouech eric.pouech@gmail.com
In some 32bit modules, MingW/GCC generates in Dwarf debug information, a cfa address to be computed as: deref(register XX + offset) which is too complicated to be expressed through regular DbgHelp APIs.
So silence the FIXME, and report a 'too complex' error (instead of 'internal').
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52790
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/dbghelp/dwarf.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 8c57c211db4..f4bdb43fb16 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -3051,7 +3051,7 @@ static const dwarf2_cuhead_t* get_cuhead_from_func(const struct symt_function* f return NULL; }
-static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame); +static enum location_error compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame);
static enum location_error loc_compute_frame(struct process* pcs, const struct module_format* modfmt, @@ -3094,7 +3094,8 @@ static enum location_error loc_compute_frame(struct process* pcs, } break; case loc_dwarf2_frame_cfa: - if (!compute_call_frame_cfa(modfmt->module, ip + ((struct symt_compiland*)func->container)->address, frame)) return loc_err_internal; + err = compute_call_frame_cfa(modfmt->module, ip + ((struct symt_compiland*)func->container)->address, frame); + if (err < 0) return err; break; default: WARN("Unsupported frame kind %d\n", pframe->kind); @@ -3889,11 +3890,11 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, return TRUE; }
-static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame) +static enum location_error compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame) { struct frame_info info;
- if (!dwarf2_fetch_frame_info(module, module->cpu, ip, &info)) return FALSE; + if (!dwarf2_fetch_frame_info(module, module->cpu, ip, &info)) return loc_err_internal;
/* beginning of function, or no available dwarf information ? */ if (ip == info.ip || info.state.rules[info.retaddr_reg] == RULE_UNSET) @@ -3911,11 +3912,15 @@ static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct l switch (info.state.cfa_rule) { case RULE_EXPRESSION: - FIXME("Too complex expression for frame_CFA resolution (RULE_EXPRESSION)\n"); - return FALSE; + WARN("Too complex expression for frame_CFA resolution (RULE_EXPRESSION)\n"); + return loc_err_too_complex; case RULE_VAL_EXPRESSION: - FIXME("Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)\n"); - return FALSE; + /* unfortunately, we've seen at least construct like: + * cfa := 'breg_x + offset; deref' + * which is an indirection too much for the DbgHelp API. + */ + WARN("Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)\n"); + return loc_err_too_complex; default: frame->kind = loc_regrel; frame->reg = module->cpu->map_dwarf_register(info.state.cfa_reg, module, TRUE); @@ -3923,7 +3928,7 @@ static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct l break; } } - return TRUE; + return 0; }
static void dwarf2_location_compute(struct process* pcs,
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125157
Your paranoid android.
=== debian11 (32 bit report) ===
ddraw: ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x1000. ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x3000.
urlmon: protocol.c:3682: Test failed: wait timed out protocol: Timeout
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24710. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24710. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24710.