mirror of
https://github.com/reactos/reactos.git
synced 2024-09-11 05:12:43 +00:00
Fix import of DBGHELP:
- StackWalk is now compilable. - SymInitialize shouldn't try to find Wine loader. svn path=/trunk/; revision=12756
This commit is contained in:
parent
28f15433b0
commit
1de5b28f80
|
@ -230,14 +230,17 @@ BOOL WINAPI SymInitialize(HANDLE hProcess, PSTR UserSearchPath, BOOL fInvadeProc
|
||||||
|
|
||||||
if (fInvadeProcess)
|
if (fInvadeProcess)
|
||||||
{
|
{
|
||||||
|
#ifndef __REACTOS__
|
||||||
if (!elf_read_wine_loader_dbg_info(pcs))
|
if (!elf_read_wine_loader_dbg_info(pcs))
|
||||||
{
|
{
|
||||||
SymCleanup(hProcess);
|
SymCleanup(hProcess);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
process_invade(hProcess);
|
process_invade(hProcess);
|
||||||
elf_synchronize_module_list(pcs);
|
elf_synchronize_module_list(pcs);
|
||||||
}
|
}
|
||||||
|
DbgPrint("SymInitialize - Success\n");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,7 @@
|
||||||
#include "thread.h" /* FIXME: must be included before winternl.h */
|
#include "thread.h" /* FIXME: must be included before winternl.h */
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#ifndef __REACTOS__
|
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
|
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
|
||||||
|
|
||||||
|
@ -78,7 +76,6 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
|
||||||
PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
|
PGET_MODULE_BASE_ROUTINE GetModuleBaseRoutine,
|
||||||
PTRANSLATE_ADDRESS_ROUTINE f_xlat_adr)
|
PTRANSLATE_ADDRESS_ROUTINE f_xlat_adr)
|
||||||
{
|
{
|
||||||
#ifndef __REACTOS__
|
|
||||||
STACK32FRAME frame32;
|
STACK32FRAME frame32;
|
||||||
STACK16FRAME frame16;
|
STACK16FRAME frame16;
|
||||||
char ch;
|
char ch;
|
||||||
|
@ -388,8 +385,4 @@ BOOL WINAPI StackWalk(DWORD MachineType, HANDLE hProcess, HANDLE hThread,
|
||||||
done_err:
|
done_err:
|
||||||
curr_mode = stm_done;
|
curr_mode = stm_done;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#else
|
|
||||||
/* FIXME */
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
94
reactos/lib/dbghelp/stackframe.h
Normal file
94
reactos/lib/dbghelp/stackframe.h
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
/*
|
||||||
|
* 16-bit and 32-bit mode stack frame layout
|
||||||
|
*
|
||||||
|
* Copyright 1995, 1998 Alexandre Julliard
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WINE_STACKFRAME_H
|
||||||
|
#define __WINE_STACKFRAME_H
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <winnt.h>
|
||||||
|
#include <excpt.h>
|
||||||
|
|
||||||
|
#define SELECTOROF(ptr) (HIWORD(ptr))
|
||||||
|
#define OFFSETOF(ptr) (LOWORD(ptr))
|
||||||
|
|
||||||
|
#include <pshpack1.h>
|
||||||
|
|
||||||
|
/* 32-bit stack layout after CallTo16() */
|
||||||
|
typedef struct _STACK32FRAME
|
||||||
|
{
|
||||||
|
DWORD restore_addr; /* 00 return address for restoring code selector */
|
||||||
|
DWORD codeselector; /* 04 code selector to restore */
|
||||||
|
EXCEPTION_REGISTRATION_RECORD frame; /* 08 Exception frame */
|
||||||
|
SEGPTR frame16; /* 10 16-bit frame from last CallFrom16() */
|
||||||
|
DWORD edi; /* 14 saved registers */
|
||||||
|
DWORD esi; /* 18 */
|
||||||
|
DWORD ebx; /* 1c */
|
||||||
|
DWORD ebp; /* 20 saved 32-bit frame pointer */
|
||||||
|
DWORD retaddr; /* 24 return address */
|
||||||
|
DWORD target; /* 28 target address / CONTEXT86 pointer */
|
||||||
|
DWORD nb_args; /* 2c number of 16-bit argument bytes */
|
||||||
|
} STACK32FRAME;
|
||||||
|
|
||||||
|
/* 16-bit stack layout after CallFrom16() */
|
||||||
|
typedef struct _STACK16FRAME
|
||||||
|
{
|
||||||
|
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
|
||||||
|
DWORD edx; /* 04 saved registers */
|
||||||
|
DWORD ecx; /* 08 */
|
||||||
|
DWORD ebp; /* 0c */
|
||||||
|
WORD ds; /* 10 */
|
||||||
|
WORD es; /* 12 */
|
||||||
|
WORD fs; /* 14 */
|
||||||
|
WORD gs; /* 16 */
|
||||||
|
DWORD callfrom_ip; /* 18 callfrom tail IP */
|
||||||
|
DWORD module_cs; /* 1c module code segment */
|
||||||
|
DWORD relay; /* 20 relay function address */
|
||||||
|
WORD entry_ip; /* 22 entry point IP */
|
||||||
|
DWORD entry_point; /* 26 API entry point to call, reused as mutex count */
|
||||||
|
WORD bp; /* 2a 16-bit stack frame chain */
|
||||||
|
WORD ip; /* 2c return address */
|
||||||
|
WORD cs; /* 2e */
|
||||||
|
} STACK16FRAME;
|
||||||
|
|
||||||
|
#include <poppack.h>
|
||||||
|
|
||||||
|
#define CURRENT_STACK16 ((STACK16FRAME*)MapSL(NtCurrentTeb()->cur_stack))
|
||||||
|
#define CURRENT_DS (CURRENT_STACK16->ds)
|
||||||
|
|
||||||
|
/* Push bytes on the 16-bit stack of a thread;
|
||||||
|
* return a segptr to the first pushed byte
|
||||||
|
*/
|
||||||
|
static inline SEGPTR stack16_push( int size )
|
||||||
|
{
|
||||||
|
STACK16FRAME *frame = CURRENT_STACK16;
|
||||||
|
memmove( (char*)frame - size, frame, sizeof(*frame) );
|
||||||
|
NtCurrentTeb()->cur_stack -= size;
|
||||||
|
return (SEGPTR)(NtCurrentTeb()->cur_stack + sizeof(*frame));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pop bytes from the 16-bit stack of a thread */
|
||||||
|
static inline void stack16_pop( int size )
|
||||||
|
{
|
||||||
|
STACK16FRAME *frame = CURRENT_STACK16;
|
||||||
|
memmove( (char*)frame + size, frame, sizeof(*frame) );
|
||||||
|
NtCurrentTeb()->cur_stack += size;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __WINE_STACKFRAME_H */
|
|
@ -755,9 +755,7 @@ BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase,
|
||||||
module = module_find_by_addr(pcs, ModBase, DMT_UNKNOWN);
|
module = module_find_by_addr(pcs, ModBase, DMT_UNKNOWN);
|
||||||
if (!(module = module_get_debug(pcs, module)))
|
if (!(module = module_get_debug(pcs, module)))
|
||||||
{
|
{
|
||||||
#ifndef __REACTOS__
|
|
||||||
FIXME("Someone didn't properly set ModBase (%s)\n", wine_dbgstr_longlong(ModBase));
|
FIXME("Someone didn't properly set ModBase (%s)\n", wine_dbgstr_longlong(ModBase));
|
||||||
#endif
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue