sync dbghelp to wine head

- replace wine's spec file with an own one
- add back the stubs file and rename it to rosstubs.c, so next time someone syncs dbghelp, he might notice that this file is ros specific and does NOT delete it
- fix FindFileInPath definition in dbghelp.h
- update wine/mscvpdb.h

svn path=/trunk/; revision=38037
This commit is contained in:
Timo Kreuzer 2008-12-13 00:52:11 +00:00
parent 4666ae75a3
commit eacec70b46
20 changed files with 2158 additions and 604 deletions

View file

@ -314,7 +314,6 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP
pcs->search_path = HeapReAlloc(GetProcessHeap(), 0, pcs->search_path, (size + 1 + len + 1) * sizeof(WCHAR));
pcs->search_path[size] = ';';
GetEnvironmentVariableW(alt_sym_path, pcs->search_path + size + 1, len);
size += 1 + len;
}
}

View file

@ -19,6 +19,7 @@
<file>path.c</file>
<file>pe_module.c</file>
<file>regex.c</file>
<file>rosstubs.c</file>
<file>source.c</file>
<file>stabs.c</file>
<file>stack.c</file>

View file

@ -1,19 +1,25 @@
@ stub DbgHelpCreateUserDump
@ stub DbgHelpCreateUserDumpW
#
# dbghelp spec file for reactos. Do not replace with wine ones!
#
#@ stub SymGetOmapBlockBase
@ stdcall DbgHelpCreateUserDump(str ptr ptr)
@ stdcall DbgHelpCreateUserDumpW(str ptr ptr)
@ stdcall EnumDirTree(long str str ptr ptr ptr)
@ stdcall EnumDirTreeW(long wstr wstr ptr ptr ptr)
@ stdcall EnumerateLoadedModules(long ptr ptr)
@ stdcall EnumerateLoadedModules64(long ptr ptr)
@ stdcall EnumerateLoadedModules(long ptr ptr)
@ stdcall EnumerateLoadedModulesEx(ptr ptr ptr)
@ stdcall EnumerateLoadedModulesExW(ptr ptr ptr)
@ stdcall EnumerateLoadedModulesW64(long ptr ptr)
@ stdcall ExtensionApiVersion()
@ stdcall FindDebugInfoFile(str str ptr)
@ stdcall FindDebugInfoFileEx(str str ptr ptr ptr)
@ stub FindDebugInfoFileExW
@ stdcall FindDebugInfoFileExW(str str str ptr ptr)
@ stdcall FindExecutableImage(str str str)
@ stdcall FindExecutableImageEx(str str ptr ptr ptr)
@ stdcall FindExecutableImageExW(wstr wstr ptr ptr ptr)
@ stub FindFileInPath
@ stub FindFileInSearchPath
@ stdcall FindFileInPath(ptr str str ptr long long long str)
@ stdcall FindFileInSearchPath(ptr str str long long long str)
@ stdcall GetTimestampForLoadedLibrary(long)
@ stdcall ImageDirectoryEntryToData(ptr long long ptr)
@ stdcall ImageDirectoryEntryToDataEx(ptr long long ptr ptr)
@ -28,159 +34,175 @@
@ stdcall MiniDumpWriteDump(ptr long ptr long long long long)
@ stdcall SearchTreeForFile(str str ptr)
@ stdcall SearchTreeForFileW(wstr wstr ptr)
@ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr)
@ stdcall StackWalk64(long long long ptr ptr ptr ptr ptr ptr)
@ stub SymAddSymbol
@ stub SymAddSymbolW
@ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr)
@ stdcall SymAddSourceStream(ptr double str ptr ptr)
@ stdcall SymAddSourceStreamA(ptr double str ptr ptr)
@ stdcall SymAddSourceStreamW(ptr double str ptr ptr)
@ stdcall SymAddSymbol(ptr double str double long long)
@ stdcall SymAddSymbolW(ptr double wstr double long long)
@ stdcall SymCleanup(long)
@ stdcall SymDeleteSymbol(ptr double str double long)
@ stdcall SymDeleteSymbolW(ptr double str double long)
@ stdcall SymEnumLines(ptr double str str ptr ptr)
@ stub SymEnumLinesW
@ stdcall SymEnumLinesW(ptr double str str ptr ptr)
@ stdcall SymEnumProcesses(ptr ptr)
@ stdcall SymEnumSourceFileTokens(ptr double ptr)
@ stdcall SymEnumSourceFiles(ptr double str ptr ptr)
@ stub SymEnumSourceFilesW
@ stub SymEnumSym
@ stdcall SymEnumSourceFilesW(ptr double str ptr ptr)
@ stdcall SymEnumSourceLines(ptr double str str long long ptr ptr)
@ stdcall SymEnumSourceLinesW(ptr double str str long long ptr ptr)
@ stdcall SymEnumSym(ptr double ptr ptr)
@ stdcall SymEnumSymbols(ptr double str ptr ptr)
@ stdcall SymEnumSymbolsForAddr(ptr double ptr ptr)
@ stdcall SymEnumSymbolsForAddrW(ptr double ptr ptr)
@ stdcall SymEnumSymbolsW(ptr double wstr ptr ptr)
@ stdcall SymEnumSymbolsForAddr (ptr double ptr ptr)
@ stdcall SymEnumSymbolsForAddrW (ptr double ptr ptr)
@ stdcall SymEnumTypes(ptr double ptr ptr)
@ stdcall SymEnumTypesByName(ptr double str ptr ptr)
@ stdcall SymEnumTypesByNameW(ptr double str ptr ptr)
@ stdcall SymEnumTypesW(ptr double ptr ptr)
@ stdcall SymEnumerateModules(long ptr ptr)
@ stdcall SymEnumerateModules64(long ptr ptr)
@ stdcall SymEnumerateModules(long ptr ptr)
@ stdcall SymEnumerateModulesW64(long ptr ptr)
@ stdcall SymEnumerateSymbols(long long ptr ptr)
@ stdcall SymEnumerateSymbols64(long double ptr ptr)
@ stub SymEnumerateSymbolsW
@ stub SymEnumerateSymbolsW64
@ stub SymFindDebugInfoFile
@ stub SymFindDebugInfoFileW
@ stdcall SymEnumerateSymbols(long long ptr ptr)
@ stdcall SymEnumerateSymbolsW64(ptr double ptr ptr)
@ stdcall SymEnumerateSymbolsW(ptr long ptr ptr)
@ stdcall SymFindDebugInfoFile(ptr str str ptr ptr)
@ stdcall SymFindDebugInfoFileW(ptr str str ptr ptr)
@ stdcall SymFindExecutableImage(ptr str str ptr ptr)
@ stdcall SymFindExecutableImageW(ptr str str ptr ptr)
@ stdcall SymFindFileInPath(long str str ptr long long long ptr ptr ptr)
@ stdcall SymFindFileInPathW(long wstr wstr ptr long long long ptr ptr ptr)
@ stdcall SymFromAddr(ptr double ptr ptr)
@ stdcall SymFromAddrW(ptr double ptr ptr)
@ stub SymFromIndex
@ stub SymFromIndexW
@ stdcall SymFromIndex(ptr double long ptr)
@ stdcall SymFromIndexW(ptr double long ptr)
@ stdcall SymFromName(long str ptr)
@ stub SymFromNameW
@ stub SymFromToken
@ stub SymFromTokenW
@ stdcall SymFunctionTableAccess(long long)
@ stdcall SymFromNameW(long str ptr)
@ stdcall SymFromToken(ptr double long ptr)
@ stdcall SymFromTokenW(ptr double long ptr)
@ stdcall SymFunctionTableAccess64(long double)
@ stub SymGetFileLineOffsets64
@ stub SymGetHomeDirectory
@ stub SymGetHomeDirectoryW
@ stdcall SymGetLineFromAddr(long long ptr ptr)
@ stdcall SymFunctionTableAccess(long long)
@ stdcall SymGetFileLineOffsets64(ptr str str ptr long)
@ stdcall SymGetHomeDirectory(long str ptr)
@ stdcall SymGetHomeDirectoryW(long str ptr)
@ stdcall SymGetLineFromAddr64(long double ptr ptr)
@ stdcall SymGetLineFromAddr(long long ptr ptr)
@ stdcall SymGetLineFromAddrW64(long double ptr ptr)
@ stub SymGetLineFromName
@ stub SymGetLineFromName64
@ stdcall SymGetLineNext(long ptr)
@ stdcall SymGetLineFromName64(ptr str str long ptr ptr)
@ stdcall SymGetLineFromName(ptr str str long ptr ptr)
@ stdcall SymGetLineFromNameW64(ptr str str long ptr ptr)
@ stdcall SymGetLineNext64(long ptr)
@ stub SymGetLineNextW64
@ stdcall SymGetLinePrev(long ptr)
@ stdcall SymGetLineNext(long ptr)
@ stdcall SymGetLineNextW64(ptr ptr)
@ stdcall SymGetLinePrev64(long ptr)
@ stub SymGetLinePrevW64
@ stdcall SymGetModuleBase(long long)
@ stdcall SymGetLinePrev(long ptr)
@ stdcall SymGetLinePrevW64(ptr ptr)
@ stdcall SymGetModuleBase64(long double)
@ stdcall SymGetModuleInfo(long long ptr)
@ stdcall SymGetModuleBase(long long)
@ stdcall SymGetModuleInfo64(long double ptr)
@ stdcall SymGetModuleInfoW(long long ptr)
@ stdcall SymGetModuleInfo(long long ptr)
@ stdcall SymGetModuleInfoW64(long double ptr)
@ stub SymGetOmapBlockBase
@ stdcall SymGetModuleInfoW(long long ptr)
@ stdcall SymGetOmaps(ptr double ptr ptr ptr ptr)
@ stdcall SymGetOptions()
@ stub SymGetScope
@ stub SymGetScopeW
@ stdcall SymGetScope(ptr double long ptr)
@ stdcall SymGetScopeW(ptr double long ptr)
@ stdcall SymGetSearchPath(long ptr long)
@ stdcall SymGetSearchPathW(long ptr long)
@ stub SymGetSourceFileFromToken
@ stub SymGetSourceFileFromTokenW
@ stdcall SymGetSourceFile(ptr double str str str long)
@ stdcall SymGetSourceFileFromToken(ptr ptr str str long)
@ stdcall SymGetSourceFileFromTokenW(ptr ptr str str long)
@ stdcall SymGetSourceFileToken(ptr double str ptr ptr)
@ stdcall SymGetSourceFileTokenW(ptr double wstr ptr ptr)
@ stub SymGetSourceFileW
@ stub SymGetSourceVarFromToken
@ stub SymGetSourceVarFromTokenW
@ stdcall SymGetSymFromAddr(long long ptr ptr)
@ stdcall SymGetSourceFileW(ptr double str str str long)
@ stdcall SymGetSourceVarFromToken(ptr ptr str str str long)
@ stdcall SymGetSourceVarFromTokenW(ptr ptr str str str long)
@ stdcall SymGetSymFromAddr64(long double ptr ptr)
@ stdcall SymGetSymFromAddr(long long ptr ptr)
@ stdcall SymGetSymFromName64(ptr str ptr)
@ stdcall SymGetSymFromName(long str ptr)
@ stub SymGetSymFromName64
@ stdcall SymGetSymNext64(ptr ptr)
@ stdcall SymGetSymNext(long ptr)
@ stub SymGetSymNext64
@ stdcall SymGetSymPrev64(ptr ptr)
@ stdcall SymGetSymPrev(long ptr)
@ stub SymGetSymPrev64
@ stub SymGetSymbolFile
@ stub SymGetSymbolFileW
@ stdcall SymGetSymbolFile(ptr str str long str ptr str ptr)
@ stdcall SymGetSymbolFileW(ptr str str long str ptr str ptr)
@ stdcall SymGetTypeFromName(ptr double str ptr)
@ stub SymGetTypeFromNameW
@ stdcall SymGetTypeFromNameW(ptr double str ptr)
@ stdcall SymGetTypeInfo(ptr double long long ptr)
@ stub SymGetTypeInfoEx
@ stdcall SymGetTypeInfoEx(ptr double ptr)
@ stdcall SymGetUnwindInfo(ptr double ptr ptr)
@ stdcall SymInitialize(long str long)
@ stdcall SymInitializeW(long wstr long)
@ stdcall SymLoadModule(long long str str long long)
@ stdcall SymLoadModule64(long long str str double long)
@ stdcall SymLoadModule(long long str str long long)
@ stdcall SymLoadModuleEx(long long str str double long ptr long)
@ stdcall SymLoadModuleExW(long long wstr wstr double long ptr long)
@ stdcall SymMatchFileName(str str ptr ptr)
@ stdcall SymMatchFileNameW(wstr wstr ptr ptr)
@ stdcall SymMatchString(str str long)
@ stub SymMatchStringA
@ stub SymMatchStringW
@ stub SymNext
@ stub SymNextW
@ stub SymPrev
@ stub SymPrevW
@ stub SymRefreshModuleList
@ stdcall SymRegisterCallback(long ptr ptr)
@ stdcall SymMatchStringA(str str long)
@ stdcall SymMatchStringW(str str long)
@ stdcall SymNext(ptr ptr)
@ stdcall SymNextW(ptr ptr)
@ stdcall SymPrev(ptr ptr)
@ stdcall SymPrevW(ptr ptr)
@ stdcall SymRefreshModuleList(ptr)
@ stdcall SymRegisterCallback64(long ptr double)
@ stdcall SymRegisterCallback(long ptr ptr)
@ stdcall SymRegisterCallbackW64(long ptr double)
@ stdcall SymRegisterFunctionEntryCallback(ptr ptr ptr)
@ stdcall SymRegisterFunctionEntryCallback64(ptr ptr double)
@ stdcall SymRegisterFunctionEntryCallback(ptr ptr ptr)
@ stdcall SymSearch(long double long long str double ptr ptr long)
@ stdcall SymSearchW(long double long long wstr double ptr ptr long)
@ stdcall SymSetContext(long ptr ptr)
@ stub SymSetHomeDirectory
@ stub SymSetHomeDirectoryW
@ stdcall SymSetHomeDirectory(ptr str)
@ stdcall SymSetHomeDirectoryW(ptr str)
@ stdcall SymSetOptions(long)
@ stdcall SymSetParentWindow(long)
@ stdcall SymSetScopeFromAddr(ptr double)
@ stdcall SymSetScopeFromIndex(ptr double long)
@ stdcall SymSetSearchPath(long str)
@ stdcall SymSetSearchPathW(long wstr)
@ stub SymSetSymWithAddr64
@ stub SymSrvDeltaName
@ stub SymSrvDeltaNameW
@ stub SymSrvGetFileIndexInfo
@ stub SymSrvGetFileIndexInfoW
@ stub SymSrvGetFileIndexString
@ stub SymSrvGetFileIndexStringW
@ stub SymSrvGetFileIndexes
@ stub SymSrvGetFileIndexesW
@ stub SymSrvGetSupplement
@ stub SymSrvGetSupplementW
@ stub SymSrvIsStore
@ stub SymSrvIsStoreW
@ stub SymSrvStoreFile
@ stub SymSrvStoreFileW
@ stub SymSrvStoreSupplement
@ stub SymSrvStoreSupplementW
# @ stub SymSetSymWithAddr64 no longer present ??
@ stdcall SymSrvDeltaName(ptr str str str str)
@ stdcall SymSrvDeltaNameW(ptr str str str str)
@ stdcall SymSrvGetFileIndexInfo(str ptr long)
@ stdcall SymSrvGetFileIndexInfoW(str ptr long)
@ stdcall SymSrvGetFileIndexString(ptr str str str ptr long)
@ stdcall SymSrvGetFileIndexStringW(ptr str str str ptr long)
@ stdcall SymSrvGetFileIndexes(str ptr ptr ptr long)
@ stdcall SymSrvGetFileIndexesW(str ptr ptr ptr long)
@ stdcall SymSrvGetSupplement(ptr str str str)
@ stdcall SymSrvGetSupplementW(ptr str str str)
@ stdcall SymSrvIsStore(ptr str)
@ stdcall SymSrvIsStoreW(ptr str)
@ stdcall SymSrvStoreFile(ptr str str long)
@ stdcall SymSrvStoreFileW(ptr str str long)
@ stdcall SymSrvStoreSupplement(ptr str str str long)
@ stdcall SymSrvStoreSupplementW(ptr str str str long)
@ stdcall SymUnDName64(ptr str long)
@ stdcall SymUnDName(ptr str long)
@ stub SymUnDName64
@ stdcall SymUnloadModule(long long)
@ stdcall SymUnloadModule64(long double)
@ stdcall SymUnloadModule(long long)
@ stdcall UnDecorateSymbolName(str str long long)
@ stub UnDecorateSymbolNameW
@ stdcall UnDecorateSymbolNameW(str str long long)
@ stdcall UnmapDebugInformation(ptr)
@ stdcall WinDbgExtensionDllInit(ptr long long)
#@ stub block
#@ stub chksym
#@ stub dbghelp
#@ stub dh
#@ stub fptr
#@ stub homedir
#@ stub itoldyouso
#@ stub lmi
#@ stub lminfo
#@ stub omap
#@ stub srcfiles
#@ stub stack_force_ebp
#@ stub stackdbg
#@ stub sym
#@ stub symsrv
#@ stub vc7fpo
#@ stdcall block
#@ stdcall chksym
#@ stdcall dbghelp
#@ stdcall dh
#@ stdcall fptr
#@ stdcall homedir
#@ stdcall itoldyouso
#@ stdcall lmi
#@ stdcall lminfo
#@ stdcall omap
#@ stdcall srcfiles
#@ stdcall stack_force_ebp
#@ stdcall stackdbg
#@ stdcall sym
#@ stdcall symsrv
#@ stdcall vc7fpo

View file

@ -303,7 +303,8 @@ enum module_type
DMT_UNKNOWN, /* for lookup, not actually used for a module */
DMT_ELF, /* a real ELF shared module */
DMT_PE, /* a native or builtin PE module */
DMT_PDB, /* PDB file */
DMT_PDB, /* .PDB file */
DMT_DBG, /* .DBG file */
};
struct process;
@ -473,6 +474,11 @@ extern BOOL pe_load_debug_directory(const struct process* pcs,
const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg);
extern BOOL pdb_fetch_file_info(struct pdb_lookup* pdb_lookup);
/* path.c */
extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
BOOL* is_unmatched);
/* pe_module.c */
extern BOOL pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth);
extern struct module*

View file

@ -1036,7 +1036,7 @@ static struct symt* dwarf2_parse_array_type(dwarf2_parse_context_t* ctx,
struct symt* idx_type = NULL;
struct attribute min, max, cnt;
dwarf2_debug_info_t* child;
int i;
unsigned int i;
if (di->symt) return di->symt;
@ -1194,7 +1194,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx,
if (di->abbrev->have_child) /** any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
@ -1269,7 +1269,7 @@ static struct symt* dwarf2_parse_enumeration_type(dwarf2_parse_context_t* ctx,
if (di->abbrev->have_child) /* any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
/* FIXME: should we use the sibling stuff ?? */
for (i=0; i<vector_length(&di->children); i++)
@ -1454,7 +1454,7 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm,
if (di->abbrev->have_child) /** any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
@ -1507,7 +1507,7 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm,
if (di->abbrev->have_child) /** any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
@ -1631,7 +1631,7 @@ static struct symt* dwarf2_parse_subprogram(dwarf2_parse_context_t* ctx,
if (di->abbrev->have_child) /** any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
@ -1706,7 +1706,7 @@ static struct symt* dwarf2_parse_subroutine_type(dwarf2_parse_context_t* ctx,
if (di->abbrev->have_child) /** any interest to not have child ? */
{
dwarf2_debug_info_t* child;
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
@ -2065,7 +2065,7 @@ static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t* sections,
if (di->abbrev->have_child)
{
int i;
unsigned int i;
for (i=0; i<vector_length(&di->children); i++)
{
pdi = vector_at(&di->children, i);
@ -2121,7 +2121,7 @@ static enum location_error loc_compute_frame(struct process* pcs,
struct location* pframe;
dwarf2_traverse_context_t lctx;
enum location_error err;
int i;
unsigned int i;
for (i=0; i<vector_length(&func->vchildren); i++)
{

View file

@ -68,6 +68,16 @@ typedef enum dwarf_tag_e
DW_TAG_variant_part = 0x33,
DW_TAG_variable = 0x34,
DW_TAG_volatile_type = 0x35,
/** Dwarf3 new values */
DW_TAG_dwarf_procedure = 0x36,
DW_TAG_restrict_type = 0x37,
DW_TAG_interface_type = 0x38,
DW_TAG_namespace = 0x39,
DW_TAG_imported_module = 0x3a,
DW_TAG_unspecified_type = 0x3b,
DW_TAG_partial_unit = 0x3c,
DW_TAG_imported_unit = 0x3d,
DW_TAG_mutable_type = 0x3e,
/** extensions */
DW_TAG_MIPS_loop = 0x4081,
DW_TAG_format_label = 0x4101,
@ -139,8 +149,20 @@ typedef enum dwarf_attribute_e
DW_AT_variable_parameter = 0x4b,
DW_AT_virtuality = 0x4c,
DW_AT_vtable_elem_location = 0x4d,
/** Dwarf3 new values */
DW_AT_allocated = 0x4e,
DW_AT_associated = 0x4f,
DW_AT_data_location = 0x50,
DW_AT_stride = 0x51,
DW_AT_entry_pc = 0x52,
DW_AT_use_UTF8 = 0x53,
DW_AT_extension = 0x54,
DW_AT_ranges = 0x55,
DW_AT_trampoline = 0x56,
DW_AT_call_column = 0x57,
DW_AT_call_file = 0x58,
DW_AT_call_line = 0x59,
DW_AT_description = 0x5a,
/* extensions */
DW_AT_MIPS_fde = 0x2001,
DW_AT_MIPS_loop_begin = 0x2002,
@ -197,7 +219,9 @@ typedef enum dwarf_type_e
DW_ATE_signed = 0x5,
DW_ATE_signed_char = 0x6,
DW_ATE_unsigned = 0x7,
DW_ATE_unsigned_char = 0x8
DW_ATE_unsigned_char = 0x8,
/* Dwarf3 new values */
DW_ATE_imaginary_float = 0x9
} dwarf_type_t;
typedef enum dwarf_operation_e
@ -346,7 +370,12 @@ typedef enum dwarf_operation_e
DW_OP_piece = 0x93,
DW_OP_deref_size = 0x94,
DW_OP_xderef_size = 0x95,
DW_OP_nop = 0x96
DW_OP_nop = 0x96,
/** Dwarf3 new values */
DW_OP_push_object_address = 0x97,
DW_OP_call2 = 0x98,
DW_OP_call4 = 0x99,
DW_OP_call_ref = 0x9a,
} dwarf_operation_t;
enum dwarf_calling_convention
@ -369,6 +398,10 @@ enum dwarf_calling_convention
#define DW_LNS_set_basic_block 0x07
#define DW_LNS_const_add_pc 0x08
#define DW_LNS_fixed_advance_pc 0x09
/* Dwarf3 new values */
#define DW_LNS_set_prologue_end 0x0a
#define DW_LNS_set_epilogue_begin 0x0b
#define DW_LNS_set_isa 0x0c
#define DW_LNE_end_sequence 0x01
#define DW_LNE_set_address 0x02

View file

@ -411,7 +411,7 @@ static unsigned dump_exception_info(struct dump_context* dc,
MINIDUMP_EXCEPTION_STREAM mdExcpt;
EXCEPTION_RECORD rec, *prec;
CONTEXT ctx, *pctx;
int i;
DWORD i;
mdExcpt.ThreadId = except->ThreadId;
mdExcpt.__alignment = 0;
@ -556,6 +556,44 @@ static unsigned dump_modules(struct dump_context* dc, BOOL dump_elf)
return sz;
}
/* Calls cpuid with an eax of 'ax' and returns the 16 bytes in *p
* We are compiled with -fPIC, so we can't clobber ebx.
*/
static inline void do_x86cpuid(unsigned int ax, unsigned int *p)
{
#if defined(__GNUC__) && defined(__i386__)
__asm__("pushl %%ebx\n\t"
"cpuid\n\t"
"movl %%ebx, %%esi\n\t"
"popl %%ebx"
: "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3])
: "0" (ax));
#endif
}
/* From xf86info havecpuid.c 1.11 */
static inline int have_x86cpuid(void)
{
#if defined(__GNUC__) && defined(__i386__)
unsigned int f1, f2;
__asm__("pushfl\n\t"
"pushfl\n\t"
"popl %0\n\t"
"movl %0,%1\n\t"
"xorl %2,%0\n\t"
"pushl %0\n\t"
"popfl\n\t"
"pushfl\n\t"
"popl %0\n\t"
"popfl"
: "=&r" (f1), "=&r" (f2)
: "ir" (0x00200000));
return ((f1^f2) & 0x00200000) != 0;
#else
return 0;
#endif
}
/******************************************************************
* dump_system_info
*
@ -587,9 +625,42 @@ static unsigned dump_system_info(struct dump_context* dc)
mdSysInfo.u1.Reserved1 = 0;
mdSysInfo.u1.s.SuiteMask = VER_SUITE_TERMINAL;
FIXME("fill in CPU vendorID and feature set\n");
memset(&mdSysInfo.Cpu, 0, sizeof(mdSysInfo.Cpu));
if (have_x86cpuid())
{
unsigned regs0[4], regs1[4];
do_x86cpuid(0, regs0);
mdSysInfo.Cpu.X86CpuInfo.VendorId[0] = regs0[1];
mdSysInfo.Cpu.X86CpuInfo.VendorId[1] = regs0[2];
mdSysInfo.Cpu.X86CpuInfo.VendorId[2] = regs0[3];
do_x86cpuid(1, regs1);
mdSysInfo.Cpu.X86CpuInfo.VersionInformation = regs1[0];
mdSysInfo.Cpu.X86CpuInfo.FeatureInformation = regs1[3];
mdSysInfo.Cpu.X86CpuInfo.AMDExtendedCpuFeatures = 0;
if (regs0[1] == 0x68747541 /* "Auth" */ &&
regs0[3] == 0x69746e65 /* "enti" */ &&
regs0[2] == 0x444d4163 /* "cAMD" */)
{
do_x86cpuid(0x80000000, regs1); /* get vendor cpuid level */
if (regs1[0] >= 0x80000001)
{
do_x86cpuid(0x80000001, regs1); /* get vendor features */
mdSysInfo.Cpu.X86CpuInfo.AMDExtendedCpuFeatures = regs1[3];
}
}
}
else
{
unsigned i;
ULONG64 one = 1;
mdSysInfo.Cpu.OtherCpuInfo.ProcessorFeatures[0] = 0;
mdSysInfo.Cpu.OtherCpuInfo.ProcessorFeatures[1] = 0;
for (i = 0; i < sizeof(mdSysInfo.Cpu.OtherCpuInfo.ProcessorFeatures[0]) * 8; i++)
if (IsProcessorFeaturePresent(i))
mdSysInfo.Cpu.OtherCpuInfo.ProcessorFeatures[0] |= one << i;
}
append(dc, &mdSysInfo, sizeof(mdSysInfo));
/* write the service pack version string after this stream. It is referenced within the
@ -907,7 +978,7 @@ BOOL WINAPI MiniDumpReadDumpStream(PVOID base, ULONG str_idx,
if (mdHead->Signature == MINIDUMP_SIGNATURE)
{
MINIDUMP_DIRECTORY* dir;
int i;
DWORD i;
dir = (MINIDUMP_DIRECTORY*)((char*)base + mdHead->StreamDirectoryRva);
for (i = 0; i < mdHead->NumberOfStreams; i++, dir++)

View file

@ -36,6 +36,7 @@ const WCHAR S_ElfW[] = {'<','e','l','f','>','\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_DotPdbW[] = {'.','p','d','b','\0'};
static const WCHAR S_DotDbgW[] = {'.','d','b','g','\0'};
const WCHAR S_WinePThreadW[] = {'w','i','n','e','-','p','t','h','r','e','a','d','\0'};
const WCHAR S_WineKThreadW[] = {'w','i','n','e','-','k','t','h','r','e','a','d','\0'};
const WCHAR S_SlashW[] = {'/','\0'};
@ -424,6 +425,9 @@ enum module_type module_get_type_by_name(const WCHAR* name)
if (len > 4 && !strncmpiW(name + len - 4, S_DotPdbW, 4))
return DMT_PDB;
if (len > 4 && !strncmpiW(name + len - 4, S_DotDbgW, 4))
return DMT_DBG;
/* wine-[kp]thread is also an ELF module */
if (((len > 12 && name[len - 13] == '/') || len == 12) &&
(!strncmpiW(name + len - 12, S_WinePThreadW, 12) ||

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
/*
* File path.c - managing path in debugging environments
*
* Copyright (C) 2004, Eric Pouech
* Copyright (C) 2004,2008, Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -329,18 +329,6 @@ BOOL WINAPI EnumDirTree(HANDLE hProcess, PCSTR root, PCSTR file,
struct sffip
{
enum module_type kind;
/* pe: id -> DWORD:timestamp
* two -> size of image (from PE header)
* pdb: id -> PDB signature
* I think either DWORD:timestamp or GUID:guid depending on PDB version
* two -> PDB age ???
* elf: id -> DWORD:CRC 32 of ELF image (Wine only)
*/
PVOID id;
DWORD two;
DWORD three;
DWORD flags;
PFINDFILEINPATHCALLBACKW cb;
void* user;
};
@ -353,110 +341,8 @@ struct sffip
static BOOL CALLBACK sffip_cb(PCWSTR buffer, PVOID user)
{
struct sffip* s = (struct sffip*)user;
DWORD size, checksum;
/* FIXME: should check that id/two/three match the file pointed
* by buffer
*/
switch (s->kind)
{
case DMT_PE:
{
HANDLE hFile, hMap;
void* mapping;
DWORD timestamp;
timestamp = ~(DWORD_PTR)s->id;
size = ~s->two;
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return FALSE;
if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
{
if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{
IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping);
timestamp = nth->FileHeader.TimeDateStamp;
size = nth->OptionalHeader.SizeOfImage;
UnmapViewOfFile(mapping);
}
CloseHandle(hMap);
}
CloseHandle(hFile);
if (timestamp != (DWORD_PTR)s->id || size != s->two)
{
WARN("Found %s, but wrong size or timestamp\n", debugstr_w(buffer));
return FALSE;
}
}
break;
case DMT_ELF:
if (elf_fetch_file_info(buffer, 0, &size, &checksum))
{
if (checksum != (DWORD_PTR)s->id)
{
WARN("Found %s, but wrong checksums: %08x %08lx\n",
debugstr_w(buffer), checksum, (DWORD_PTR)s->id);
return FALSE;
}
}
else
{
WARN("Couldn't read %s\n", debugstr_w(buffer));
return FALSE;
}
break;
case DMT_PDB:
{
struct pdb_lookup pdb_lookup;
char fn[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL);
pdb_lookup.filename = fn;
if (!pdb_fetch_file_info(&pdb_lookup)) return FALSE;
switch (pdb_lookup.kind)
{
case PDB_JG:
if (s->flags & SSRVOPT_GUIDPTR)
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
return FALSE;
}
if (pdb_lookup.u.jg.timestamp != (DWORD_PTR)s->id)
{
WARN("Found %s, but wrong signature: %08x %08lx\n",
debugstr_w(buffer), pdb_lookup.u.jg.timestamp, (DWORD_PTR)s->id);
return FALSE;
}
break;
case PDB_DS:
if (!(s->flags & SSRVOPT_GUIDPTR))
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
return FALSE;
}
if (memcmp(&pdb_lookup.u.ds.guid, (GUID*)s->id, sizeof(GUID)))
{
WARN("Found %s, but wrong GUID: %s %s\n",
debugstr_w(buffer), debugstr_guid(&pdb_lookup.u.ds.guid),
debugstr_guid((GUID*)s->id));
return FALSE;
}
break;
}
if (pdb_lookup.age != s->two)
{
WARN("Found %s, but wrong age: %08x %08x\n",
debugstr_w(buffer), pdb_lookup.age, s->two);
return FALSE;
}
}
break;
default:
FIXME("What the heck??\n");
return FALSE;
}
if (!s->cb) return TRUE;
/* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite
* convention to stop/continue enumeration. sigh.
*/
@ -485,15 +371,10 @@ BOOL WINAPI SymFindFileInPathW(HANDLE hProcess, PCWSTR searchPath, PCWSTR full_p
if (!pcs) return FALSE;
if (!searchPath) searchPath = pcs->search_path;
s.id = id;
s.two = two;
s.three = three;
s.flags = flags;
s.cb = cb;
s.user = user;
filename = file_nameW(full_path);
s.kind = module_get_type_by_name(filename);
/* first check full path to file */
if (sffip_cb(full_path, &s))
@ -555,3 +436,239 @@ BOOL WINAPI SymFindFileInPath(HANDLE hProcess, PCSTR searchPath, PCSTR full_path
WideCharToMultiByte(CP_ACP, 0, bufferW, -1, buffer, MAX_PATH, NULL, NULL);
return ret;
}
struct module_find
{
enum module_type kind;
/* pe: dw1 DWORD:timestamp
* dw2 size of image (from PE header)
* pdb: guid PDB guid (if DS PDB file)
* or dw1 PDB timestamp (if JG PDB file)
* dw2 PDB age
* elf: dw1 DWORD:CRC 32 of ELF image (Wine only)
*/
const GUID* guid;
DWORD dw1;
DWORD dw2;
WCHAR filename[MAX_PATH];
unsigned matched;
};
/* checks that buffer (as found by matching the name) matches the info
* (information is based on file type)
* returns TRUE when file is found, FALSE to continue searching
* (NB this is the opposite convention of SymFindFileInPathProc)
*/
static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
{
struct module_find* mf = (struct module_find*)user;
DWORD size, checksum, timestamp;
unsigned matched = 0;
/* the matching weights:
* +1 if a file with same name is found and is a decent file of expected type
* +1 if first parameter and second parameter match
*/
/* FIXME: should check that id/two match the file pointed
* by buffer
*/
switch (mf->kind)
{
case DMT_PE:
{
HANDLE hFile, hMap;
void* mapping;
DWORD timestamp;
timestamp = ~mf->dw1;
size = ~mf->dw2;
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return FALSE;
if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
{
if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{
IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping);
matched++;
timestamp = nth->FileHeader.TimeDateStamp;
size = nth->OptionalHeader.SizeOfImage;
UnmapViewOfFile(mapping);
}
CloseHandle(hMap);
}
CloseHandle(hFile);
if (timestamp != mf->dw1)
WARN("Found %s, but wrong timestamp\n", debugstr_w(buffer));
if (size != mf->dw2)
WARN("Found %s, but wrong size\n", debugstr_w(buffer));
if (timestamp == mf->dw1 && size == mf->dw2) matched++;
}
break;
case DMT_ELF:
if (elf_fetch_file_info(buffer, 0, &size, &checksum))
{
matched++;
if (checksum == mf->dw1) matched++;
else
WARN("Found %s, but wrong checksums: %08x %08x\n",
debugstr_w(buffer), checksum, mf->dw1);
}
else
{
WARN("Couldn't read %s\n", debugstr_w(buffer));
return FALSE;
}
break;
case DMT_PDB:
{
struct pdb_lookup pdb_lookup;
char fn[MAX_PATH];
WideCharToMultiByte(CP_ACP, 0, buffer, -1, fn, MAX_PATH, NULL, NULL);
pdb_lookup.filename = fn;
if (!pdb_fetch_file_info(&pdb_lookup)) return FALSE;
matched++;
switch (pdb_lookup.kind)
{
case PDB_JG:
if (mf->guid)
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
}
else if (pdb_lookup.u.jg.timestamp == mf->dw1)
matched++;
else
WARN("Found %s, but wrong signature: %08x %08x\n",
debugstr_w(buffer), pdb_lookup.u.jg.timestamp, mf->dw1);
break;
case PDB_DS:
if (!mf->guid)
{
WARN("Found %s, but wrong PDB version\n", debugstr_w(buffer));
}
else if (!memcmp(&pdb_lookup.u.ds.guid, mf->guid, sizeof(GUID)))
matched++;
else
WARN("Found %s, but wrong GUID: %s %s\n",
debugstr_w(buffer), debugstr_guid(&pdb_lookup.u.ds.guid),
debugstr_guid(mf->guid));
break;
}
if (pdb_lookup.age != mf->dw2)
{
matched--;
WARN("Found %s, but wrong age: %08x %08x\n",
debugstr_w(buffer), pdb_lookup.age, mf->dw2);
}
}
break;
case DMT_DBG:
{
HANDLE hFile, hMap;
void* mapping;
timestamp = ~mf->dw1;
hFile = CreateFileW(buffer, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) return FALSE;
if ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != NULL)
{
if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL)
{
const IMAGE_SEPARATE_DEBUG_HEADER* hdr;
hdr = (const IMAGE_SEPARATE_DEBUG_HEADER*)mapping;
if (hdr->Signature == IMAGE_SEPARATE_DEBUG_SIGNATURE)
{
matched++;
timestamp = hdr->TimeDateStamp;
}
UnmapViewOfFile(mapping);
}
CloseHandle(hMap);
}
CloseHandle(hFile);
if (timestamp == mf->dw1) matched++;
else WARN("Found %s, but wrong timestamp\n", debugstr_w(buffer));
}
break;
default:
FIXME("What the heck??\n");
return FALSE;
}
if (matched > mf->matched)
{
strcpyW(mf->filename, buffer);
mf->matched = matched;
}
/* yes, EnumDirTree/do_search and SymFindFileInPath callbacks use the opposite
* convention to stop/continue enumeration. sigh.
*/
return mf->matched == 2;
}
BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path,
const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
BOOL* is_unmatched)
{
struct module_find mf;
WCHAR full_pathW[MAX_PATH];
WCHAR tmp[MAX_PATH];
WCHAR* ptr;
const WCHAR* filename;
WCHAR* searchPath = pcs->search_path;
TRACE("(pcs = %p, full_path = %s, guid = %s, dw1 = 0x%08x, dw2 = 0x%08x, buffer = %p)\n",
pcs, debugstr_a(full_path), debugstr_guid(guid), dw1, dw2, buffer);
mf.guid = guid;
mf.dw1 = dw1;
mf.dw2 = dw2;
mf.matched = 0;
MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH);
filename = file_nameW(full_pathW);
mf.kind = module_get_type_by_name(filename);
*is_unmatched = FALSE;
/* first check full path to file */
if (module_find_cb(full_pathW, &mf))
{
WideCharToMultiByte(CP_ACP, 0, full_pathW, -1, buffer, MAX_PATH, NULL, NULL);
return TRUE;
}
while (searchPath)
{
ptr = strchrW(searchPath, ';');
if (ptr)
{
memcpy(tmp, searchPath, (ptr - searchPath) * sizeof(WCHAR));
tmp[ptr - searchPath] = '\0';
searchPath = ptr + 1;
}
else
{
strcpyW(tmp, searchPath);
searchPath = NULL;
}
if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf))
{
/* return first fully matched file */
WideCharToMultiByte(CP_ACP, 0, tmp, -1, buffer, MAX_PATH, NULL, NULL);
return TRUE;
}
}
/* if no fully matching file is found, return the best matching file if any */
if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched)
{
WideCharToMultiByte(CP_ACP, 0, mf.filename, -1, buffer, MAX_PATH, NULL, NULL);
*is_unmatched = TRUE;
return TRUE;
}
return FALSE;
}

