dbghelp: Relax some failure conditions in SymSetContext and SymSetScopeFromAddr.
They shouldn't fail if passed address is inside a module, even if it doesn't point to a function. Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
25d2c954ad
commit
10a20b2d22
|
@ -607,18 +607,14 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
|
|||
PIMAGEHLP_CONTEXT Context)
|
||||
{
|
||||
struct process* pcs;
|
||||
BOOL same;
|
||||
|
||||
TRACE("(%p %p %p)\n", hProcess, StackFrame, Context);
|
||||
|
||||
if (!(pcs = process_find_by_handle(hProcess))) return FALSE;
|
||||
same = pcs->ctx_frame.ReturnOffset == StackFrame->ReturnOffset &&
|
||||
pcs->ctx_frame.FrameOffset == StackFrame->FrameOffset &&
|
||||
pcs->ctx_frame.StackOffset == StackFrame->StackOffset;
|
||||
|
||||
if (!SymSetScopeFromAddr(hProcess, StackFrame->InstructionOffset))
|
||||
return FALSE;
|
||||
|
||||
pcs->ctx_frame = *StackFrame;
|
||||
if (same)
|
||||
if (pcs->ctx_frame.ReturnOffset == StackFrame->ReturnOffset &&
|
||||
pcs->ctx_frame.FrameOffset == StackFrame->FrameOffset &&
|
||||
pcs->ctx_frame.StackOffset == StackFrame->StackOffset &&
|
||||
pcs->ctx_frame.InstructionOffset == StackFrame->InstructionOffset)
|
||||
{
|
||||
TRACE("Setting same frame {rtn=%I64x frm=%I64x stk=%I64x}\n",
|
||||
pcs->ctx_frame.ReturnOffset,
|
||||
|
@ -628,7 +624,11 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SymSetScopeFromAddr(hProcess, StackFrame->InstructionOffset))
|
||||
return FALSE;
|
||||
pcs->ctx_frame = *StackFrame;
|
||||
/* Context is not (no longer?) used */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -643,11 +643,11 @@ BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr)
|
|||
TRACE("(%p %#I64x)\n", hProcess, addr);
|
||||
|
||||
if (!module_init_pair(&pair, hProcess, addr)) return FALSE;
|
||||
if ((sym = symt_find_nearest(pair.effective, addr)) == NULL) return FALSE;
|
||||
if (sym->symt.tag != SymTagFunction) return FALSE;
|
||||
|
||||
pair.pcs->localscope_pc = addr;
|
||||
pair.pcs->localscope_symt = &sym->symt;
|
||||
if ((sym = symt_find_nearest(pair.effective, addr)) != NULL && sym->symt.tag == SymTagFunction)
|
||||
pair.pcs->localscope_symt = &sym->symt;
|
||||
else
|
||||
pair.pcs->localscope_symt = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue