RFC: Mark dylib/mach-o on Mac OS X

André Hentschel nerv at dawncrow.de
Tue Aug 27 16:08:05 CDT 2013


Hi,
at [1] i noticed that dylibs are printed as PEs.
This intents to fix that, but i have no Mac, could someone please review/test?

[1] http://test.winehq.org/data/8ef3a142263e6db11f1514f77b3de84c8b08d7a0/mac_fg-snow-macdrv/advapi32:cred.html

diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c
index 6bea436..41fa7e6 100644
--- a/dlls/dbghelp/module.c
+++ b/dlls/dbghelp/module.c
@@ -33,6 +33,7 @@
 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
 const WCHAR        S_ElfW[]         = {'<','e','l','f','>','\0'};
+const WCHAR        S_MachoW[]       = {'<','m','a','c','h','o','>','\0'};
 const WCHAR        S_WineLoaderW[]  = {'<','w','i','n','e','-','l','o','a','d','e','r','>','\0'};
 static const WCHAR S_DotSoW[]       = {'.','s','o','\0'};
 static const WCHAR S_DotDylibW[]    = {'.','d','y','l','i','b','\0'};
@@ -94,6 +95,9 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size)
         if (len > 3 && !strcmpiW(&out[len - 3], S_DotSoW) &&
             (l = match_ext(out, len - 3)))
             strcpyW(&out[len - l - 3], S_ElfW);
+        else if (len > 6 && !strcmpiW(&out[len - 6], S_DotDylibW) &&
+            (l = match_ext(out, len - 6)))
+            strcpyW(&out[len - l - 6], S_MachoW);
     }
     while ((*out = tolowerW(*out))) out++;
 }
diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c
index c0b86ba..c2c7c08 100644
--- a/programs/winedbg/info.c
+++ b/programs/winedbg/info.c
@@ -244,6 +244,11 @@ void info_win32_module(DWORD64 base)
                 }
             }
         }
+        else if (strstr(im.mi[i].ModuleName, "<macho>"))
+        {
+            dbg_printf("MACH-O\t");
+            module_print_info(&im.mi[i], FALSE);
+        }
         else
         {
             /* check module is not embedded in another module */
@@ -253,8 +258,11 @@ void info_win32_module(DWORD64 base)
                     break;
             }
             if (j < im.num_used) continue;
-            if (strstr(im.mi[i].ModuleName, ".so") || strchr(im.mi[i].ModuleName, '<'))
+            if (strstr(im.mi[i].ModuleName, ".so") || strstr(im.mi[i].ModuleName, "<elf>") ||
+                strstr(im.mi[i].ModuleName, "<wine-loader>"))
                 dbg_printf("ELF\t");
+            else if (strstr(im.mi[i].ModuleName, ".dylib") || strstr(im.mi[i].ModuleName, "<macho>"))
+                dbg_printf("MACH-O\t");
             else
                 dbg_printf("PE\t");
             module_print_info(&im.mi[i], FALSE);



More information about the wine-devel mailing list