Module: wine Branch: master Commit: 7bde153afe83480e9ccf958543fd2152cab8b1c2 URL: https://source.winehq.org/git/wine.git/?a=commit;h=7bde153afe83480e9ccf95854...
Author: Eric Pouech eric.pouech@gmail.com Date: Fri Oct 29 15:37:44 2021 +0200
dbghelp/dwarf: Store line numbers and file info for inlined functions.
Signed-off-by: Eric Pouech eric.pouech@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dbghelp/dwarf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index eab6609cdf4..269cfadd56c 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2515,6 +2515,7 @@ static void dwarf2_set_line_number(struct module* module, ULONG_PTR address, const struct vector* v, unsigned file, unsigned line) { struct symt_function* func; + struct symt_inlinesite* inlined; struct symt_ht* symt; unsigned* psrc;
@@ -2526,6 +2527,19 @@ static void dwarf2_set_line_number(struct module* module, ULONG_PTR address, if (symt_check_tag(&symt->symt, SymTagFunction)) { func = (struct symt_function*)symt; + for (inlined = func->next_inlinesite; inlined; inlined = inlined->func.next_inlinesite) + { + int i; + for (i = 0; i < inlined->vranges.num_elts; ++i) + { + struct addr_range* ar = (struct addr_range*)vector_at(&inlined->vranges, i); + if (ar->low <= address && address < ar->high) + { + symt_add_func_line(module, &inlined->func, *psrc, line, address); + return; /* only add to lowest matching inline site */ + } + } + } symt_add_func_line(module, func, *psrc, line, address); } }