Am 29.08.2013 19:52, schrieb André Hentschel:
Hi, thank you both for the comments, i'll see what i can do.
How about that?
diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 6bea436..ed1d9c0 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'}; @@ -89,12 +90,19 @@ static void module_fill_module(const WCHAR* in, WCHAR* out, size_t size) out[len - l] = '\0'; else if (len > strlenW(loader) && !strcmpiW(out + len - strlenW(loader), loader)) lstrcpynW(out, S_WineLoaderW, size); - else - { - 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 > 3 && !strcmpiW(&out[len - 3], S_DotSoW) && (l = match_ext(out, len - 3))) + switch (module_get_type_by_name(out)) + { + case DMT_ELF: + strcpyW(&out[len - l - 3], S_ElfW); + break; + case DMT_MACHO: + strcpyW(&out[len - l - 3], S_MachoW); + break; + default: + break; + } + while ((*out = tolowerW(*out))) out++; }
diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index c0b86ba..0667ad7 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, "<mach-o>")) + { + dbg_printf("Mach-O\t"); + module_print_info(&im.mi[i], FALSE); + } else { /* check module is not embedded in another module */ @@ -253,7 +258,15 @@ 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, "<wine-loader>")) +#ifdef __APPLE__ + dbg_printf("Mach-O\t"); +#else + dbg_printf("ELF\t"); +#endif + else if (strstr(im.mi[i].ModuleName, ".dylib") || strstr(im.mi[i].ModuleName, "<mach-o>")) + dbg_printf("Mach-O\t"); + else if (strstr(im.mi[i].ModuleName, ".so") || strstr(im.mi[i].ModuleName, "<elf>")) dbg_printf("ELF\t"); else dbg_printf("PE\t"); diff --git a/programs/winedbg/symbol.c b/programs/winedbg/symbol.c index 99b382d..b8092ae 100644 --- a/programs/winedbg/symbol.c +++ b/programs/winedbg/symbol.c @@ -779,6 +779,8 @@ static BOOL CALLBACK symbols_info_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx) size_t len = strlen(mi.ModuleName); if (len > 5 && !strcmp(mi.ModuleName + len - 5, "<elf>")) mi.ModuleName[len - 5] = '\0'; + else if (len > 8 && !strcmp(mi.ModuleName + len - 8, "<mach-o>")) + mi.ModuleName[len - 8] = '\0'; }
dbg_printf("%08lx: %s!%s", (ULONG_PTR)sym->Address, mi.ModuleName, sym->Name);