Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / dll / win32 / dbghelp / dbghelp_ros.diff
1 diff -prudN e:\Wine\dlls\dbghelp/cpu_i386.c e:\reactos-dwarf\dll\win32\dbghelp/cpu_i386.c
2 --- e:\Wine\dlls\dbghelp/cpu_i386.c 2012-12-09 09:57:02.223180200 +0100
3 +++ e:\reactos-dwarf\dll\win32\dbghelp/cpu_i386.c 2013-07-14 16:01:45.804981700 +0100
4 @@ -20,12 +20,17 @@
5
6 #include <assert.h>
7
8 +#ifndef DBGHELP_STATIC_LIB
9 #include "ntstatus.h"
10 -#define WIN32_NO_STATUS
11 +#endif
12 +
13 #include "dbghelp_private.h"
14 +
15 +#ifndef DBGHELP_STATIC_LIB
16 #include "wine/winbase16.h"
17 #include "winternl.h"
18 #include "wine/debug.h"
19 +#endif
20
21 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
22
23 @@ -34,7 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
24
25 #define IS_VM86_MODE(ctx) (ctx->EFlags & V86_FLAG)
26
27 -#ifdef __i386__
28 +
29 +#if defined(__i386__) && !defined(DBGHELP_STATIC_LIB)
30 static ADDRESS_MODE get_selector_type(HANDLE hThread, const CONTEXT* ctx, WORD sel)
31 {
32 LDT_ENTRY le;
33 @@ -73,6 +79,7 @@ static unsigned i386_build_addr(HANDLE h
34 }
35 #endif
36
37 +#ifndef DBGHELP_STATIC_LIB
38 static unsigned i386_get_addr(HANDLE hThread, const CONTEXT* ctx,
39 enum cpu_addr ca, ADDRESS64* addr)
40 {
41 @@ -86,8 +93,9 @@ static unsigned i386_get_addr(HANDLE hTh
42 #endif
43 return FALSE;
44 }
45 +#endif /* DBGHELP_STATIC_LIB */
46
47 -#ifdef __i386__
48 +#if defined(__i386__) && !defined(DBGHELP_STATIC_LIB)
49 /* fetch_next_frame32()
50 *
51 * modify (at least) context.{eip, esp, ebp} using unwind information
52 @@ -110,7 +118,9 @@ static BOOL fetch_next_frame32(struct cp
53 cpair[2].name = "$eip"; cpair[2].pvalue = &context->Eip;
54 cpair[3].name = NULL; cpair[3].pvalue = NULL;
55
56 +#ifndef DBGHELP_STATIC_LIB
57 if (!pdb_virtual_unwind(csw, curr_pc, context, cpair))
58 +#endif
59 {
60 /* do a simple unwind using ebp
61 * we assume a "regular" prologue in the function has been used
62 @@ -148,6 +158,7 @@ enum st_mode {stm_start, stm_32bit, stm_
63 #define set_curr_mode(m) {frame->Reserved[__CurrentModeCount] &= ~0x0F; frame->Reserved[__CurrentModeCount] |= (m & 0x0F);}
64 #define inc_curr_count() (frame->Reserved[__CurrentModeCount] += 0x10)
65
66 +#ifndef DBGHELP_STATIC_LIB
67 static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context)
68 {
69 STACK32FRAME frame32;
70 @@ -513,6 +524,7 @@ done_err:
71 set_curr_mode(stm_done);
72 return FALSE;
73 }
74 +#endif /* DBGHELP_STATIC_LIB */
75
76 static unsigned i386_map_dwarf_register(unsigned regno)
77 {
78 @@ -662,6 +674,7 @@ static const char* i386_fetch_regname(un
79 return NULL;
80 }
81
82 +#ifndef DBGHELP_STATIC_LIB
83 static BOOL i386_fetch_minidump_thread(struct dump_context* dc, unsigned index, unsigned flags, const CONTEXT* ctx)
84 {
85 if (ctx->ContextFlags && (flags & ThreadWriteInstructionWindow))
86 @@ -675,6 +688,7 @@ static BOOL i386_fetch_minidump_thread(s
87
88 return TRUE;
89 }
90 +#endif
91
92 static BOOL i386_fetch_minidump_module(struct dump_context* dc, unsigned index, unsigned flags)
93 {
94 @@ -688,12 +702,22 @@ DECLSPEC_HIDDEN struct cpu cpu_i386 = {
95 IMAGE_FILE_MACHINE_I386,
96 4,
97 CV_REG_EBP,
98 +#ifndef DBGHELP_STATIC_LIB
99 i386_get_addr,
100 i386_stack_walk,
101 +#else
102 + NULL,
103 + NULL,
104 +#endif
105 NULL,
106 i386_map_dwarf_register,
107 i386_fetch_context_reg,
108 i386_fetch_regname,
109 +#ifndef DBGHELP_STATIC_LIB
110 i386_fetch_minidump_thread,
111 i386_fetch_minidump_module,
112 +#else
113 + NULL,
114 + NULL,
115 +#endif
116 };
117 diff -prudN e:\Wine\dlls\dbghelp/cpu_x86_64.c e:\reactos-dwarf\dll\win32\dbghelp/cpu_x86_64.c
118 --- e:\Wine\dlls\dbghelp/cpu_x86_64.c 2012-04-02 20:39:57.749333300 +0100
119 +++ e:\reactos-dwarf\dll\win32\dbghelp/cpu_x86_64.c 2013-07-14 16:01:02.487336800 +0100
120 @@ -302,10 +302,10 @@ static BOOL is_inside_epilog(struct cpu_
121 if ((op0 & 0xf8) == 0x48)
122 {
123 if (!sw_read_mem(csw, pc + 1, &op1, 1)) return FALSE;
124 + if (!sw_read_mem(csw, pc + 2, &op2, 1)) return FALSE;
125 switch (op1)
126 {
127 case 0x81: /* add $nnnn,%rsp */
128 - if (!sw_read_mem(csw, pc + 2, &op2, 1)) return FALSE;
129 if (op0 == 0x48 && op2 == 0xc4)
130 {
131 pc += 7;
132 @@ -313,7 +313,6 @@ static BOOL is_inside_epilog(struct cpu_
133 }
134 return FALSE;
135 case 0x83: /* add $n,%rsp */
136 - if (!sw_read_mem(csw, pc + 2, &op2, 1)) return FALSE;
137 if (op0 == 0x48 && op2 == 0xc4)
138 {
139 pc += 4;
140 @@ -321,7 +320,6 @@ static BOOL is_inside_epilog(struct cpu_
141 }
142 return FALSE;
143 case 0x8d: /* lea n(reg),%rsp */
144 - if (!sw_read_mem(csw, pc + 2, &op2, 1)) return FALSE;
145 if (op0 & 0x06) return FALSE; /* rex.RX must be cleared */
146 if (((op2 >> 3) & 7) != 4) return FALSE; /* dest reg mus be %rsp */
147 if ((op2 & 7) == 4) return FALSE; /* no SIB byte allowed */
148 diff -prudN e:\Wine\dlls\dbghelp/dbghelp.c e:\reactos-dwarf\dll\win32\dbghelp/dbghelp.c
149 --- e:\Wine\dlls\dbghelp/dbghelp.c 2013-03-16 11:54:52.395468000 +0100
150 +++ e:\reactos-dwarf\dll\win32\dbghelp/dbghelp.c 2013-07-17 21:37:35.292366600 +0100
151 @@ -21,11 +21,14 @@
152 #include "config.h"
153
154 #include "dbghelp_private.h"
155 +#include "wdbgexts.h"
156 +
157 +#ifndef DBGHELP_STATIC_LIB
158 #include "winerror.h"
159 #include "psapi.h"
160 #include "wine/debug.h"
161 -#include "wdbgexts.h"
162 #include "winnls.h"
163 +#endif
164
165 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
166
167 @@ -133,6 +136,7 @@ void* fetch_buffer(struct process* pcs,
168 return pcs->buffer;
169 }
170
171 +#ifndef DBGHELP_STATIC_LIB
172 const char* wine_dbgstr_addr(const ADDRESS64* addr)
173 {
174 if (!addr) return "(null)";
175 @@ -150,12 +154,18 @@ const char* wine_dbgstr_addr(const ADDRE
176 return "unknown";
177 }
178 }
179 +#endif
180
181 extern struct cpu cpu_i386, cpu_x86_64, cpu_ppc, cpu_arm, cpu_arm64;
182
183 +#ifndef DBGHELP_STATIC_LIB
184 static struct cpu* dbghelp_cpus[] = {&cpu_i386, &cpu_x86_64, &cpu_ppc, &cpu_arm, &cpu_arm64, NULL};
185 +#else
186 +static struct cpu* dbghelp_cpus[] = {&cpu_i386, NULL};
187 +#endif
188 +
189 struct cpu* dbghelp_current_cpu =
190 -#if defined(__i386__)
191 +#if defined(__i386__) || defined(DBGHELP_STATIC_LIB)
192 &cpu_i386
193 #elif defined(__x86_64__)
194 &cpu_x86_64
195 @@ -280,8 +290,10 @@ static BOOL check_live_target(struct pro
196 {
197 if (!GetProcessId(pcs->handle)) return FALSE;
198 if (GetEnvironmentVariableA("DBGHELP_NOLIVE", NULL, 0)) return FALSE;
199 +#ifndef DBGHELP_STATIC_LIB
200 if (!elf_read_wine_loader_dbg_info(pcs))
201 macho_read_wine_loader_dbg_info(pcs);
202 +#endif
203 return TRUE;
204 }
205
206 @@ -370,7 +382,8 @@ BOOL WINAPI SymInitializeW(HANDLE hProce
207 pcs->dbg_hdr_addr = 0;
208 pcs->next = process_first;
209 process_first = pcs;
210 -
211 +
212 +#ifndef DBGHELP_STATIC_LIB
213 if (check_live_target(pcs))
214 {
215 if (fInvadeProcess)
216 @@ -384,6 +397,7 @@ BOOL WINAPI SymInitializeW(HANDLE hProce
217 SetLastError(ERROR_INVALID_PARAMETER);
218 return FALSE;
219 }
220 +#endif
221
222 return TRUE;
223 }
224
225 diff -prudN e:\Wine\dlls\dbghelp/dbghelp_private.h e:\reactos-dwarf\dll\win32\dbghelp/dbghelp_private.h
226 --- e:\Wine\dlls\dbghelp/dbghelp_private.h 2012-04-02 20:39:57.749333300 +0100
227 +++ e:\reactos-dwarf\dll\win32\dbghelp/dbghelp_private.h 2013-07-14 16:01:46.453826200 +0100
228 @@ -21,19 +21,30 @@
229 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
230 */
231
232 +#define WIN32_NO_STATUS
233 +#define _INC_WINDOWS
234 +#define COM_NO_WINDOWS_H
235 +
236 #include <stdarg.h>
237 -#include "windef.h"
238 -#include "winbase.h"
239 -#include "winver.h"
240 -#include "dbghelp.h"
241 -#include "objbase.h"
242 -#include "oaidl.h"
243 -#include "winnls.h"
244 -#include "wine/list.h"
245 -#include "wine/unicode.h"
246 -#include "wine/rbtree.h"
247
248 -#include "cvconst.h"
249 +#ifndef DBGHELP_STATIC_LIB
250 +#include <windef.h>
251 +#include <winbase.h>
252 +#include <winver.h>
253 +#include <dbghelp.h>
254 +#include <objbase.h>
255 +#include <cvconst.h>
256 +#include <wine/unicode.h>
257 +#else
258 +#include <string.h>
259 +#include "compat.h"
260 +#endif
261 +
262 +//#include "oaidl.h"
263 +//#include "winnls.h"
264 +#include <wine/list.h>
265 +#include <wine/rbtree.h>
266 +
267
268 /* #define USE_STATS */
269
270 @@ -671,7 +682,9 @@ extern BOOL dwarf2_virtual_unwin
271 CONTEXT* context, ULONG_PTR* cfa) DECLSPEC_HIDDEN;
272
273 /* stack.c */
274 +#ifndef DBGHELP_STATIC_LIB
275 extern BOOL sw_read_mem(struct cpu_stack_walk* csw, DWORD64 addr, void* ptr, DWORD sz) DECLSPEC_HIDDEN;
276 +#endif
277 extern DWORD64 sw_xlat_addr(struct cpu_stack_walk* csw, ADDRESS64* addr) DECLSPEC_HIDDEN;
278 extern void* sw_table_access(struct cpu_stack_walk* csw, DWORD64 addr) DECLSPEC_HIDDEN;
279 extern DWORD64 sw_module_base(struct cpu_stack_walk* csw, DWORD64 addr) DECLSPEC_HIDDEN;
280
281 diff -prudN e:\Wine\dlls\dbghelp/dwarf.c e:\reactos-dwarf\dll\win32\dbghelp/dwarf.c
282 --- e:\Wine\dlls\dbghelp/dwarf.c 2013-03-02 14:17:59.439371000 +0100
283 +++ e:\reactos-dwarf\dll\win32\dbghelp/dwarf.c 2013-07-14 16:01:46.490851000 +0100
284 @@ -22,23 +22,23 @@
285
286 #define NONAMELESSUNION
287
288 -#include "config.h"
289 +#include <config.h>
290
291 -#include <sys/types.h>
292 -#include <fcntl.h>
293 +//#include <sys/types.h>
294 +//#include <fcntl.h>
295 #ifdef HAVE_SYS_STAT_H
296 # include <sys/stat.h>
297 #endif
298 #ifdef HAVE_SYS_MMAN_H
299 #include <sys/mman.h>
300 #endif
301 -#include <limits.h>
302 -#include <stdlib.h>
303 -#include <string.h>
304 +//#include <limits.h>
305 +//#include <stdlib.h>
306 +//#include <string.h>
307 #ifdef HAVE_UNISTD_H
308 # include <unistd.h>
309 #endif
310 -#include <stdio.h>
311 +//#include <stdio.h>
312 #include <assert.h>
313 #include <stdarg.h>
314
315 @@ -46,18 +46,20 @@
316 #include <zlib.h>
317 #endif
318
319 -#include "windef.h"
320 -#include "winternl.h"
321 -#include "winbase.h"
322 -#include "winuser.h"
323 -#include "ole2.h"
324 -#include "oleauto.h"
325 +//#include "windef.h"
326 +//#include "winbase.h"
327 +//#include "winuser.h"
328 +//#include "ole2.h"
329 +//#include "oleauto.h"
330 +
331 +#ifndef DBGHELP_STATIC_LIB
332 +#include <winternl.h>
333 +#include <wine/debug.h>
334 +#endif
335
336 #include "dbghelp_private.h"
337 #include "image_private.h"
338
339 -#include "wine/debug.h"
340 -
341 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_dwarf);
342
343 /* FIXME:
344 @@ -1888,8 +1890,10 @@ static struct symt* dwarf2_parse_subprog
345 * (not the case for stabs), we just drop Wine's thunks here...
346 * Actual thunks will be created in elf_module from the symbol table
347 */
348 +#ifndef DBGHELP_STATIC_LIB
349 if (elf_is_in_thunk_area(ctx->load_offset + low_pc, ctx->thunks) >= 0)
350 return NULL;
351 +#endif
352 if (!(ret_type = dwarf2_lookup_type(ctx, di)))
353 {
354 ret_type = ctx->symt_cache[sc_void];
355 diff -prudN e:\Wine\dlls\dbghelp/dwarf.h e:\reactos-dwarf\dll\win32\dbghelp/dwarf.h
356 --- e:\Wine\dlls\dbghelp/dwarf.h 2011-09-16 23:22:36.194780200 +0100
357 +++ e:\reactos-dwarf\dll\win32\dbghelp/dwarf.h 2013-07-14 16:01:46.862099400 +0100
358 @@ -554,3 +554,15 @@ enum dwarf_call_frame_info
359 #define DW_INL_inlined 0x01
360 #define DW_INL_declared_not_inlined 0x02
361 #define DW_INL_declared_inlined 0x03
362 +
363 +#ifdef DBGHELP_STATIC_LIB
364 +/* from stack.c */
365 +static BOOL sw_read_mem(struct cpu_stack_walk* csw, DWORD64 addr, void* ptr, DWORD sz)
366 +{
367 + DWORD bytes_read = 0;
368 + if (csw->is32)
369 + return csw->u.s32.f_read_mem(csw->hProcess, addr, ptr, sz, &bytes_read);
370 + else
371 + return csw->u.s64.f_read_mem(csw->hProcess, addr, ptr, sz, &bytes_read);
372 +}
373 +#endif
374
375 diff -prudN e:\Wine\dlls\dbghelp/image_private.h e:\reactos-dwarf\dll\win32\dbghelp/image_private.h
376 --- e:\Wine\dlls\dbghelp/image_private.h 2012-04-02 20:39:57.752333500 +0100
377 +++ e:\reactos-dwarf\dll\win32\dbghelp/image_private.h 2013-07-14 16:01:46.946185400 +0100
378 @@ -45,7 +45,7 @@
379
380 #define IMAGE_NO_MAP ((void*)-1)
381
382 -#ifdef __ELF__
383 +#if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB)
384
385 #ifdef _WIN64
386 #define Elf_Ehdr Elf64_Ehdr
387 @@ -85,7 +85,7 @@ struct image_file_map
388 const char* shstrtab;
389 struct image_file_map* alternate; /* another ELF file (linked to this one) */
390 char* target_copy;
391 -#ifdef __ELF__
392 +#if defined(__ELF__) && !defined(DBGHELP_STATIC_LIB)
393 Elf_Ehdr elfhdr;
394 struct
395 {
396 @@ -135,7 +135,9 @@ static inline BOOL image_find_section(st
397 {
398 switch (fmap->modtype)
399 {
400 +#ifndef DBGHELP_STATIC_LIB
401 case DMT_ELF: return elf_find_section(fmap, name, SHT_NULL, ism);
402 +#endif
403 case DMT_PE: return pe_find_section(fmap, name, ism);
404 default: assert(0); return FALSE;
405 }
406 @@ -146,7 +148,9 @@ static inline const char* image_map_sect
407 if (!ism->fmap) return NULL;
408 switch (ism->fmap->modtype)
409 {
410 +#ifndef DBGHELP_STATIC_LIB
411 case DMT_ELF: return elf_map_section(ism);
412 +#endif
413 case DMT_PE: return pe_map_section(ism);
414 default: assert(0); return NULL;
415 }
416 @@ -157,7 +161,9 @@ static inline void image_unmap_section(s
417 if (!ism->fmap) return;
418 switch (ism->fmap->modtype)
419 {
420 +#ifndef DBGHELP_STATIC_LIB
421 case DMT_ELF: elf_unmap_section(ism); break;
422 +#endif
423 case DMT_PE: pe_unmap_section(ism); break;
424 default: assert(0); return;
425 }
426 @@ -168,7 +174,9 @@ static inline DWORD_PTR image_get_map_rv
427 if (!ism->fmap) return 0;
428 switch (ism->fmap->modtype)
429 {
430 +#ifndef DBGHELP_STATIC_LIB
431 case DMT_ELF: return elf_get_map_rva(ism);
432 +#endif
433 case DMT_PE: return pe_get_map_rva(ism);
434 default: assert(0); return 0;
435 }
436 @@ -179,7 +187,9 @@ static inline unsigned image_get_map_siz
437 if (!ism->fmap) return 0;
438 switch (ism->fmap->modtype)
439 {
440 +#ifndef DBGHELP_STATIC_LIB
441 case DMT_ELF: return elf_get_map_size(ism);
442 +#endif
443 case DMT_PE: return pe_get_map_size(ism);
444 default: assert(0); return 0;
445 }
446
447 diff -prudN e:\Wine\dlls\dbghelp/module.c e:\reactos-dwarf\dll\win32\dbghelp/module.c
448 --- e:\Wine\dlls\dbghelp/module.c 2012-09-09 19:47:53.367024200 +0100
449 +++ e:\reactos-dwarf\dll\win32\dbghelp/module.c 2013-07-14 16:01:46.973202500 +0100
450 @@ -19,16 +19,19 @@
451 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
452 */
453
454 -#include "config.h"
455 -#include <stdlib.h>
456 -#include <stdio.h>
457 -#include <string.h>
458 +#include <config.h>
459 +//#include <stdlib.h>
460 +//#include <stdio.h>
461 +//#include <string.h>
462 #include <assert.h>
463
464 #include "dbghelp_private.h"
465 -#include "psapi.h"
466 -#include "winternl.h"
467 -#include "wine/debug.h"
468 +
469 +#ifndef DBGHELP_STATIC_LIB
470 +#include <psapi.h>
471 +#include <wine/debug.h>
472 +#endif
473 +//#include "winternl.h"
474
475 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
476
477 @@ -346,9 +349,11 @@ BOOL module_get_debug(struct module_pair
478 if (pair->effective->is_virtual) ret = FALSE;
479 else switch (pair->effective->type)
480 {
481 +#ifndef DBGHELP_STATIC_LIB
482 case DMT_ELF:
483 ret = elf_load_debug_info(pair->effective);
484 break;
485 +#endif
486 case DMT_PE:
487 idslW64.SizeOfStruct = sizeof(idslW64);
488 idslW64.BaseOfImage = pair->effective->module.BaseOfImage;
489 @@ -365,9 +370,11 @@ BOOL module_get_debug(struct module_pair
490 ret ? CBA_DEFERRED_SYMBOL_LOAD_COMPLETE : CBA_DEFERRED_SYMBOL_LOAD_FAILURE,
491 &idslW64);
492 break;
493 +#ifndef DBGHELP_STATIC_LIB
494 case DMT_MACHO:
495 ret = macho_load_debug_info(pair->effective, NULL);
496 break;
497 +#endif
498 default:
499 ret = FALSE;
500 break;
501 @@ -506,11 +513,13 @@ enum module_type module_get_type_by_name
502 /******************************************************************
503 * refresh_module_list
504 */
505 +#ifndef DBGHELP_STATIC_LIB
506 static BOOL refresh_module_list(struct process* pcs)
507 {
508 /* force transparent ELF and Mach-O loading / unloading */
509 return elf_synchronize_module_list(pcs) || macho_synchronize_module_list(pcs);
510 }
511 +#endif
512
513 /***********************************************************************
514 * SymLoadModule (DBGHELP.@)
515 @@ -594,7 +603,9 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE
516 if (Flags & ~(SLMFLAG_VIRTUAL))
517 FIXME("Unsupported Flags %08x for %s\n", Flags, debugstr_w(wImageName));
518
519 +#ifndef DBGHELP_STATIC_LIB
520 refresh_module_list(pcs);
521 +#endif
522
523 /* this is a Wine extension to the API just to redo the synchronisation */
524 if (!wImageName && !hFile) return 0;
525 @@ -618,6 +629,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE
526 wImageName)
527 {
528 /* and finally an ELF or Mach-O module */
529 +#ifndef DBGHELP_STATIC_LIB
530 switch (module_get_type_by_name(wImageName))
531 {
532 case DMT_ELF:
533 @@ -630,6 +642,7 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE
534 /* Ignored */
535 break;
536 }
537 +#endif
538 }
539 }
540 if (!module)
541 @@ -819,6 +832,7 @@ BOOL WINAPI SymEnumerateModulesW64(HAND
542 return TRUE;
543 }
544
545 +#ifndef DBGHELP_STATIC_LIB
546 /******************************************************************
547 * EnumerateLoadedModules64 (DBGHELP.@)
548 *
549 @@ -919,6 +933,7 @@ BOOL WINAPI EnumerateLoadedModulesW64(H
550
551 return sz != 0 && i == sz;
552 }
553 +#endif /* DBGHELP_STATIC_LIB */
554
555 /******************************************************************
556 * SymGetModuleInfo (DBGHELP.@)
557 @@ -1131,7 +1146,11 @@ BOOL WINAPI SymRefreshModuleList(HANDLE
558
559 if (!(pcs = process_find_by_handle(hProcess))) return FALSE;
560
561 +#ifndef DBGHELP_STATIC_LIB
562 return refresh_module_list(pcs);
563 +#else
564 + return TRUE;
565 +#endif
566 }
567
568 /***********************************************************************
569
570 diff -prudN e:\Wine\dlls\dbghelp/pe_module.c e:\reactos-dwarf\dll\win32\dbghelp/pe_module.c
571 --- e:\Wine\dlls\dbghelp/pe_module.c 2012-04-02 20:39:57.755333700 +0100
572 +++ e:\reactos-dwarf\dll\win32\dbghelp/pe_module.c 2013-07-14 17:06:18.750513200 +0100
573 @@ -31,8 +31,10 @@
574
575 #include "dbghelp_private.h"
576 #include "image_private.h"
577 +#ifndef DBGHELP_STATIC_LIB
578 #include "winternl.h"
579 #include "wine/debug.h"
580 +#endif
581
582 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
583
584 @@ -526,6 +528,7 @@ static BOOL pe_load_dwarf(struct module*
585 return ret;
586 }
587
588 +#ifndef DBGHELP_STATIC_LIB
589 /******************************************************************
590 * pe_load_dbg_file
591 *
592 @@ -625,6 +628,7 @@ done:
593 pe_unmap_full(fmap);
594 return ret;
595 }
596 +#endif /* DBGHELP_STATIC_LIB */
597
598 /***********************************************************************
599 * pe_load_export_debug_info
600 @@ -721,7 +725,9 @@ BOOL pe_load_debug_info(const struct pro
601 {
602 ret = pe_load_stabs(pcs, module);
603 ret = pe_load_dwarf(module) || ret;
604 + #ifndef DBGHELP_STATIC_LIB
605 ret = pe_load_msc_debug_info(pcs, module) || ret;
606 + #endif
607 ret = ret || pe_load_coff_symbol_table(module); /* FIXME */
608 /* if we still have no debug info (we could only get SymExport at this
609 * point), then do the SymExport except if we have an ELF container,
610
611 diff -prudN e:\Wine\dlls\dbghelp/source.c e:\reactos-dwarf\dll\win32\dbghelp/source.c
612 --- e:\Wine\dlls\dbghelp/source.c 2011-09-16 23:22:36.198780400 +0100
613 +++ e:\reactos-dwarf\dll\win32\dbghelp/source.c 2013-07-14 16:01:47.027608100 +0100
614 @@ -18,14 +18,17 @@
615 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
616 *
617 */
618 -#include "config.h"
619 -#include <stdlib.h>
620 -#include <stdio.h>
621 -#include <string.h>
622 +#include <config.h>
623 +//#include <stdlib.h>
624 +//#include <stdio.h>
625 +//#include <string.h>
626 #include <assert.h>
627
628 #include "dbghelp_private.h"
629 -#include "wine/debug.h"
630 +
631 +#ifndef DBGHELP_STATIC_LIB
632 +#include <wine/debug.h>
633 +#endif
634
635 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
636
637 diff -prudN e:\Wine\dlls\dbghelp/stabs.c e:\reactos-dwarf\dll\win32\dbghelp/stabs.c
638 --- e:\Wine\dlls\dbghelp/stabs.c 2012-08-13 02:55:03.317206300 +0100
639 +++ e:\reactos-dwarf\dll\win32\dbghelp/stabs.c 2013-07-14 17:06:14.969603400 +0100
640 @@ -29,41 +29,47 @@
641 * available (hopefully) from http://sources.redhat.com/gdb/onlinedocs
642 */
643
644 -#include "config.h"
645 -#include "wine/port.h"
646 +#include <config.h>
647 +//#include "wine/port.h"
648
649 -#include <sys/types.h>
650 -#include <fcntl.h>
651 +//#include <sys/types.h>
652 +//#include <fcntl.h>
653 #ifdef HAVE_SYS_STAT_H
654 # include <sys/stat.h>
655 #endif
656 #ifdef HAVE_SYS_MMAN_H
657 #include <sys/mman.h>
658 #endif
659 -#include <limits.h>
660 -#include <stdlib.h>
661 -#include <string.h>
662 +//#include <limits.h>
663 +//#include <stdlib.h>
664 +//#include <string.h>
665 #ifdef HAVE_UNISTD_H
666 # include <unistd.h>
667 #endif
668 -#include <stdio.h>
669 +//#include <stdio.h>
670 #include <assert.h>
671 -#include <stdarg.h>
672 +//#include <stdarg.h>
673
674 #ifdef HAVE_MACH_O_NLIST_H
675 # include <mach-o/nlist.h>
676 #endif
677
678 -#include "windef.h"
679 -#include "winbase.h"
680 -#include "winnls.h"
681 +//#include "windef.h"
682 +//#include "winbase.h"
683 +//#include "winnls.h"
684
685 #include "dbghelp_private.h"
686
687 -#include "wine/debug.h"
688 +#ifndef DBGHELP_STATIC_LIB
689 +#include <wine/debug.h>
690 +#endif
691
692 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_stabs);
693
694 +#ifndef DBGHELP_STATIC_LIB
695 +#define strtoull _strtoui64
696 +#endif
697 +
698 /* Masks for n_type field */
699 #ifndef N_STAB
700 #define N_STAB 0xe0
701
702 diff -prudN e:\Wine\dlls\dbghelp/storage.c e:\reactos-dwarf\dll\win32\dbghelp/storage.c
703 --- e:\Wine\dlls\dbghelp/storage.c 2011-09-16 23:22:36.199780500 +0100
704 +++ e:\reactos-dwarf\dll\win32\dbghelp/storage.c 2013-07-14 16:01:47.077595900 +0100
705 @@ -23,7 +23,10 @@
706 #include "config.h"
707 #include <assert.h>
708 #include <stdlib.h>
709 +
710 +#ifndef DBGHELP_STATIC_LIB
711 #include "wine/debug.h"
712 +#endif
713
714 #include "dbghelp_private.h"
715 #ifdef USE_STATS
716
717 diff -prudN e:\Wine\dlls\dbghelp/symbol.c e:\reactos-dwarf\dll\win32\dbghelp/symbol.c
718 --- e:\Wine\dlls\dbghelp/symbol.c 2012-04-02 20:39:57.756333700 +0100
719 +++ e:\reactos-dwarf\dll\win32\dbghelp/symbol.c 2013-07-17 04:29:08.161225800 +0100
720 @@ -31,9 +31,12 @@
721 #include <sys/types.h>
722 #include <assert.h>
723
724 -#include "wine/debug.h"
725 #include "dbghelp_private.h"
726 +
727 +#ifndef DBGHELP_STATIC_LIB
728 +#include "wine/debug.h"
729 #include "winnls.h"
730 +#endif
731
732 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
733 WINE_DECLARE_DEBUG_CHANNEL(dbghelp_symt);
734 diff -prudN e:\Wine\dlls\dbghelp/type.c e:\reactos-dwarf\dll\win32\dbghelp/type.c
735 --- e:\Wine\dlls\dbghelp/type.c 2012-04-02 20:39:57.756333700 +0100
736 +++ e:\reactos-dwarf\dll\win32\dbghelp/type.c 2013-07-14 16:01:47.136913600 +0100
737 @@ -29,10 +29,13 @@
738 #include <stdarg.h>
739 #include <assert.h>
740
741 +#ifndef DBGHELP_STATIC_LIB
742 #include "windef.h"
743 #include "winbase.h"
744 #include "winnls.h"
745 #include "wine/debug.h"
746 +#endif
747 +
748 #include "dbghelp_private.h"
749
750 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);