[PATCH 10/11] dbghelp: in SymGetLine* family, compute displacement relative to line_info's address
Eric Pouech
eric.pouech at gmail.com
Wed Oct 20 11:36:44 CDT 2021
(was incorrectly computed relative to start of function)
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
---
dlls/dbghelp/symbol.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index 4fd9fda6619..459f282502a 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -1854,7 +1854,7 @@ static BOOL get_line_from_addr(HANDLE hProcess, DWORD64 addr,
PDWORD pdwDisplacement, struct internal_line_t* intl)
{
struct line_info* dli = NULL;
- BOOL found = FALSE;
+ struct line_info* found_dli = NULL;
int i;
struct module_pair pair;
struct symt_ht* symt;
@@ -1871,14 +1871,14 @@ static BOOL get_line_from_addr(HANDLE hProcess, DWORD64 addr,
dli = vector_at(&func->vlines, i);
if (!dli->is_source_file)
{
- if (found || dli->u.address > addr) continue;
+ if (found_dli || dli->u.address > addr) continue;
intl->line_number = dli->line_number;
intl->address = dli->u.address;
intl->key = dli;
- found = TRUE;
+ found_dli = dli;
continue;
}
- if (found)
+ if (found_dli)
{
BOOL ret;
if (dbghelp_opt_native)
@@ -1892,7 +1892,7 @@ static BOOL get_line_from_addr(HANDLE hProcess, DWORD64 addr,
ret = internal_line_set_nameW(pair.pcs, intl, dospath, TRUE);
HeapFree( GetProcessHeap(), 0, dospath );
}
- if (ret) *pdwDisplacement = intl->address - func->address;
+ if (ret) *pdwDisplacement = addr - found_dli->u.address;
return ret;
}
}
More information about the wine-devel
mailing list