https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b991284341c1388a66a0b416e0ce789a636a7af8

commit b991284341c1388a66a0b416e0ce789a636a7af8
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 19:00:45 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:35:57 2020 +0200

    [WINESYNC] dbghelp: Always build all loader backends.
    
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 131fb79535c74e8011ac82c279f6f4a9d971e1af by Jacek Caban 
<[email protected]>
---
 dll/win32/dbghelp/CMakeLists.txt    |  4 ++--
 dll/win32/dbghelp/dbghelp.c         | 14 +++++++++-----
 dll/win32/dbghelp/dbghelp_private.h |  6 +++++-
 dll/win32/dbghelp/dwarf.c           |  2 +-
 dll/win32/dbghelp/elf_module.c      | 28 ----------------------------
 dll/win32/dbghelp/macho_module.c    | 14 --------------
 sdk/tools/winesync/dbghelp.cfg      |  2 +-
 7 files changed, 18 insertions(+), 52 deletions(-)

diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt
index c4e3929e7b9..444c128540d 100644
--- a/dll/win32/dbghelp/CMakeLists.txt
+++ b/dll/win32/dbghelp/CMakeLists.txt
@@ -55,9 +55,9 @@ else()
         cpu_x86_64.c
         dbghelp.c
         dwarf.c
-        elf_module.c
+#       elf_module.c
         image.c
-        macho_module.c
+#       macho_module.c
         minidump.c
         module.c
         msc.c
diff --git a/dll/win32/dbghelp/dbghelp.c b/dll/win32/dbghelp/dbghelp.c
index a92b3dd2893..5d9bdfeef5e 100644
--- a/dll/win32/dbghelp/dbghelp.c
+++ b/dll/win32/dbghelp/dbghelp.c
@@ -73,13 +73,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
 
 unsigned   dbghelp_options = SYMOPT_UNDNAME;
 BOOL       dbghelp_opt_native = FALSE;
-#ifndef __REACTOS__
+#ifndef DBGHELP_STATIC_LIB
 SYSTEM_INFO sysinfo;
 #endif
 
 static struct process* process_first /* = NULL */;
 
-#ifndef __REACTOS__
+#ifndef DBGHELP_STATIC_LIB
 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
 {
     switch (reason)
@@ -266,6 +266,7 @@ BOOL WINAPI SymGetSearchPath(HANDLE hProcess, PSTR 
szSearchPath,
     return ret;
 }
 
+#ifndef DBGHELP_STATIC_LIB
 /******************************************************************
  *             invade_process
  *
@@ -284,7 +285,6 @@ static BOOL WINAPI process_invade_cb(PCWSTR name, ULONG64 
base, ULONG size, PVOI
     return TRUE;
 }
 
-#ifndef DBGHELP_STATIC_LIB
 /******************************************************************
  *             check_live_target
  *
@@ -313,10 +313,12 @@ static BOOL check_live_target(struct process* pcs)
     /* Wine store their loader base address in peb.reserved[0] and load its 
symbol from there.
      * ReactOS does not care about it */
     if (!base) return FALSE;
-#endif
 
     TRACE("got debug info address %#lx from PEB %p\n", base, 
pbi.PebBaseAddress);
     return elf_read_wine_loader_dbg_info(pcs, base) || 
macho_read_wine_loader_dbg_info(pcs, base);
+#else
+    return TRUE;
+#endif
 }
 #endif
 
@@ -423,12 +425,14 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR 
UserSearchPath, BOOL fInvadeP
         pcs->loader->synchronize_module_list(pcs);
     }
     else if (fInvadeProcess)
+#else
+    if (fInvadeProcess)
+#endif
     {
         SymCleanup(hProcess);
         SetLastError(ERROR_INVALID_PARAMETER);
         return FALSE;
     }
-#endif
 
     return TRUE;
 }
diff --git a/dll/win32/dbghelp/dbghelp_private.h 
b/dll/win32/dbghelp/dbghelp_private.h
index 4d5aed1aeb1..3dba350f405 100644
--- a/dll/win32/dbghelp/dbghelp_private.h
+++ b/dll/win32/dbghelp/dbghelp_private.h
@@ -128,7 +128,7 @@ void*    hash_table_iter_up(struct hash_table_iter* hti) 
DECLSPEC_HIDDEN;
 
 extern unsigned dbghelp_options DECLSPEC_HIDDEN;
 extern BOOL     dbghelp_opt_native DECLSPEC_HIDDEN;
