dwarf.c small botch

David Anderson davea42 at earthlink.net
Tue Oct 24 23:05:21 CDT 2006


When using gcc 4.0.2 to build wine (Fedora Core 4)
there are lots of messages "What the heck" from winedbg.
So many as to be overwhelming.

This is because subprograms are getting dwarf2 loclists generated by gcc 
and
the code is not expecting those.

dlls/dbghelp/dwarf.c

This is not a real fix, just papers over the excessive warnings.
My apologies if this is the wrong  format (meaning the attachment) for such
a git-diff to be presented.
David Anderson
-------------- next part --------------
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index b1c8572..f63d099 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1095,7 +1095,7 @@ static unsigned dwarf2_map_register(int 
 
     switch (regno)
     {
-    case Wine_DW_no_register: FIXME("What the heck\n"); reg = 0; break;
+    case Wine_DW_no_register: FIXME("What the heck map reg 0x%x\n",(unsigned int)regno); reg = 0; break;
     /* FIXME: this is a dirty hack */
     case Wine_DW_frame_register: reg = 0;          break;
     case  0: reg = CV_REG_EAX; break;
@@ -1394,8 +1394,16 @@ static struct symt* dwarf2_parse_subprog
 
     subpgm.ctx = ctx;
     subpgm.compiland = compiland;
-    if (dwarf2_compute_location(ctx, di, DW_AT_frame_base, &subpgm.frame_offset, &subpgm.frame_reg))
+    if (dwarf2_compute_location(ctx, di, DW_AT_frame_base, &subpgm.frame_offset, &subpgm.frame_reg)) {
         TRACE("For %s got %ld/%d\n", name.u.string, subpgm.frame_offset, subpgm.frame_reg);
+	if (subpgm.frame_reg == Wine_DW_no_register) {
+	   /* Likely a constant, meaning a location list offset.
+	      We do not handle those yet. */
+           /*FIXME("need to handle location lists\n"); */
+           subpgm.frame_reg = 0;
+           subpgm.frame_offset = 0;
+	}
+    }
     else /* on stack !! */
     {
         subpgm.frame_reg = 0;


More information about the wine-patches mailing list