[PATCH 09/10] dbghelp{dwarf}: passing dwarf2_cuhead_t to lookuploclist()

Eric Pouech eric.pouech at gmail.com
Wed Sep 8 01:34:38 CDT 2021


Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 dlls/dbghelp/dwarf.c |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index a2ee44c6af4..04a4b85e80c 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -2472,8 +2472,8 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
     return ret;
 }
 
-static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE* start,
-                                  ULONG_PTR ip, dwarf2_traverse_context_t* lctx)
+static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const dwarf2_cuhead_t* head,
+                                  const BYTE* start, ULONG_PTR ip, dwarf2_traverse_context_t* lctx)
 {
     DWORD_PTR                   beg, end;
     const BYTE*                 ptr = start;
@@ -2481,8 +2481,8 @@ static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE
 
     while (ptr < modfmt->u.dwarf2_info->debug_loc.address + modfmt->u.dwarf2_info->debug_loc.size)
     {
-        beg = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size;
-        end = dwarf2_get_addr(ptr, modfmt->u.dwarf2_info->word_size); ptr += modfmt->u.dwarf2_info->word_size;
+        beg = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size;
+        end = dwarf2_get_addr(ptr, head->word_size); ptr += head->word_size;
         if (!beg && !end) break;
         len = dwarf2_get_u2(ptr); ptr += 2;
 
@@ -2519,6 +2519,7 @@ static enum location_error loc_compute_frame(struct process* pcs,
     dwarf2_traverse_context_t   lctx;
     enum location_error         err;
     unsigned int                i;
+    const dwarf2_cuhead_t*      head = get_cuhead_from_func(func);
 
     for (i=0; i<vector_length(&func->vchildren); i++)
     {
@@ -2536,11 +2537,11 @@ static enum location_error loc_compute_frame(struct process* pcs,
                 break;
             case loc_dwarf2_location_list:
                 WARN("Searching loclist for %s\n", debugstr_a(func->hash_elt.name));
-                if (!dwarf2_lookup_loclist(modfmt,
+                if (!dwarf2_lookup_loclist(modfmt, head,
                                            modfmt->u.dwarf2_info->debug_loc.address + pframe->offset,
                                            ip, &lctx))
                     return loc_err_out_of_scope;
-                if ((err = compute_location(modfmt->module, get_cuhead_from_func(func),
+                if ((err = compute_location(modfmt->module, head,
                                             &lctx, frame, pcs->handle, NULL)) < 0) return err;
                 if (frame->kind >= loc_user)
                 {
@@ -3333,6 +3334,7 @@ static void dwarf2_location_compute(struct process* pcs,
     DWORD_PTR                   ip;
     int                         err;
     dwarf2_traverse_context_t   lctx;
+    const dwarf2_cuhead_t*      head = get_cuhead_from_func(func);
 
     if (!func || !symt_check_tag(func->container, SymTagCompiland))
     {
@@ -3350,7 +3352,7 @@ static void dwarf2_location_compute(struct process* pcs,
             {
             case loc_dwarf2_location_list:
                 /* Then, if the variable has a location list, find it !! */
-                if (dwarf2_lookup_loclist(modfmt,
+                if (dwarf2_lookup_loclist(modfmt, head,
                                           modfmt->u.dwarf2_info->debug_loc.address + loc->offset,
                                           ip, &lctx))
                     goto do_compute;
@@ -3366,7 +3368,7 @@ static void dwarf2_location_compute(struct process* pcs,
                 }
             do_compute:
                 /* now get the variable */
-                err = compute_location(modfmt->module, get_cuhead_from_func(func),
+                err = compute_location(modfmt->module, head,
                                        &lctx, loc, pcs->handle, &frame);
                 break;
             case loc_register:




More information about the wine-devel mailing list