View file

@ -79,12 +79,6 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module,
return ret;
}
static BOOL CALLBACK dbg_match(const char* file, void* user)
{
/* accept first file */
return FALSE;
}
/******************************************************************
* pe_load_dbg_file
*
@ -96,51 +90,35 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
char tmp[MAX_PATH];
HANDLE hFile = INVALID_HANDLE_VALUE, hMap = 0;
const BYTE* dbg_mapping = NULL;
const IMAGE_SEPARATE_DEBUG_HEADER* hdr;
const IMAGE_DEBUG_DIRECTORY* dbg;
BOOL ret = FALSE;
WINE_TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
TRACE("Processing DBG file %s\n", debugstr_a(dbg_name));
if (SymFindFileInPath(pcs->handle, NULL, dbg_name, NULL, 0, 0, 0, tmp, dbg_match, NULL) &&
if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) &&
(hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE &&
((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) &&
((dbg_mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL))
{
const IMAGE_SEPARATE_DEBUG_HEADER* hdr;
const IMAGE_SECTION_HEADER* sectp;
const IMAGE_DEBUG_DIRECTORY* dbg;
hdr = (const IMAGE_SEPARATE_DEBUG_HEADER*)dbg_mapping;
if (hdr->TimeDateStamp != timestamp)
{
WINE_ERR("Warning - %s has incorrect internal timestamp\n",
debugstr_a(dbg_name));
/*
* Well, sometimes this happens to DBG files which ARE REALLY the
* right .DBG files but nonetheless this check fails. Anyway,
* WINDBG (debugger for Windows by Microsoft) loads debug symbols
* which have incorrect timestamps.
*/
}
if (hdr->Signature == IMAGE_SEPARATE_DEBUG_SIGNATURE)
{
/* section headers come immediately after debug header */
const IMAGE_SECTION_HEADER *sectp =
(const IMAGE_SECTION_HEADER*)(hdr + 1);
/* and after that and the exported names comes the debug directory */
dbg = (const IMAGE_DEBUG_DIRECTORY*)
(dbg_mapping + sizeof(*hdr) +
hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) +
hdr->ExportedNamesSize);
/* section headers come immediately after debug header */
sectp = (const IMAGE_SECTION_HEADER*)(hdr + 1);
/* and after that and the exported names comes the debug directory */
dbg = (const IMAGE_DEBUG_DIRECTORY*)
(dbg_mapping + sizeof(*hdr) +
hdr->NumberOfSections * sizeof(IMAGE_SECTION_HEADER) +
hdr->ExportedNamesSize);
ret = pe_load_debug_directory(pcs, module, dbg_mapping, sectp,
hdr->NumberOfSections, dbg,
hdr->DebugDirectorySize / sizeof(*dbg));
}
else
ERR("Wrong signature in .DBG file %s\n", debugstr_a(tmp));
ret = pe_load_debug_directory(pcs, module, dbg_mapping, sectp,
hdr->NumberOfSections, dbg,
hdr->DebugDirectorySize / sizeof(*dbg));
}
else
WINE_ERR("-Unable to peruse .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_a(tmp));
ERR("Couldn't find .DBG file %s (%s)\n", debugstr_a(dbg_name), debugstr_a(tmp));
if (dbg_mapping) UnmapViewOfFile(dbg_mapping);
if (hMap) CloseHandle(hMap);

View file

@ -0,0 +1,981 @@
/*
* File stubs.c - stubs for exported functions
*
* Copyright (C) 2007, Timo Kreuzer
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define WIN32_NO_STATUS
#include <windows.h>
#include <ndk/ntndk.h>
#include "dbghelp_private.h"
#define UNIMPLEMENTED DbgPrint("DBGHELP: %s is unimplemented, please try again later.\n", __FUNCTION__);
#define PDBGHELP_CREATE_USER_DUMP_CALLBACK PVOID
#define PSYM_ENUMPROCESSES_CALLBACK PVOID
#define PENUMSOURCEFILETOKENSCALLBACK PVOID
#define PSYMSRV_INDEX_INFO PVOID
#define POMAP PVOID
BOOL WINAPI
EnumerateLoadedModulesEx(
IN HANDLE hProcess,
IN PENUMLOADED_MODULES_CALLBACK64 EnumLoadedModulesCallback,
IN PVOID UserContext OPTIONAL)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
IMAGEAPI
EnumerateLoadedModulesExW(
IN HANDLE hProcess,
IN PENUMLOADED_MODULES_CALLBACKW64 EnumLoadedModulesCallback,
IN PVOID UserContext OPTIONAL)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
DbgHelpCreateUserDump(LPSTR pszFileName,
PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,
PVOID pUserData)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
DbgHelpCreateUserDumpW(LPWSTR pszFileName,
PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,
PVOID pUserData)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
FindFileInPath(
IN HANDLE hProcess,
IN PCSTR pszSearchPath,
IN PCSTR pszFileName,
IN PVOID id,
IN DWORD two,
IN DWORD three,
IN DWORD flags,
OUT PSTR FilePath)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
FindFileInSearchPath(HANDLE hProcess,
LPSTR pszSearchPath,
LPSTR pszFileName,
DWORD one,
DWORD two,
DWORD three,
LPSTR pszFilePath)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymDeleteSymbol(HANDLE hProcess,
ULONG64 ModBase,
PCSTR pszName,
DWORD64 Address,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymDeleteSymbolW(HANDLE hProcess,
ULONG64 ModBase,
PCWSTR pszName,
DWORD64 Address,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumLinesW(HANDLE hProcess,
ULONG64 ModBase,
PCWSTR pszObj,
PCWSTR pszFile,
PSYM_ENUMLINES_CALLBACKW Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumProcesses(PSYM_ENUMPROCESSES_CALLBACK Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSourceFilesW(HANDLE hProcess,
ULONG64 ModBase,
PCWSTR pszMask,
PSYM_ENUMSOURCEFILES_CALLBACKW Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSourceLines(HANDLE hProcess,
ULONG64 ModBase,
PCSTR pszObject,
PCSTR pszFile,
DWORD dwLine,
DWORD dwFlags,
PSYM_ENUMLINES_CALLBACK Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSourceLinesW(HANDLE hProcess,
ULONG64 ModBase,
PCWSTR pszObject,
PCWSTR pszFile,
DWORD dwLine,
DWORD dwFlags,
PSYM_ENUMLINES_CALLBACKW Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSym(HANDLE hProcess,
ULONG64 ModBase,
PSYM_ENUMERATESYMBOLS_CALLBACK Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSymbolsForAddr(HANDLE hProcess,
DWORD64 Address,
PSYM_ENUMERATESYMBOLS_CALLBACK Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumSymbolsForAddrW(HANDLE hProcess,
DWORD64 Address,
PSYM_ENUMERATESYMBOLS_CALLBACKW Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumerateSymbolsW64(HANDLE hProcess,
DWORD64 ModBase,
PSYM_ENUMSYMBOLS_CALLBACK64W Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymEnumerateSymbolsW(HANDLE hProcess,
DWORD ModBase,
PSYM_ENUMSYMBOLS_CALLBACKW Callback,
PVOID pUserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymFromIndex(HANDLE hProcess,
ULONG64 ModBase,
DWORD Index,
PSYMBOL_INFO Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymFromIndexW(HANDLE hProcess,
ULONG64 ModBase,
DWORD Index,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymFromNameW(HANDLE hProcess,
PCWSTR pszName,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymFromToken(HANDLE hProcess,
DWORD64 ModBase,
DWORD Token,
PSYMBOL_INFO Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymFromTokenW(HANDLE hProcess,
DWORD64 ModBase,
DWORD Token,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
ULONG WINAPI
SymGetFileLineOffsets64(HANDLE hProcess,
PCSTR pszModuleName,
PCSTR pszFileName,
PDWORD64 pBuffer,
ULONG BufferLines)
{
UNIMPLEMENTED;
return FALSE;
}
PCHAR WINAPI
SymGetHomeDirectory(DWORD dwType,
PSTR pszDir,
size_t Size)
{
UNIMPLEMENTED;
return NULL;
}
PWCHAR WINAPI
SymGetHomeDirectoryW(DWORD dwType,
PWSTR pszDir,
size_t Size)
{
UNIMPLEMENTED;
return NULL;
}
BOOL WINAPI
SymGetLineFromName64(HANDLE hProcess,
PCSTR pszModuleName,
PCSTR pszFileName,
DWORD dwLineNumber,
PLONG plDisplacement,
PIMAGEHLP_LINE64 Line)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetLineFromName(HANDLE hProcess,
PCSTR pszModuleName,
PCSTR pszFileName,
DWORD dwLineNumber,
PLONG plDisplacement,
PIMAGEHLP_LINE Line)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetLineFromNameW64(HANDLE hProcess,
PCWSTR pszModuleName,
PCWSTR pszFileName,
DWORD dwLineNumber,
PLONG lpDisplacement,
PIMAGEHLP_LINEW64 Line)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetLineNextW64(HANDLE hProcess,
PIMAGEHLP_LINEW64 Line)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetLinePrevW64(HANDLE hProcess,
PIMAGEHLP_LINEW64 Line)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetScope(HANDLE hProcess,
ULONG64 ModBase,
DWORD Index,
PSYMBOL_INFO Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetScopeW(HANDLE hProcess,
ULONG64 ModBase,
DWORD Index,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSourceFile(HANDLE hProcess,
ULONG64 ModBase,
PCSTR pszParams,
PCSTR pszFileSpec,
PSTR pszFilePath,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSourceFileFromToken(HANDLE hProcess,
PVOID Token,
PCSTR pszParams,
PSTR pszFilePath,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSourceFileFromTokenW(HANDLE hProcess,
PVOID Token,
PCWSTR pszParams,
PWSTR pszFilePath,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymGetSourceFileW(
HANDLE hProcess,
ULONG64 Base,
PCWSTR Params,
PCWSTR FileSpec,
PWSTR FilePath,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymGetSourceVarFromToken(
HANDLE hProcess,
PVOID Token,
PCSTR Params,
PCSTR VarName,
PSTR Value,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymGetSourceVarFromTokenW(
HANDLE hProcess,
PVOID Token,
PCWSTR Params,
PCWSTR VarName,
PWSTR Value,
DWORD Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSymFromName64(HANDLE hProcess,
PCSTR pszName,
PIMAGEHLP_SYMBOL64 Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSymNext64(HANDLE hProcess,
PIMAGEHLP_SYMBOL64 Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSymPrev64(HANDLE hProcess,
PIMAGEHLP_SYMBOL64 Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSymbolFile(HANDLE hProcess,
PCSTR pszSymPath,
PCSTR pszImageFile,
DWORD Type,
PSTR SymbolFile,
size_t cSymbolFile,
PSTR DbgFile,
size_t cDbgFile)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetSymbolFileW(HANDLE hProcess,
PCWSTR pszSymPath,
PCWSTR pszImageFile,
DWORD Type,
PWSTR pszSymbolFile,
size_t cSymbolFile,
PWSTR pszDbgFile,
size_t cDbgFile)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetTypeFromNameW(HANDLE hProcess,
ULONG64 ModBase,
PCWSTR pszName,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymGetTypeInfoEx(HANDLE hProcess,
DWORD64 ModBase,
PIMAGEHLP_GET_TYPE_INFO_PARAMS Params)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymMatchStringA(PCSTR pszString,
PCSTR pszExpression,
BOOL bCaseSensitiv)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymMatchStringW(PCWSTR pszString,
PCWSTR pszExpression,
BOOL bCaseSensitiv)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymNext(HANDLE hProcess,
PSYMBOL_INFO Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymNextW(HANDLE hProcess,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymPrev(HANDLE hProcess,
PSYMBOL_INFO Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymPrevW(HANDLE hProcess,
PSYMBOL_INFOW Symbol)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymRefreshModuleList(
HANDLE hProcess)
{
UNIMPLEMENTED;
return FALSE;
}
PCHAR WINAPI
SymSetHomeDirectory(HANDLE hProcess,
PCSTR pszDir)
{
UNIMPLEMENTED;
return NULL;
}
PWCHAR WINAPI
SymSetHomeDirectoryW(HANDLE hProcess,
PCWSTR pszDir)
{
UNIMPLEMENTED;
return NULL;
}
BOOL
WINAPI
SymSetScopeFromIndex(
HANDLE hProcess,
ULONG64 BaseOfDll,
DWORD Index)
{
UNIMPLEMENTED;
return FALSE;
}
// SymSetSymWithAddr64
PCSTR WINAPI
SymSrvDeltaName(HANDLE hProcess,
PCSTR pszSymPath,
PCSTR pszType,
PCSTR pszFile1,
PCSTR pszFile2)
{
UNIMPLEMENTED;
return NULL;
}
PCWSTR WINAPI
SymSrvDeltaNameW(HANDLE hProcess,
PCWSTR pszSymPath,
PCWSTR pszType,
PCWSTR pszFile1,
PCWSTR pszFile2)
{
UNIMPLEMENTED;
return NULL;
}
BOOL WINAPI
SymSrvGetFileIndexString(HANDLE hProcess,
PCSTR pszSrvPath,
PCSTR pszFile,
PSTR pszIndex,
size_t Size,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymSrvGetFileIndexStringW(HANDLE hProcess,
PCWSTR pszSrvPath,
PCWSTR pszFile,
PWSTR pszIndex,
size_t Size,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymSrvGetFileIndexes(PCSTR File,
GUID* Id,
DWORD* Val1,
DWORD* Val2,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymSrvGetFileIndexesW(PCWSTR File,
GUID* Id,
DWORD* Val1,
DWORD* Val2,
DWORD dwFlags)
{
UNIMPLEMENTED;
return FALSE;
}
PCSTR WINAPI
SymSrvGetSupplement(HANDLE hProcess,
PCSTR pszSymPath,
PCSTR pszNode,
PCSTR pszFile)
{
UNIMPLEMENTED;
return NULL;
}
PCWSTR WINAPI
SymSrvGetSupplementW(HANDLE hProcess,
PCWSTR pszSymPath,
PCWSTR pszNode,
PCWSTR pszFile)
{
UNIMPLEMENTED;
return NULL;
}
BOOL WINAPI
SymSrvIsStore(HANDLE hProcess,
PCSTR pszPath)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL WINAPI
SymSrvIsStoreW(HANDLE hProcess,
PCWSTR pszPath)
{
UNIMPLEMENTED;
return FALSE;
}
PCSTR WINAPI
SymSrvStoreFile(HANDLE hProcess,
PCSTR pszSrvPath,
PCSTR pszFile,
DWORD pszFlags)
{
UNIMPLEMENTED;
return NULL;
}
PCWSTR WINAPI
SymSrvStoreFileW(HANDLE hProcess,
PCWSTR pszSrvPath,
PCWSTR pszFile,
DWORD dwFlags)
{
UNIMPLEMENTED;
return NULL;
}
PCSTR WINAPI
SymSrvStoreSupplement(HANDLE hProcess,
PCSTR pszSymPath,
PCSTR pszNode,
PCSTR pszFile,
DWORD dwFlags)
{
UNIMPLEMENTED;
return NULL;
}
PCWSTR WINAPI
SymSrvStoreSupplementW(HANDLE hProcess,
PCWSTR pszSymPath,
PCWSTR pszNode,
PCWSTR pszFile,
DWORD dwFlags)
{
UNIMPLEMENTED;
return NULL;
}
BOOL WINAPI
SymUnDName64(PIMAGEHLP_SYMBOL64 Symbol,
PSTR pszUndecoratedName,
DWORD dwUndecoratedNameLength)
{
UNIMPLEMENTED;
return FALSE;
}
DWORD WINAPI
UnDecorateSymbolNameW(PCWSTR DecoratedName,
PWSTR pszUnDecoratedName,
DWORD dwUndecoratedLength,
DWORD dwFlags)
{
UNIMPLEMENTED;
return 0;
}
HANDLE
WINAPI
FindDebugInfoFileExW(
PCWSTR FileName,
PCWSTR SymbolPath,
PWSTR DebugFilePath,
PFIND_DEBUG_FILE_CALLBACKW Callback,
PVOID CallerData)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymAddSourceStream(
HANDLE hProcess,
ULONG64 Base,
PCSTR StreamFile,
PBYTE Buffer,
size_t Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymAddSourceStreamW(
HANDLE hProcess,
ULONG64 Base,
PCWSTR FileSpec,
PBYTE Buffer,
size_t Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymEnumSourceFileTokens(
HANDLE hProcess,
ULONG64 Base,
PENUMSOURCEFILETOKENSCALLBACK Callback)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymAddSourceStreamA(
HANDLE hProcess,
ULONG64 Base,
PCSTR StreamFile,
PBYTE Buffer,
size_t Size)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymEnumTypesByName(
HANDLE hProcess,
ULONG64 BaseOfDll,
PCSTR mask,
PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
PVOID UserContext)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymEnumTypesByNameW(
HANDLE hProcess,
ULONG64 BaseOfDll,
PCWSTR mask,
PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,
PVOID UserContext)
{
UNIMPLEMENTED;
return FALSE;
}
HANDLE
WINAPI
SymFindDebugInfoFile(
HANDLE hProcess,
PCSTR FileName,
PSTR DebugFilePath,
PFIND_DEBUG_FILE_CALLBACK Callback,
PVOID CallerData)
{
UNIMPLEMENTED;
return 0;
}
HANDLE
WINAPI
SymFindDebugInfoFileW(
HANDLE hProcess,
PCWSTR FileName,
PWSTR DebugFilePath,
PFIND_DEBUG_FILE_CALLBACKW Callback,
PVOID CallerData)
{
UNIMPLEMENTED;
return 0;
}
HANDLE
WINAPI
SymFindExecutableImage(
HANDLE hProcess,
PCSTR FileName,
PSTR ImageFilePath,
PFIND_EXE_FILE_CALLBACK Callback,
PVOID CallerData)
{
UNIMPLEMENTED;
return 0;
}
HANDLE
WINAPI
SymFindExecutableImageW(
HANDLE hProcess,
PCWSTR FileName,
PWSTR ImageFilePath,
PFIND_EXE_FILE_CALLBACKW Callback,
PVOID CallerData)
{
UNIMPLEMENTED;
return 0;
}
BOOL
WINAPI
SymSrvGetFileIndexInfo(
PCSTR File,
PSYMSRV_INDEX_INFO Info,
DWORD Flags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymSrvGetFileIndexInfoW(
PCWSTR File,
PSYMSRV_INDEX_INFO Info,
DWORD Flags)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymGetOmaps(
HANDLE hProcess,
DWORD64 BaseOfDll,
POMAP *OmapTo,
PDWORD64 cOmapTo,
POMAP *OmapFrom,
PDWORD64 cOmapFrom)
{
UNIMPLEMENTED;
return FALSE;
}
BOOL
WINAPI
SymGetUnwindInfo(
HANDLE hProcess,
DWORD64 Address,
PVOID Buffer,
PULONG Size)
{
UNIMPLEMENTED;
return FALSE;
}

View file

@ -154,6 +154,55 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask,
return TRUE;
}
static inline void re_append(char** mask, unsigned* len, char ch)
{
*mask = HeapReAlloc(GetProcessHeap(), 0, *mask, ++(*len));
(*mask)[*len - 2] = ch;
}
static BOOL compile_regex(regex_t* re, const char* srcfile)
{
char* mask;
unsigned len = 1;
mask = HeapAlloc(GetProcessHeap(), 0, 1);
re_append(&mask, &len, '^');
if (!srcfile || !*srcfile) re_append(&mask, &len, '*');
else while (*srcfile)
{
switch (*srcfile)
{
case '\\':
case '/':
re_append(&mask, &len, '[');
re_append(&mask, &len, '\\');
re_append(&mask, &len, '\\');
re_append(&mask, &len, '/');
re_append(&mask, &len, ']');
break;
case '.':
re_append(&mask, &len, '\\');
re_append(&mask, &len, '.');
break;
default:
re_append(&mask, &len, *srcfile);
break;
}
srcfile++;
}
re_append(&mask, &len, '$');
mask[len - 1] = '\0';
len = regcomp(re, mask, REG_NOSUB);
HeapFree(GetProcessHeap(), 0, mask);
if (len)
{
FIXME("Couldn't compile %s\n", mask);
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
return TRUE;
}
/******************************************************************
* SymEnumLines (DBGHELP.@)
*
@ -172,17 +221,13 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
if (!cb) return FALSE;
if (!(dbghelp_options & SYMOPT_LOAD_LINES)) return TRUE;
if (regcomp(&re, srcfile, REG_NOSUB))
{
FIXME("Couldn't compile %s\n", srcfile);
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pair.pcs = process_find_by_handle(hProcess);
if (!pair.pcs) return FALSE;
if (compiland) FIXME("Unsupported yet (filtering on compiland %s)\n", compiland);
pair.requested = module_find_by_addr(pair.pcs, base, DMT_UNKNOWN);
if (!module_get_debug(&pair)) return FALSE;
if (!compile_regex(&re, srcfile)) return FALSE;
sci.SizeOfStruct = sizeof(sci);
sci.ModBase = base;
@ -190,7 +235,7 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
hash_table_iter_init(&pair.effective->ht_symbols, &hti, NULL);
while ((ptr = hash_table_iter_up(&hti)))
{
int i;
unsigned int i;
sym = GET_ENTRY(ptr, struct symt_ht, hash_elt);
if (sym->symt.tag != SymTagFunction) continue;
@ -215,6 +260,7 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
}
}
}
regfree(&re);
return TRUE;
}

View file

@ -63,7 +63,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_stabs);
_CRTIMP UINT64 _strtoui64( const char *nptr, char **endptr, int base );
#define strtoull _strtoui64
#ifndef N_UNDF
@ -1134,7 +1133,7 @@ static inline void pending_add(struct pending_block* pending, const char* name,
static void pending_flush(struct pending_block* pending, struct module* module,
struct symt_function* func, struct symt_block* block)
{
int i;
unsigned int i;
for (i = 0; i < pending->num; i++)
{

View file

@ -3,7 +3,7 @@
*
* Copyright 1995 Alexandre Julliard
* Copyright 1996 Eric Youngdale
* Copyright 1999 Ove Kåven
* Copyright 1999 Ove Kåven
* Copyright 2004 Eric Pouech
*
* This library is free software; you can redistribute it and/or
@ -386,7 +386,7 @@ static BOOL stack_walk(struct stack_walk_callback* cb, LPSTACKFRAME frame)
if (curr_mode == stm_16bit)
{
int i;
unsigned int i;
p = sw_xlat_addr(cb, &frame->AddrFrame);
if (!sw_read_mem(cb, p + sizeof(WORD), &val, sizeof(WORD)))

View file

@ -96,7 +96,7 @@ void* pool_alloc(struct pool* pool, unsigned len)
}
arena = HeapAlloc(GetProcessHeap(), 0, pool->arena_size);
if (!arena) {FIXME("OOM\n");return NULL;}
if (!arena) {ERR("OOM\n");return NULL;}
ret = (char*)arena + sizeof(*arena);
arena->next = pool->first;

View file

@ -715,6 +715,18 @@ static BOOL resort_symbols(struct module* module)
return module->sortlist_valid = TRUE;
}
static void symt_get_length(struct symt* symt, ULONG64* size)
{
DWORD type_index;
if (symt_get_info(symt, TI_GET_LENGTH, size) && *size)
return;
if (symt_get_info(symt, TI_GET_TYPE, &type_index) &&
symt_get_info((struct symt*)type_index, TI_GET_LENGTH, size)) return;
*size = 0x1000; /* arbitrary value */
}
/* assume addr is in module */
struct symt_ht* symt_find_nearest(struct module* module, DWORD addr)
{
@ -737,8 +749,7 @@ struct symt_ht* symt_find_nearest(struct module* module, DWORD addr)
if (high)
{
symt_get_info(&module->addr_sorttab[high - 1]->symt, TI_GET_ADDRESS, &ref_addr);
if (!symt_get_info(&module->addr_sorttab[high - 1]->symt, TI_GET_LENGTH, &ref_size) || !ref_size)
ref_size = 0x1000; /* arbitrary value */
symt_get_length(&module->addr_sorttab[high - 1]->symt, &ref_size);
if (addr >= ref_addr + ref_size) return NULL;
}
@ -772,8 +783,7 @@ struct symt_ht* symt_find_nearest(struct module* module, DWORD addr)
/* finally check that we fit into the found symbol */
symt_get_info(&module->addr_sorttab[low]->symt, TI_GET_ADDRESS, &ref_addr);
if (addr < ref_addr) return NULL;
if (!symt_get_info(&module->addr_sorttab[high - 1]->symt, TI_GET_LENGTH, &ref_size) || !ref_size)
ref_size = 0x1000; /* arbitrary value */
symt_get_length(&module->addr_sorttab[low]->symt, &ref_size);
if (addr >= ref_addr + ref_size) return NULL;
return module->addr_sorttab[low];
@ -785,7 +795,7 @@ static BOOL symt_enum_locals_helper(struct module_pair* pair,
{
struct symt* lsym = NULL;
DWORD pc = pair->pcs->ctx_frame.InstructionOffset;
int i;
unsigned int i;
for (i=0; i<vector_length(v); i++)
{
@ -854,7 +864,7 @@ static BOOL symt_enum_locals(struct process* pcs, const char* mask,
/******************************************************************
* copy_symbolW
*
* Helper for transforming an ANSI symbol info into an UNICODE one.
* Helper for transforming an ANSI symbol info into a UNICODE one.
* Assume that MaxNameLen is the same for both version (A & W).
*/
void copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si)
@ -999,30 +1009,6 @@ static BOOL CALLBACK sym_enumW(PSYMBOL_INFO si, ULONG size, PVOID ctx)
return (sew->cb)(sew->sym_info, size, sew->ctx);
}
/******************************************************************
* SymEnumSymbolsForAddrW (DBGHELP.@)
*
*/
BOOL WINAPI SymEnumSymbolsForAddrW(HANDLE hProcess, DWORD64 Address,
PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,
PVOID UserContext)
{
UNIMPLEMENTED;
return FALSE;
}
/******************************************************************
* SymEnumSymbolsForAddr (DBGHELP.@)
*
*/
BOOL WINAPI SymEnumSymbolsForAddr(HANDLE hProcess, DWORD64 Address,
PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,
PVOID UserContext)
{
UNIMPLEMENTED;
return FALSE;
}
/******************************************************************
* SymEnumSymbolsW (DBGHELP.@)
*
@ -1730,3 +1716,49 @@ BOOL WINAPI SymSearchW(HANDLE hProcess, ULONG64 BaseOfDll, DWORD Index,
return ret;
}
/******************************************************************
* SymAddSymbol (DBGHELP.@)
*
*/
BOOL WINAPI SymAddSymbol(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR name,
DWORD64 addr, DWORD size, DWORD flags)
{
WCHAR nameW[MAX_SYM_NAME];
MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, sizeof(nameW) / sizeof(WCHAR));
return SymAddSymbolW(hProcess, BaseOfDll, nameW, addr, size, flags);
}
/******************************************************************
* SymAddSymbolW (DBGHELP.@)
*
*/
BOOL WINAPI SymAddSymbolW(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR name,
DWORD64 addr, DWORD size, DWORD flags)
{
struct module_pair pair;
TRACE("(%p %s %s %u)\n", hProcess, wine_dbgstr_w(name), wine_dbgstr_longlong(addr), size);
pair.pcs = process_find_by_handle(hProcess);
if (!pair.pcs) return FALSE;
pair.requested = module_find_by_addr(pair.pcs, BaseOfDll, DMT_UNKNOWN);
if (!module_get_debug(&pair)) return FALSE;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/******************************************************************
* SymSetScopeFromAddr (DBGHELP.@)
*/
BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr)
{
struct process* pcs;
FIXME("(%p %s): stub\n", hProcess, wine_dbgstr_longlong(addr));
if (!(pcs = process_find_by_handle(hProcess))) return FALSE;
return TRUE;
}

View file

@ -218,7 +218,7 @@ BOOL symt_add_udt_element(struct module* module, struct symt_udt* udt_type,
TRACE_(dbghelp_symt)("Adding %s to UDT %s\n", name, udt_type->hash_elt.name);
if (name)
{
int i;
unsigned int i;
for (i=0; i<vector_length(&udt_type->vchildren); i++)
{
m = *(struct symt_data**)vector_at(&udt_type->vchildren, i);
@ -384,7 +384,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll,
const char* tmp;
struct symt* type;
DWORD64 size;
int i;
unsigned int i;
TRACE("(%p %s %p %p)\n",
hProcess, wine_dbgstr_longlong(BaseOfDll), EnumSymbolsCallback,
@ -432,7 +432,7 @@ struct enum_types_AtoW
PSYM_ENUMERATESYMBOLS_CALLBACKW callback;
};
BOOL CALLBACK enum_types_AtoW(PSYMBOL_INFO si, ULONG addr, PVOID _et)
static BOOL CALLBACK enum_types_AtoW(PSYMBOL_INFO si, ULONG addr, PVOID _et)
{
struct enum_types_AtoW* et = _et;
SYMBOL_INFOW* siW = (SYMBOL_INFOW*)et->buffer;

View file

@ -1123,8 +1123,7 @@ HANDLE WINAPI SymFindDebugInfoFile(HANDLE, PCSTR, PSTR, PFIND_DEBUG_FILE_CALLBAC
HANDLE WINAPI SymFindDebugInfoFileW(HANDLE, PCWSTR, PWSTR, PFIND_DEBUG_FILE_CALLBACKW, PVOID);
typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR, PVOID);
typedef BOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR, PVOID);
BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
PSTR, PFINDFILEINPATHCALLBACK, PVOID);
BOOL WINAPI FindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD, PSTR);
BOOL WINAPI SymFindFileInPath(HANDLE, PCSTR, PCSTR, PVOID, DWORD, DWORD, DWORD,
PSTR, PFINDFILEINPATHCALLBACK, PVOID);
BOOL WINAPI SymFindFileInPathW(HANDLE, PCWSTR, PCWSTR, PVOID, DWORD, DWORD, DWORD,

View file

@ -1522,6 +1522,28 @@ union codeview_symbol
unsigned int offset;
unsigned short segment;
} ssearch_v1;
struct
{
short int len;
short int id;
unsigned int offset;
unsigned int unknown;
} security_cookie_v3;
struct
{
short int len;
short int id;
unsigned int unknown1; /* maybe size (of what ?) */
unsigned int unknown2;
unsigned int unknown3;
unsigned int unknown4; /* maybe size (of what ?) */
unsigned int unknown5; /* maybe address <offset and segment> (of what ?) */
unsigned short unknown6;
unsigned short flags;
unsigned int unknown7;
} func_info_v2;
};
#define S_COMPILAND_V1 0x0001
@ -1575,9 +1597,7 @@ union codeview_symbol
#define S_REGREL_V2 0x100d
#define S_LTHREAD_V2 0x100e
#define S_GTHREAD_V2 0x100f
#if 0
#define S_XXXXXXXXX_32 0x1012 /* seems linked to a function, content unknown */
#endif
#define S_FUNCINFO_V2 0x1012
#define S_COMPILAND_V2 0x1013
#define S_COMPILAND_V3 0x1101
@ -1597,18 +1617,23 @@ union codeview_symbol
#define S_MSTOOL_V3 0x1116 /* compiler command line options and build information */
#define S_PUB_FUNC1_V3 0x1125 /* didn't get the difference between the two */
#define S_PUB_FUNC2_V3 0x1127
#define S_SECTINFO_V3 0x1136
#define S_SUBSECTINFO_V3 0x1137
#define S_ENTRYPOINT_V3 0x1138
#define S_SECUCOOKIE_V3 0x113A
#define S_MSTOOLINFO_V3 0x113C
#define S_MSTOOLENV_V3 0x113D
/* ======================================== *
* Line number information
* ======================================== */
union any_size
struct codeview_linetab_block
{
const char* c;
const unsigned char* uc;
const short* s;
const int* i;
const unsigned int* ui;
unsigned short seg;
unsigned short num_lines;
unsigned int offsets[1]; /* in fact num_lines */
/* unsigned short linenos[]; */
};
struct startend
@ -1617,17 +1642,37 @@ struct startend
unsigned int end;
};
struct codeview_linetab
/* there's a new line tab structure from MS Studio 2005 and after
* it's made of:
* DWORD 000000f4
* DWORD lineblk_offset (counting bytes after this field)
* an array of codeview_linetab2_file structures
* an array (starting at <lineblk_offset>) of codeview_linetab2_block structures
*/
struct codeview_linetab2_file
{
unsigned int nline;
unsigned int segno;
unsigned int start;
unsigned int end;
unsigned int source;
const unsigned short* linetab;
const unsigned int* offtab;
DWORD offset; /* offset in string table for filename */
WORD unk; /* always 0x0110... type of following information ??? */
BYTE md5[16]; /* MD5 signature of file (signature on file's content or name ???) */
WORD pad0; /* always 0 */
};
struct codeview_linetab2_block
{
DWORD header; /* 0x000000f2 */
DWORD size_of_block; /* next block is at # bytes after this field */
DWORD start; /* start address of function with line numbers */
DWORD seg; /* segment of function with line numbers */
DWORD size; /* size of function with line numbers */
DWORD file_offset; /* offset for accessing corresponding codeview_linetab2_file */
DWORD nlines; /* number of lines in this block */
DWORD size_lines; /* number of bytes following for line number information */
struct {
DWORD offset; /* offset (from <seg>:<start>) for line number */
DWORD lineno; /* the line number (OR:ed with 0x80000000 why ???) */
} l[1]; /* actually array of <nlines> */
};
/* ======================================== *
* PDB file information
@ -1879,7 +1924,7 @@ typedef struct OMFSignatureRSDS
{
char Signature[4];
GUID guid;
DWORD unknown;
DWORD age;
CHAR name[1];
} OMFSignatureRSDS;
@ -1888,7 +1933,7 @@ typedef struct _CODEVIEW_PDB_DATA
char Signature[4];
long filepos;
DWORD timestamp;
DWORD unknown;
DWORD age;
CHAR name[1];
} CODEVIEW_PDB_DATA, *PCODEVIEW_PDB_DATA;