WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
-#define MAX_PATHNAME_LEN 1024
-
struct pdb_stream_name
{
const char* 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)
return &symt_new_array(ctp->module, 0, -arr_len, elem, index)->symt;
}
-static int codeview_add_type_enum_field_list(struct module* module,
- struct symt_enum* symt,
- const union codeview_reftype* ref_type)
+static BOOL codeview_add_type_enum_field_list(struct module* module,
+ struct symt_enum* symt,
+ const union codeview_reftype* ref_type)
{
const unsigned char* ptr = ref_type->fieldlist.list;
const unsigned char* last = (const BYTE*)ref_type + ref_type->generic.len + 2;
}
break;
+ case LF_INDEX_V1:
+ if (!codeview_add_type_struct_field_list(ctp, symt, type->index_v1.ref))
+ return FALSE;
+ ptr += 2 + 2;
+ break;
+
+ case LF_INDEX_V2:
+ if (!codeview_add_type_struct_field_list(ctp, symt, type->index_v2.ref))
+ return FALSE;
+ ptr += 2 + 2 + 4;
+ break;
+
default:
FIXME("Unsupported type %04x in STRUCT field list\n", type->generic.id);
return FALSE;
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))
default:
FIXME("Unsupported type-id leaf %x\n", type->generic.id);
dump(type, 2 + type->generic.len);
- return FALSE;
+ return NULL;
}
return codeview_add_type(curr_type, symt) ? symt : NULL;
}
-static int codeview_parse_type_table(struct codeview_type_parse* ctp)
+static BOOL codeview_parse_type_table(struct codeview_type_parse* ctp)
{
unsigned int curr_type = FIRST_DEFINABLE_TYPE;
const union codeview_type* type;
{
const BYTE* ptr = linetab;
int nfile, nseg;
- int i, j, k;
+ int i, j;
+ unsigned int k;
const unsigned int* filetab;
const unsigned int* lt_ptr;
const unsigned short* linenos;
}
}
-static int codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root,
- int offset, int size, BOOL do_globals)
+static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root,
+ int offset, int size, BOOL do_globals)
{
struct symt_function* curr_func = NULL;
int i, length;
struct symt_block* block = NULL;
struct symt* symt;
- const char* name;
struct symt_compiland* compiland = NULL;
struct location loc;
case S_PROCREF_V1:
case S_DATAREF_V1:
case S_LPROCREF_V1:
- name = (const char*)sym + length;
- length += (*name + 1 + 3) & ~3;
- break;
+ {
+ const char* name;
+
+ name = (const char*)sym + length;
+ length += (*name + 1 + 3) & ~3;
+ break;
+ }
case S_MSTOOL_V3: /* just to silence a few warnings */
case S_MSTOOLINFO_V3:
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;
return TRUE;
}
-static int codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BYTE* root,
- int offset, int size)
+static BOOL codeview_snarf_public(const struct msc_debug_info* msc_dbg, const BYTE* root,
+ int offset, int size)
{
int i, length;
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 (pdb_lookup->kind != PDB_JG)
{
WARN("Found %s, but wrong PDB kind\n", pdb_lookup->filename);
+ pdb_free(root);
return FALSE;
}
pdb_file->kind = PDB_JG;
while (imp < (const PDB_SYMBOL_IMPORT*)last)
{
ptr = (const char*)imp + sizeof(*imp) + strlen(imp->filename);
- if (i >= CV_MAX_MODULES) FIXME("Out of bounds !!!\n");
+ if (i >= CV_MAX_MODULES) FIXME("Out of bounds!!!\n");
if (!strcasecmp(pdb_lookup->filename, imp->filename))
{
if (module_index != -1) FIXME("Twice the entry\n");
pdb_module_info->used_subfiles = 1;
}
cv_current_module = &cv_zmodules[module_index];
- if (cv_current_module->allowed) FIXME("Already allowed ??\n");
+ if (cv_current_module->allowed) FIXME("Already allowed??\n");
cv_current_module->allowed = TRUE;
}
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;
}
}
ctp.table = (const BYTE*)(ctp.offset + types->cTypes);
cv_current_module = &cv_zmodules[0];
- if (cv_current_module->allowed) FIXME("Already allowed ??\n");
+ if (cv_current_module->allowed) FIXME("Already allowed??\n");
cv_current_module->allowed = TRUE;
codeview_parse_type_table(&ctp);