dbghelp: Implement SymSetScopeFromAddr() and SymSetScopeFromIndex().

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2021-10-26 11:45:38 +02:00 committed by Alexandre Julliard
parent 066bb761cc
commit 925182b09f
1 changed files with 20 additions and 6 deletions

View File

@ -644,11 +644,18 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame,
*/
BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr)
{
struct process* pcs;
struct module_pair pair;
struct symt_ht* sym;
FIXME("(%p %#I64x): stub\n", hProcess, 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 (!(pcs = process_find_by_handle(hProcess))) return FALSE;
return TRUE;
}
@ -657,11 +664,18 @@ BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr)
*/
BOOL WINAPI SymSetScopeFromIndex(HANDLE hProcess, ULONG64 addr, DWORD index)
{
struct process* pcs;
struct module_pair pair;
struct symt* sym;
FIXME("(%p %#I64x %u): stub\n", hProcess, addr, index);
TRACE("(%p %#I64x %u)\n", hProcess, addr, index);
if (!module_init_pair(&pair, hProcess, addr)) return FALSE;
sym = symt_index2ptr(pair.effective, index);
if (!symt_check_tag(sym, SymTagFunction)) return FALSE;
pair.pcs->localscope_pc = ((struct symt_function*)sym)->address; /* FIXME of FuncDebugStart when it exists? */
pair.pcs->localscope_symt = sym;
if (!(pcs = process_find_by_handle(hProcess))) return FALSE;
return TRUE;
}