-#ifndef __REACTOS__
+#ifndef DBGHELP_STATIC_LIB
 extern SYSTEM_INFO sysinfo DECLSPEC_HIDDEN;
 #endif
 
@@ -635,6 +635,7 @@ extern const char*  wine_dbgstr_addr(const ADDRESS64* addr) 
DECLSPEC_HIDDEN;
 extern struct cpu*  cpu_find(DWORD) DECLSPEC_HIDDEN;
 extern DWORD calc_crc32(HANDLE handle) DECLSPEC_HIDDEN;
 
+#ifndef __REACTOS__
 /* elf_module.c */
 extern BOOL         elf_read_wine_loader_dbg_info(struct process* pcs, 
ULONG_PTR addr) DECLSPEC_HIDDEN;
 struct elf_thunk_area;
@@ -642,6 +643,9 @@ extern int          elf_is_in_thunk_area(ULONG_PTR addr, 
const struct elf_thunk_
 
 /* macho_module.c */
 extern BOOL         macho_read_wine_loader_dbg_info(struct process* pcs, 
ULONG_PTR addr) DECLSPEC_HIDDEN;
+#else
+struct elf_thunk_area;
+#endif
 
 /* minidump.c */
 void minidump_add_memory_block(struct dump_context* dc, ULONG64 base, ULONG 
size, ULONG rva) DECLSPEC_HIDDEN;
diff --git a/dll/win32/dbghelp/dwarf.c b/dll/win32/dbghelp/dwarf.c
index 765d73ce645..217b71df32f 100644
--- a/dll/win32/dbghelp/dwarf.c
+++ b/dll/win32/dbghelp/dwarf.c
@@ -1950,7 +1950,7 @@ static struct symt* 
dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
      * (not the case for stabs), we just drop Wine's thunks here...
      * Actual thunks will be created in elf_module from the symbol table
      */
-#ifndef DBGHELP_STATIC_LIB
+#ifndef __REACTOS__
     if (elf_is_in_thunk_area(ctx->load_offset + low_pc, ctx->thunks) >= 0)
         return NULL;
 #endif
diff --git a/dll/win32/dbghelp/elf_module.c b/dll/win32/dbghelp/elf_module.c
index 96c7484cef5..72e9d2124a2 100644
--- a/dll/win32/dbghelp/elf_module.c
+++ b/dll/win32/dbghelp/elf_module.c
@@ -19,13 +19,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
-#if defined(__svr4__) || defined(__sun)
-#define __ELF__ 1
-#endif
-
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -37,8 +30,6 @@
 #include "wine/debug.h"
 #include "wine/heap.h"
 
-#ifdef __ELF__
-
 #define ELF_INFO_DEBUG_HEADER   0x0001
 #define ELF_INFO_MODULE         0x0002
 #define ELF_INFO_NAME           0x0004
@@ -1778,22 +1769,3 @@ BOOL elf_read_wine_loader_dbg_info(struct process* pcs, 
ULONG_PTR addr)
     pcs->loader = &elf_loader_ops;
     return TRUE;
 }
-
-#else  /* !__ELF__ */
-
-BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap)
-{
-    return FALSE;
-}
-
-BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr)
-{
-    return FALSE;
-}
-
-int elf_is_in_thunk_area(ULONG_PTR addr,
-                         const struct elf_thunk_area* thunks)
-{
-    return -1;
-}
-#endif  /* __ELF__ */
diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index 3ef65af7c97..4baf444f9e8 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -21,9 +21,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include "wine/port.h"
-
 #include <stdio.h>
 #include <assert.h>
 #include <stdarg.h>
@@ -42,8 +39,6 @@
 #include "wine/debug.h"
 #include "wine/heap.h"
 
-#ifdef HAVE_MACH_O_LOADER_H
-
 struct dyld_image_info32
 {
     UINT32  imageLoadAddress;  /* const struct mach_header* */
@@ -1933,12 +1928,3 @@ BOOL macho_read_wine_loader_dbg_info(struct process* 
pcs, ULONG_PTR addr)
     TRACE("Found macho debug header %#lx\n", pcs->dbg_hdr_addr);
     return TRUE;
 }
-
-#else  /* HAVE_MACH_O_LOADER_H */
-
-BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr)
-{
-    return FALSE;
-}
-
-#endif  /* HAVE_MACH_O_LOADER_H */
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index e5d1d0ed4b4..c92ba2a24a3 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
   include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
 tags:
-  wine: 9896f1ce33561771989d3117c1536fb472df8558
+  wine: 131fb79535c74e8011ac82c279f6f4a9d971e1af

Reply via email to