* Add symbol size to internal symbol table.
*/
-#include "dbghelp_private.h"
+#define NONAMELESSUNION
-#include <wine/exception.h>
+#include "config.h"
+#include "wine/port.h"
-WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
-#define MAX_PATHNAME_LEN 1024
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+#include "wine/exception.h"
+#include "wine/debug.h"
+#include "dbghelp_private.h"
+#include "wine/mscvpdb.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
struct pdb_stream_name
{
cv_basic_types[T_REAL80] = &symt_new_basic(module, btFloat, "long double", 10)->symt;
cv_basic_types[T_RCHAR] = &symt_new_basic(module, btInt, "signed char", 1)->symt;
cv_basic_types[T_WCHAR] = &symt_new_basic(module, btWChar, "wchar_t", 2)->symt;
+ cv_basic_types[T_CHAR16] = &symt_new_basic(module, btChar16,"char16_t", 2)->symt;
+ cv_basic_types[T_CHAR32] = &symt_new_basic(module, btChar32,"char32_t", 4)->symt;
cv_basic_types[T_INT2] = &symt_new_basic(module, btInt, "INT2", 2)->symt;
cv_basic_types[T_UINT2] = &symt_new_basic(module, btUInt, "UINT2", 2)->symt;
cv_basic_types[T_INT4] = &symt_new_basic(module, btInt, "INT4", 4)->symt;
cv_basic_types[T_32PREAL80] = &symt_new_pointer(module, cv_basic_types[T_REAL80], 4)->symt;
cv_basic_types[T_32PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], 4)->symt;
cv_basic_types[T_32PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], 4)->symt;
+ cv_basic_types[T_32PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], 4)->symt;
+ cv_basic_types[T_32PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], 4)->symt;
cv_basic_types[T_32PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], 4)->symt;
cv_basic_types[T_32PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], 4)->symt;
cv_basic_types[T_32PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], 4)->symt;
cv_basic_types[T_64PREAL80] = &symt_new_pointer(module, cv_basic_types[T_REAL80], 8)->symt;
cv_basic_types[T_64PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], 8)->symt;
cv_basic_types[T_64PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], 8)->symt;
+ cv_basic_types[T_64PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], 8)->symt;
+ cv_basic_types[T_64PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], 8)->symt;
cv_basic_types[T_64PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], 8)->symt;
cv_basic_types[T_64PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], 8)->symt;
cv_basic_types[T_64PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], 8)->symt;
cv_basic_types[T_64PINT8] = &symt_new_pointer(module, cv_basic_types[T_INT8], 8)->symt;
cv_basic_types[T_64PUINT8] = &symt_new_pointer(module, cv_basic_types[T_UINT8], 8)->symt;
cv_basic_types[T_64PHRESULT]= &symt_new_pointer(module, cv_basic_types[T_HRESULT], 8)->symt;
+
+ cv_basic_types[T_PVOID] = &symt_new_pointer(module, cv_basic_types[T_VOID], sizeof(void*))->symt;
+ cv_basic_types[T_PCHAR] = &symt_new_pointer(module, cv_basic_types[T_CHAR], sizeof(void*))->symt;
+ cv_basic_types[T_PSHORT] = &symt_new_pointer(module, cv_basic_types[T_SHORT], sizeof(void*))->symt;
+ cv_basic_types[T_PLONG] = &symt_new_pointer(module, cv_basic_types[T_LONG], sizeof(void*))->symt;
+ cv_basic_types[T_PQUAD] = &symt_new_pointer(module, cv_basic_types[T_QUAD], sizeof(void*))->symt;
+ cv_basic_types[T_PUCHAR] = &symt_new_pointer(module, cv_basic_types[T_UCHAR], sizeof(void*))->symt;
+ cv_basic_types[T_PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT], sizeof(void*))->symt;
+ cv_basic_types[T_PULONG] = &symt_new_pointer(module, cv_basic_types[T_ULONG], sizeof(void*))->symt;
+ cv_basic_types[T_PUQUAD] = &symt_new_pointer(module, cv_basic_types[T_UQUAD], sizeof(void*))->symt;
+ cv_basic_types[T_PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08], sizeof(void*))->symt;
+ cv_basic_types[T_PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16], sizeof(void*))->symt;
+ cv_basic_types[T_PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32], sizeof(void*))->symt;
+ cv_basic_types[T_PBOOL64] = &symt_new_pointer(module, cv_basic_types[T_BOOL64], sizeof(void*))->symt;
+ cv_basic_types[T_PREAL32] = &symt_new_pointer(module, cv_basic_types[T_REAL32], sizeof(void*))->symt;
+ cv_basic_types[T_PREAL64] = &symt_new_pointer(module, cv_basic_types[T_REAL64], sizeof(void*))->symt;
+ cv_basic_types[T_PREAL80] = &symt_new_pointer(module, cv_basic_types[T_REAL80], sizeof(void*))->symt;
+ cv_basic_types[T_PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], sizeof(void*))->symt;
+ cv_basic_types[T_PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], sizeof(void*))->symt;
+ cv_basic_types[T_PCHAR16] = &symt_new_pointer(module, cv_basic_types[T_CHAR16], sizeof(void*))->symt;
+ cv_basic_types[T_PCHAR32] = &symt_new_pointer(module, cv_basic_types[T_CHAR32], sizeof(void*))->symt;
+ cv_basic_types[T_PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], sizeof(void*))->symt;
+ cv_basic_types[T_PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], sizeof(void*))->symt;
+ cv_basic_types[T_PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], sizeof(void*))->symt;
+ cv_basic_types[T_PUINT4] = &symt_new_pointer(module, cv_basic_types[T_UINT4], sizeof(void*))->symt;
+ cv_basic_types[T_PINT8] = &symt_new_pointer(module, cv_basic_types[T_INT8], sizeof(void*))->symt;
+ cv_basic_types[T_PUINT8] = &symt_new_pointer(module, cv_basic_types[T_UINT8], sizeof(void*))->symt;
}
static int leaf_as_variant(VARIANT* v, const unsigned short int* leaf)
hash_table_iter_init(&ctp->module->ht_types, &hti, name);
while ((ptr = hash_table_iter_up(&hti)))
{
- type = GET_ENTRY(ptr, struct symt_ht, hash_elt);
+ type = CONTAINING_RECORD(ptr, struct symt_ht, hash_elt);
if (type->symt.tag == SymTagUDT &&
type->hash_elt.name && !strcmp(type->hash_elt.name, name))
break;
/* the symbols we can safely ignore for now */
- case 0x112c:
+ case S_TRAMPOLINE:
case S_FRAMEINFO_V2:
case S_SECUCOOKIE_V3:
case S_SECTINFO_V3:
case S_SUBSECTINFO_V3:
case S_ENTRYPOINT_V3:
- case 0x1139:
+ case S_LOCAL_VS2013:
+ case S_CALLSITEINFO:
+ case S_DEFRANGE_REGISTER:
+ case S_DEFRANGE_FRAMEPOINTER_REL:
+ case S_DEFRANGE_SUBFIELD_REGISTER:
+ case S_FPOFF_VS2013:
+ case S_DEFRANGE_REGISTER_REL:
+ case S_BUILDINFO:
+ case S_INLINESITE:
+ case S_INLINESITE_END:
+ case S_FILESTATIC:
+ case S_CALLEES:
TRACE("Unsupported symbol id %x\n", sym->generic.id);
break;
switch (sym->generic.id)
{
- case S_PUB_V1: /* FIXME is this really a 'data_v1' structure ?? */
+ case S_PUB_V1:
if (!(dbghelp_options & SYMOPT_NO_PUBLICS))
{
symt_new_public(msc_dbg->module, compiland,
- terminate_string(&sym->data_v1.p_name),
- codeview_get_address(msc_dbg, sym->data_v1.segment, sym->data_v1.offset), 1);
+ terminate_string(&sym->public_v1.p_name),
+ sym->public_v1.symtype == SYMTYPE_FUNCTION,
+ codeview_get_address(msc_dbg, sym->public_v1.segment, sym->public_v1.offset), 1);
}
break;
- case S_PUB_V2: /* FIXME is this really a 'data_v2' structure ?? */
+ case S_PUB_V2:
if (!(dbghelp_options & SYMOPT_NO_PUBLICS))
{
symt_new_public(msc_dbg->module, compiland,
- terminate_string(&sym->data_v2.p_name),
- codeview_get_address(msc_dbg, sym->data_v2.segment, sym->data_v2.offset), 1);
+ terminate_string(&sym->public_v2.p_name),
+ sym->public_v3.symtype == SYMTYPE_FUNCTION,
+ codeview_get_address(msc_dbg, sym->public_v2.segment, sym->public_v2.offset), 1);
}
break;
if (!(dbghelp_options & SYMOPT_NO_PUBLICS))
{
symt_new_public(msc_dbg->module, compiland,
- sym->data_v3.name,
- codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset), 1);
+ sym->public_v3.name,
+ sym->public_v3.symtype == SYMTYPE_FUNCTION,
+ codeview_get_address(msc_dbg, sym->public_v3.segment, sym->public_v3.offset), 1);
}
break;
case S_PUB_FUNC1_V3:
HeapFree(GetProcessHeap(), 0, pdb_file->stream_dict);
}
-static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb)
+static void pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb)
{
DWORD* pdw;
DWORD* ok_bits;
count = *pdw++;
pdb_file->stream_dict = HeapAlloc(GetProcessHeap(), 0, (numok + 1) * sizeof(struct pdb_stream_name) + cb);
- if (!pdb_file->stream_dict) return FALSE;
+ if (!pdb_file->stream_dict) return;
cpstr = (char*)(pdb_file->stream_dict + numok + 1);
memcpy(cpstr, str, cb);
if (*pdw++ != 0)
{
FIXME("unexpected value\n");
- return -1;
+ return;
}
for (i = j = 0; i < count; i++)
/* add sentinel */
pdb_file->stream_dict[numok].name = NULL;
pdb_file->fpoext_stream = -1;
- return j == numok && i == count;
}
static unsigned pdb_get_stream_by_name(const struct pdb_file_info* pdb_file, const char* name)
switch (lookup->kind)
{
case PDB_JG:
- ret = path_find_symbol_file(pcs, lookup->filename, NULL, lookup->timestamp,
+ ret = path_find_symbol_file(pcs, module, lookup->filename, NULL, lookup->timestamp,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
case PDB_DS:
- ret = path_find_symbol_file(pcs, lookup->filename, &lookup->guid, 0,
+ ret = path_find_symbol_file(pcs, module, lookup->filename, &lookup->guid, 0,
lookup->age, dbg_file_path, &module->module.PdbUnmatched);
break;
}
if (ret)
{
struct pdb_module_info* pdb_info = msc_dbg->module->format_info[DFI_PDB]->u.pdb_info;
- msc_dbg->module->module.SymType = SymCv;
+ msc_dbg->module->module.SymType = SymPdb;
if (pdb_info->pdb_files[0].kind == PDB_JG)
msc_dbg->module->module.PdbSig = pdb_info->pdb_files[0].u.jg.timestamp;
else
struct hash_table_elt elt;
};
-#define PEV_ERROR(pev, msg) snprintf((pev)->error, sizeof((pev)->error), "%s", (msg)),FALSE
-#define PEV_ERROR1(pev, msg, pmt) snprintf((pev)->error, sizeof((pev)->error), (msg), (pmt)),FALSE
+#define PEV_ERROR(pev, msg) snprintf((pev)->error, sizeof((pev)->error), "%s", (msg))
+#define PEV_ERROR1(pev, msg, pmt) snprintf((pev)->error, sizeof((pev)->error), (msg), (pmt))
#if 0
static void pev_dump_stack(struct pevaluator* pev)
hash_table_iter_init(&pev->values, &hti, str);
while ((ptr = hash_table_iter_up(&hti)))
{
- if (!strcmp(GET_ENTRY(ptr, struct zvalue, elt)->elt.name, str))
+ if (!strcmp(CONTAINING_RECORD(ptr, struct zvalue, elt)->elt.name, str))
{
- *val = GET_ENTRY(ptr, struct zvalue, elt)->value;
+ *val = CONTAINING_RECORD(ptr, struct zvalue, elt)->value;
return TRUE;
}
}
hash_table_iter_init(&pev->values, &hti, name);
while ((ptr = hash_table_iter_up(&hti)))
{
- if (!strcmp(GET_ENTRY(ptr, struct zvalue, elt)->elt.name, name))
+ if (!strcmp(CONTAINING_RECORD(ptr, struct zvalue, elt)->elt.name, name))
{
- GET_ENTRY(ptr, struct zvalue, elt)->value = val;
+ CONTAINING_RECORD(ptr, struct zvalue, elt)->value = val;
break;
}
}