ReactOS  0.4.15-dev-1018-g0695ecb
msc.c File Reference
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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"
Include dependency graph for msc.c:

Go to the source code of this file.

Classes

struct  pdb_stream_name
 
struct  pdb_file_info
 
struct  pdb_module_info
 
struct  cv_defined_module
 
struct  codeview_type_parse
 
struct  pevaluator
 
struct  zvalue
 

Macros

#define NONAMELESSUNION
 
#define CV_MAX_MODULES   32
 
#define MAX_BUILTIN_TYPES   0x06FF
 
#define FIRST_DEFINABLE_TYPE   0x1000
 
#define CV_MAX_MODULES   32
 
#define PEV_MAX_LEN   32
 
#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))
 
#define MAKESIG(a, b, c, d)   ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
 
#define CODEVIEW_NB09_SIG   MAKESIG('N','B','0','9')
 
#define CODEVIEW_NB10_SIG   MAKESIG('N','B','1','0')
 
#define CODEVIEW_NB11_SIG   MAKESIG('N','B','1','1')
 
#define CODEVIEW_RSDS_SIG   MAKESIG('R','S','D','S')
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dbghelp_msc)
 
static void dump (const void *ptr, unsigned len)
 
static void codeview_init_basic_types (struct module *module)
 
static int leaf_as_variant (VARIANT *v, const unsigned short int *leaf)
 
static int numeric_leaf (int *value, const unsigned short int *leaf)
 
static const charterminate_string (const struct p_string *p_name)
 
static struct symtcodeview_get_type (unsigned int typeno, BOOL quiet)
 
static const voidcodeview_jump_to_type (const struct codeview_type_parse *ctp, DWORD idx)
 
static int codeview_add_type (unsigned int typeno, struct symt *dt)
 
static void codeview_clear_type_table (void)
 
static struct symtcodeview_parse_one_type (struct codeview_type_parse *ctp, unsigned curr_type, const union codeview_type *type, BOOL details)
 
static voidcodeview_cast_symt (struct symt *symt, enum SymTagEnum tag)
 
static struct symtcodeview_fetch_type (struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
 
static struct symtcodeview_add_type_pointer (struct codeview_type_parse *ctp, struct symt *existing, unsigned int pointee_type)
 
static struct symtcodeview_add_type_array (struct codeview_type_parse *ctp, const char *name, unsigned int elemtype, unsigned int indextype, unsigned int arr_len)
 
static BOOL codeview_add_type_enum_field_list (struct module *module, struct symt_enum *symt, const union codeview_reftype *ref_type)
 
static void codeview_add_udt_element (struct codeview_type_parse *ctp, struct symt_udt *symt, const char *name, int value, unsigned type)
 
static int codeview_add_type_struct_field_list (struct codeview_type_parse *ctp, struct symt_udt *symt, unsigned fieldlistno)
 
static struct symtcodeview_add_type_enum (struct codeview_type_parse *ctp, struct symt *existing, const char *name, unsigned fieldlistno, unsigned basetype)
 
static struct symtcodeview_add_type_struct (struct codeview_type_parse *ctp, struct symt *existing, const char *name, int structlen, enum UdtKind kind, unsigned property)
 
static struct symtcodeview_new_func_signature (struct codeview_type_parse *ctp, struct symt *existing, enum CV_call_e call_conv)
 
static void codeview_add_func_signature_args (struct codeview_type_parse *ctp, struct symt_function_signature *sym, unsigned ret_type, unsigned args_list)
 
static BOOL codeview_parse_type_table (struct codeview_type_parse *ctp)
 
static ULONG_PTR codeview_get_address (const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
 
static void codeview_snarf_linetab (const struct msc_debug_info *msc_dbg, const BYTE *linetab, int size, BOOL pascal_str)
 
static void codeview_snarf_linetab2 (const struct msc_debug_info *msc_dbg, const BYTE *linetab, DWORD size, const char *strimage, DWORD strsize)
 
static unsigned int codeview_map_offset (const struct msc_debug_info *msc_dbg, unsigned int offset)
 
static void codeview_add_variable (const struct msc_debug_info *msc_dbg, struct symt_compiland *compiland, const char *name, unsigned segment, unsigned offset, unsigned symtype, BOOL is_local, BOOL in_tls, BOOL force)
 
static BOOL codeview_snarf (const struct msc_debug_info *msc_dbg, const BYTE *root, int offset, int size, BOOL do_globals)
 
static BOOL codeview_snarf_public (const struct msc_debug_info *msc_dbg, const BYTE *root, int offset, int size)
 
static voidpdb_jg_read (const struct PDB_JG_HEADER *pdb, const WORD *block_list, int size)
 
static voidpdb_ds_read (const struct PDB_DS_HEADER *pdb, const DWORD *block_list, int size)
 
static voidpdb_read_jg_file (const struct PDB_JG_HEADER *pdb, const struct PDB_JG_TOC *toc, DWORD file_nr)
 
static voidpdb_read_ds_file (const struct PDB_DS_HEADER *pdb, const struct PDB_DS_TOC *toc, DWORD file_nr)
 
static voidpdb_read_file (const struct pdb_file_info *pdb_file, DWORD file_nr)
 
static unsigned pdb_get_file_size (const struct pdb_file_info *pdb_file, DWORD file_nr)
 
static void pdb_free (void *buffer)
 
static void pdb_free_file (struct pdb_file_info *pdb_file)
 
static void pdb_load_stream_name_table (struct pdb_file_info *pdb_file, const char *str, unsigned cb)
 
static unsigned pdb_get_stream_by_name (const struct pdb_file_info *pdb_file, const char *name)
 
static voidpdb_read_strings (const struct pdb_file_info *pdb_file)
 
static void pdb_module_remove (struct process *pcsn, struct module_format *modfmt)
 
static void pdb_convert_types_header (PDB_TYPES *types, const BYTE *image)
 
static void pdb_convert_symbols_header (PDB_SYMBOLS *symbols, int *header_size, const BYTE *image)
 
static void pdb_convert_symbol_file (const PDB_SYMBOLS *symbols, PDB_SYMBOL_FILE_EX *sfile, unsigned *size, const void *image)
 
static HANDLE map_pdb_file (const struct process *pcs, const struct pdb_lookup *lookup, struct module *module)
 
static void pdb_process_types (const struct msc_debug_info *msc_dbg, const struct pdb_file_info *pdb_file)
 
static BOOL pdb_init (const struct pdb_lookup *pdb_lookup, struct pdb_file_info *pdb_file, const char *image, unsigned *matched)
 
static BOOL pdb_process_internal (const struct process *pcs, const struct msc_debug_info *msc_dbg, const struct pdb_lookup *pdb_lookup, struct pdb_module_info *pdb_module_info, unsigned module_index)
 
static void pdb_process_symbol_imports (const struct process *pcs, const struct msc_debug_info *msc_dbg, const PDB_SYMBOLS *symbols, const void *symbols_image, const char *image, const struct pdb_lookup *pdb_lookup, struct pdb_module_info *pdb_module_info, unsigned module_index)
 
static BOOL pdb_process_file (const struct process *pcs, const struct msc_debug_info *msc_dbg, struct pdb_lookup *pdb_lookup)
 
BOOL pdb_fetch_file_info (const struct pdb_lookup *pdb_lookup, unsigned *matched)
 
static BOOL pev_get_val (struct pevaluator *pev, const char *str, DWORD_PTR *val)
 
static BOOL pev_push (struct pevaluator *pev, const char *elt)
 
static BOOL pev_pop (struct pevaluator *pev, char *elt)
 
static BOOL pev_pop_val (struct pevaluator *pev, DWORD_PTR *val)
 
static BOOL pev_set_value (struct pevaluator *pev, const char *name, DWORD_PTR val)
 
static BOOL pev_binop (struct pevaluator *pev, char op)
 
static BOOL pev_deref (struct pevaluator *pev)
 
static BOOL pev_assign (struct pevaluator *pev)
 
static void pev_init (struct pevaluator *pev, struct cpu_stack_walk *csw, PDB_FPO_DATA *fpoext, struct pdb_cmd_pair *cpair)
 
static BOOL pev_free (struct pevaluator *pev, struct pdb_cmd_pair *cpair)
 
static BOOL pdb_parse_cmd_string (struct cpu_stack_walk *csw, PDB_FPO_DATA *fpoext, const char *cmd, struct pdb_cmd_pair *cpair)
 
BOOL pdb_virtual_unwind (struct cpu_stack_walk *csw, DWORD_PTR ip, union ctx *context, struct pdb_cmd_pair *cpair)
 
static BOOL codeview_process_info (const struct process *pcs, const struct msc_debug_info *msc_dbg)
 
BOOL pe_load_debug_directory (const struct process *pcs, struct module *module, const BYTE *mapping, const IMAGE_SECTION_HEADER *sectp, DWORD nsect, const IMAGE_DEBUG_DIRECTORY *dbg, int nDbg)
 

Variables

static struct symtcv_basic_types [MAX_BUILTIN_TYPES]
 
static struct cv_defined_module cv_zmodules [CV_MAX_MODULES]
 
static struct cv_defined_modulecv_current_module
 
static const char PDB_JG_IDENT [] = "Microsoft C/C++ program database 2.00\r\n\032JG\0"
 
static const char PDB_DS_IDENT [] = "Microsoft C/C++ MSF 7.00\r\n\032DS\0"
 

Macro Definition Documentation

◆ CODEVIEW_NB09_SIG

#define CODEVIEW_NB09_SIG   MAKESIG('N','B','0','9')

Definition at line 3257 of file msc.c.

◆ CODEVIEW_NB10_SIG

#define CODEVIEW_NB10_SIG   MAKESIG('N','B','1','0')

Definition at line 3258 of file msc.c.

◆ CODEVIEW_NB11_SIG

#define CODEVIEW_NB11_SIG   MAKESIG('N','B','1','1')

Definition at line 3259 of file msc.c.

◆ CODEVIEW_RSDS_SIG

#define CODEVIEW_RSDS_SIG   MAKESIG('R','S','D','S')

Definition at line 3260 of file msc.c.

◆ CV_MAX_MODULES [1/2]

#define CV_MAX_MODULES   32

Definition at line 136 of file msc.c.

◆ CV_MAX_MODULES [2/2]

#define CV_MAX_MODULES   32

Definition at line 136 of file msc.c.

◆ FIRST_DEFINABLE_TYPE

#define FIRST_DEFINABLE_TYPE   0x1000

Definition at line 125 of file msc.c.

◆ MAKESIG

#define MAKESIG (   a,
  b,
  c,
  d 
)    ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))

Definition at line 3256 of file msc.c.

◆ MAX_BUILTIN_TYPES

#define MAX_BUILTIN_TYPES   0x06FF

Definition at line 124 of file msc.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 35 of file msc.c.

◆ PEV_ERROR

#define PEV_ERROR (   pev,
  msg 
)    snprintf((pev)->error, sizeof((pev)->error), "%s", (msg))

Definition at line 2965 of file msc.c.

◆ PEV_ERROR1

#define PEV_ERROR1 (   pev,
  msg,
  pmt 
)    snprintf((pev)->error, sizeof((pev)->error), (msg), (pmt))

Definition at line 2966 of file msc.c.

◆ PEV_MAX_LEN

#define PEV_MAX_LEN   32

Definition at line 2948 of file msc.c.

Function Documentation

◆ codeview_add_func_signature_args()

static void codeview_add_func_signature_args ( struct codeview_type_parse ctp,
struct symt_function_signature sym,
unsigned  ret_type,
unsigned  args_list 
)
static

Definition at line 1074 of file msc.c.

1078 {
1079  const union codeview_reftype* reftype;
1080 
1081  sym->rettype = codeview_fetch_type(ctp, ret_type, FALSE);
1082  if (args_list && (reftype = codeview_jump_to_type(ctp, args_list)))
1083  {
1084  unsigned int i;
1085  switch (reftype->generic.id)
1086  {
1087  case LF_ARGLIST_V1:
1088  for (i = 0; i < reftype->arglist_v1.num; i++)
1090  codeview_fetch_type(ctp, reftype->arglist_v1.args[i], FALSE));
1091  break;
1092  case LF_ARGLIST_V2:
1093  for (i = 0; i < reftype->arglist_v2.num; i++)
1095  codeview_fetch_type(ctp, reftype->arglist_v2.args[i], FALSE));
1096  break;
1097  default:
1098  FIXME("Unexpected leaf %x for signature's pmt\n", reftype->generic.id);
1099  }
1100  }
1101 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
#define FIXME(fmt,...)
Definition: debug.h:111
BOOL symt_add_function_signature_parameter(struct module *module, struct symt_function_signature *sig, struct symt *param) DECLSPEC_HIDDEN
Definition: type.c:394
struct codeview_reftype::@3549 generic
#define LF_ARGLIST_V2
Definition: mscvpdb.h:1157
struct codeview_reftype::@3553 arglist_v1
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
struct module * module
Definition: msc.c:549
struct codeview_reftype::@3554 arglist_v2
#define LF_ARGLIST_V1
Definition: mscvpdb.h:1143

Referenced by codeview_parse_one_type().

◆ codeview_add_type()

static int codeview_add_type ( unsigned int  typeno,
struct symt dt 
)
static

Definition at line 562 of file msc.c.

563 {
564  if (typeno < FIRST_DEFINABLE_TYPE)
565  FIXME("What the heck\n");
566  if (!cv_current_module)
567  {
568  FIXME("Adding %x to non allowed module\n", typeno);
569  return FALSE;
570  }
571  if ((typeno >> 24) != 0)
572  FIXME("No module index while inserting type-id assumption is wrong %x\n",
573  typeno);
574  if (typeno - FIRST_DEFINABLE_TYPE >= cv_current_module->num_defined_types)
575  {
576  if (cv_current_module->defined_types)
577  {
578  cv_current_module->num_defined_types = max( cv_current_module->num_defined_types * 2,
579  typeno - FIRST_DEFINABLE_TYPE + 1 );
580  cv_current_module->defined_types = HeapReAlloc(GetProcessHeap(),
581  HEAP_ZERO_MEMORY, cv_current_module->defined_types,
582  cv_current_module->num_defined_types * sizeof(struct symt*));
583  }
584  else
585  {
586  cv_current_module->num_defined_types = max( 256, typeno - FIRST_DEFINABLE_TYPE + 1 );
587  cv_current_module->defined_types = HeapAlloc(GetProcessHeap(),
589  cv_current_module->num_defined_types * sizeof(struct symt*));
590  }
591  if (cv_current_module->defined_types == NULL) return FALSE;
592  }
593  if (cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE])
594  {
595  if (cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE] != dt)
596  FIXME("Overwriting at %x\n", typeno);
597  }
598  cv_current_module->defined_types[typeno - FIRST_DEFINABLE_TYPE] = dt;
599  return TRUE;
600 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HeapReAlloc
Definition: compat.h:482
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static struct cv_defined_module * cv_current_module
Definition: msc.c:138
#define FIRST_DEFINABLE_TYPE
Definition: msc.c:125

Referenced by codeview_parse_one_type().

◆ codeview_add_type_array()

static struct symt* codeview_add_type_array ( struct codeview_type_parse ctp,
const char name,
unsigned int  elemtype,
unsigned int  indextype,
unsigned int  arr_len 
)
static

Definition at line 666 of file msc.c.

671 {
672  struct symt* elem = codeview_fetch_type(ctp, elemtype, FALSE);
673  struct symt* index = codeview_fetch_type(ctp, indextype, FALSE);
674 
675  return &symt_new_array(ctp->module, 0, -arr_len, elem, index)->symt;
676 }
#define FALSE
Definition: types.h:117
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
static size_t elem
Definition: string.c:68
GLuint index
Definition: glext.h:6031
struct symt_array * symt_new_array(struct module *module, int min, int max, struct symt *base, struct symt *index) DECLSPEC_HIDDEN
Definition: type.c:345
struct module * module
Definition: msc.c:549

Referenced by codeview_parse_one_type().

◆ codeview_add_type_enum()

static struct symt* codeview_add_type_enum ( struct codeview_type_parse ctp,
struct symt existing,
const char name,
unsigned  fieldlistno,
unsigned  basetype 
)
static

Definition at line 983 of file msc.c.

988 {
989  struct symt_enum* symt;
990 
991  if (existing)
992  {
993  if (!(symt = codeview_cast_symt(existing, SymTagEnum))) return NULL;
994  /* should also check that all fields are the same */
995  }
996  else
997  {
998  symt = symt_new_enum(ctp->module, name,
999  codeview_fetch_type(ctp, basetype, FALSE));
1000  if (fieldlistno)
1001  {
1002  const union codeview_reftype* fieldlist;
1003  fieldlist = codeview_jump_to_type(ctp, fieldlistno);
1005  }
1006  }
1007  return &symt->symt;
1008 }
#define FALSE
Definition: types.h:117
SymTagEnum
Definition: compat.h:1327
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
static void * codeview_cast_symt(struct symt *symt, enum SymTagEnum tag)
Definition: msc.c:621
smooth NULL
Definition: ftsmooth.c:416
struct codeview_reftype::@3550 fieldlist
struct symt symt
struct symt_enum * symt_new_enum(struct module *module, const char *typename, struct symt *basetype) DECLSPEC_HIDDEN
Definition: type.c:304
static BOOL codeview_add_type_enum_field_list(struct module *module, struct symt_enum *symt, const union codeview_reftype *ref_type)
Definition: msc.c:678
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
struct module * module
Definition: msc.c:549
Definition: name.c:38

Referenced by codeview_parse_one_type().

◆ codeview_add_type_enum_field_list()

static BOOL codeview_add_type_enum_field_list ( struct module module,
struct symt_enum symt,
const union codeview_reftype ref_type 
)
static

Definition at line 678 of file msc.c.

681 {
682  const unsigned char* ptr = ref_type->fieldlist.list;
683  const unsigned char* last = (const BYTE*)ref_type + ref_type->generic.len + 2;
684  const union codeview_fieldtype* type;
685 
686  while (ptr < last)
687  {
688  if (*ptr >= 0xf0) /* LF_PAD... */
689  {
690  ptr += *ptr & 0x0f;
691  continue;
692  }
693 
694  type = (const union codeview_fieldtype*)ptr;
695 
696  switch (type->generic.id)
697  {
698  case LF_ENUMERATE_V1:
699  {
700  int value, vlen = numeric_leaf(&value, &type->enumerate_v1.value);
701  const struct p_string* p_name = (const struct p_string*)((const unsigned char*)&type->enumerate_v1.value + vlen);
702 
704  ptr += 2 + 2 + vlen + (1 + p_name->namelen);
705  break;
706  }
707  case LF_ENUMERATE_V3:
708  {
709  int value, vlen = numeric_leaf(&value, &type->enumerate_v3.value);
710  const char* name = (const char*)&type->enumerate_v3.value + vlen;
711 
713  ptr += 2 + 2 + vlen + (1 + strlen(name));
714  break;
715  }
716 
717  default:
718  FIXME("Unsupported type %04x in ENUM field list\n", type->generic.id);
719  return FALSE;
720  }
721  }
722  return TRUE;
723 }
BOOL symt_add_enum_element(struct module *module, struct symt_enum *enum_type, const char *name, int value) DECLSPEC_HIDDEN
Definition: type.c:319
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
POINT last
Definition: font.c:46
#define TRUE
Definition: types.h:120
#define LF_ENUMERATE_V3
Definition: mscvpdb.h:1201
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
while(1)
Definition: macro.lex.yy.c:740
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
struct codeview_reftype::@3550 fieldlist
struct codeview_reftype::@3549 generic
#define LF_ENUMERATE_V1
Definition: mscvpdb.h:1172
GLsizei const GLfloat * value
Definition: glext.h:6069
unsigned char BYTE
Definition: xxhash.c:193
static int numeric_leaf(int *value, const unsigned short int *leaf)
Definition: msc.c:385
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
Definition: name.c:38
unsigned char namelen
Definition: mscvpdb.h:109

Referenced by codeview_add_type_enum().

◆ codeview_add_type_pointer()

static struct symt* codeview_add_type_pointer ( struct codeview_type_parse ctp,
struct symt existing,
unsigned int  pointee_type 
)
static

Definition at line 651 of file msc.c.

654 {
655  struct symt* pointee;
656 
657  if (existing)
658  {
659  existing = codeview_cast_symt(existing, SymTagPointerType);
660  return existing;
661  }
662  pointee = codeview_fetch_type(ctp, pointee_type, FALSE);
663  return &symt_new_pointer(ctp->module, pointee, sizeof(void *))->symt;
664 }
#define FALSE
Definition: types.h:117
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
static void * codeview_cast_symt(struct symt *symt, enum SymTagEnum tag)
Definition: msc.c:621
struct symt_pointer * symt_new_pointer(struct module *module, struct symt *ref_type, ULONG_PTR size) DECLSPEC_HIDDEN
Definition: type.c:414
struct module * module
Definition: msc.c:549

Referenced by codeview_parse_one_type().

◆ codeview_add_type_struct()

static struct symt* codeview_add_type_struct ( struct codeview_type_parse ctp,
struct symt existing,
const char name,
int  structlen,
enum UdtKind  kind,
unsigned  property 
)
static

Definition at line 1010 of file msc.c.

1014 {
1015  struct symt_udt* symt;
1016 
1017  /* if we don't have an existing type, try to find one with same name
1018  * FIXME: what to do when several types in different CUs have same name ?
1019  */
1020  if (!existing)
1021  {
1022  void* ptr;
1023  struct symt_ht* type;
1024  struct hash_table_iter hti;
1025 
1026  hash_table_iter_init(&ctp->module->ht_types, &hti, name);
1027  while ((ptr = hash_table_iter_up(&hti)))
1028  {
1029  type = CONTAINING_RECORD(ptr, struct symt_ht, hash_elt);
1030 
1031  if (type->symt.tag == SymTagUDT &&
1032  type->hash_elt.name && !strcmp(type->hash_elt.name, name))
1033  {
1034  existing = &type->symt;
1035  break;
1036  }
1037  }
1038  }
1039  if (existing)
1040  {
1041  if (!(symt = codeview_cast_symt(existing, SymTagUDT))) return NULL;
1042  /* should also check that all fields are the same */
1043  if (!(property & 0x80)) /* 0x80 = forward declaration */
1044  {
1045  if (!symt->size) /* likely prior forward declaration, set UDT size */
1046  symt_set_udt_size(ctp->module, symt, structlen);
1047  else /* different UDT with same name, create a new type */
1048  existing = NULL;
1049  }
1050  }
1051  if (!existing) symt = symt_new_udt(ctp->module, name, structlen, kind);
1052 
1053  return &symt->symt;
1054 }
BOOL symt_set_udt_size(struct module *module, struct symt_udt *type, unsigned size) DECLSPEC_HIDDEN
Definition: type.c:242
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct symt symt
static void * codeview_cast_symt(struct symt *symt, enum SymTagEnum tag)
Definition: msc.c:621
static PVOID ptr
Definition: dispmode.c:27
void hash_table_iter_init(const struct hash_table *ht, struct hash_table_iter *hti, const char *name) DECLSPEC_HIDDEN
Definition: storage.c:405
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
void * hash_table_iter_up(struct hash_table_iter *hti) DECLSPEC_HIDDEN
Definition: storage.c:422
struct symt_udt * symt_new_udt(struct module *module, const char *typename, unsigned size, enum UdtKind kind) DECLSPEC_HIDDEN
Definition: type.c:219
struct module * module
Definition: msc.c:549
Definition: name.c:38
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by codeview_parse_one_type().

◆ codeview_add_type_struct_field_list()

static int codeview_add_type_struct_field_list ( struct codeview_type_parse ctp,
struct symt_udt symt,
unsigned  fieldlistno 
)
static

Definition at line 761 of file msc.c.

764 {
765  const unsigned char* ptr;
766  const unsigned char* last;
767  int value, leaf_len;
768  const struct p_string* p_name;
769  const char* c_name;
770  const union codeview_reftype*type_ref;
771  const union codeview_fieldtype* type;
772 
773  if (!fieldlistno) return TRUE;
774  type_ref = codeview_jump_to_type(ctp, fieldlistno);
775  ptr = type_ref->fieldlist.list;
776  last = (const BYTE*)type_ref + type_ref->generic.len + 2;
777 
778  while (ptr < last)
779  {
780  if (*ptr >= 0xf0) /* LF_PAD... */
781  {
782  ptr += *ptr & 0x0f;
783  continue;
784  }
785 
786  type = (const union codeview_fieldtype*)ptr;
787 
788  switch (type->generic.id)
789  {
790  case LF_BCLASS_V1:
791  leaf_len = numeric_leaf(&value, &type->bclass_v1.offset);
792 
793  /* FIXME: ignored for now */
794 
795  ptr += 2 + 2 + 2 + leaf_len;
796  break;
797 
798  case LF_BCLASS_V2:
799  leaf_len = numeric_leaf(&value, &type->bclass_v2.offset);
800 
801  /* FIXME: ignored for now */
802 
803  ptr += 2 + 2 + 4 + leaf_len;
804  break;
805 
806  case LF_VBCLASS_V1:
807  case LF_IVBCLASS_V1:
808  {
809  const unsigned short int* p_vboff;
810  int vpoff, vplen;
811  leaf_len = numeric_leaf(&value, &type->vbclass_v1.vbpoff);
812  p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v1.vbpoff + leaf_len);
813  vplen = numeric_leaf(&vpoff, p_vboff);
814 
815  /* FIXME: ignored for now */
816 
817  ptr += 2 + 2 + 2 + 2 + leaf_len + vplen;
818  }
819  break;
820 
821  case LF_VBCLASS_V2:
822  case LF_IVBCLASS_V2:
823  {
824  const unsigned short int* p_vboff;
825  int vpoff, vplen;
826  leaf_len = numeric_leaf(&value, &type->vbclass_v2.vbpoff);
827  p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v2.vbpoff + leaf_len);
828  vplen = numeric_leaf(&vpoff, p_vboff);
829 
830  /* FIXME: ignored for now */
831 
832  ptr += 2 + 2 + 4 + 4 + leaf_len + vplen;
833  }
834  break;
835 
836  case LF_MEMBER_V1:
837  leaf_len = numeric_leaf(&value, &type->member_v1.offset);
838  p_name = (const struct p_string*)((const char*)&type->member_v1.offset + leaf_len);
839 
841  type->member_v1.type);
842 
843  ptr += 2 + 2 + 2 + leaf_len + (1 + p_name->namelen);
844  break;
845 
846  case LF_MEMBER_V2:
847  leaf_len = numeric_leaf(&value, &type->member_v2.offset);
848  p_name = (const struct p_string*)((const unsigned char*)&type->member_v2.offset + leaf_len);
849 
851  type->member_v2.type);
852 
853  ptr += 2 + 2 + 4 + leaf_len + (1 + p_name->namelen);
854  break;
855 
856  case LF_MEMBER_V3:
857  leaf_len = numeric_leaf(&value, &type->member_v3.offset);
858  c_name = (const char*)&type->member_v3.offset + leaf_len;
859 
860  codeview_add_udt_element(ctp, symt, c_name, value, type->member_v3.type);
861 
862  ptr += 2 + 2 + 4 + leaf_len + (strlen(c_name) + 1);
863  break;
864 
865  case LF_STMEMBER_V1:
866  /* FIXME: ignored for now */
867  ptr += 2 + 2 + 2 + (1 + type->stmember_v1.p_name.namelen);
868  break;
869 
870  case LF_STMEMBER_V2:
871  /* FIXME: ignored for now */
872  ptr += 2 + 4 + 2 + (1 + type->stmember_v2.p_name.namelen);
873  break;
874 
875  case LF_STMEMBER_V3:
876  /* FIXME: ignored for now */
877  ptr += 2 + 4 + 2 + (strlen(type->stmember_v3.name) + 1);
878  break;
879 
880  case LF_METHOD_V1:
881  /* FIXME: ignored for now */
882  ptr += 2 + 2 + 2 + (1 + type->method_v1.p_name.namelen);
883  break;
884 
885  case LF_METHOD_V2:
886  /* FIXME: ignored for now */
887  ptr += 2 + 2 + 4 + (1 + type->method_v2.p_name.namelen);
888  break;
889 
890  case LF_METHOD_V3:
891  /* FIXME: ignored for now */
892  ptr += 2 + 2 + 4 + (strlen(type->method_v3.name) + 1);
893  break;
894 
895  case LF_NESTTYPE_V1:
896  /* FIXME: ignored for now */
897  ptr += 2 + 2 + (1 + type->nesttype_v1.p_name.namelen);
898  break;
899 
900  case LF_NESTTYPE_V2:
901  /* FIXME: ignored for now */
902  ptr += 2 + 2 + 4 + (1 + type->nesttype_v2.p_name.namelen);
903  break;
904 
905  case LF_NESTTYPE_V3:
906  /* FIXME: ignored for now */
907  ptr += 2 + 2 + 4 + (strlen(type->nesttype_v3.name) + 1);
908  break;
909 
910  case LF_VFUNCTAB_V1:
911  /* FIXME: ignored for now */
912  ptr += 2 + 2;
913  break;
914 
915  case LF_VFUNCTAB_V2:
916  /* FIXME: ignored for now */
917  ptr += 2 + 2 + 4;
918  break;
919 
920  case LF_ONEMETHOD_V1:
921  /* FIXME: ignored for now */
922  switch ((type->onemethod_v1.attribute >> 2) & 7)
923  {
924  case 4: case 6: /* (pure) introducing virtual method */
925  ptr += 2 + 2 + 2 + 4 + (1 + type->onemethod_virt_v1.p_name.namelen);
926  break;
927 
928  default:
929  ptr += 2 + 2 + 2 + (1 + type->onemethod_v1.p_name.namelen);
930  break;
931  }
932  break;
933 
934  case LF_ONEMETHOD_V2:
935  /* FIXME: ignored for now */
936  switch ((type->onemethod_v2.attribute >> 2) & 7)
937  {
938  case 4: case 6: /* (pure) introducing virtual method */
939  ptr += 2 + 2 + 4 + 4 + (1 + type->onemethod_virt_v2.p_name.namelen);
940  break;
941 
942  default:
943  ptr += 2 + 2 + 4 + (1 + type->onemethod_v2.p_name.namelen);
944  break;
945  }
946  break;
947 
948  case LF_ONEMETHOD_V3:
949  /* FIXME: ignored for now */
950  switch ((type->onemethod_v3.attribute >> 2) & 7)
951  {
952  case 4: case 6: /* (pure) introducing virtual method */
953  ptr += 2 + 2 + 4 + 4 + (strlen(type->onemethod_virt_v3.name) + 1);
954  break;
955 
956  default:
957  ptr += 2 + 2 + 4 + (strlen(type->onemethod_v3.name) + 1);
958  break;
959  }
960  break;
961 
962  case LF_INDEX_V1:
963  if (!codeview_add_type_struct_field_list(ctp, symt, type->index_v1.ref))
964  return FALSE;
965  ptr += 2 + 2;
966  break;
967 
968  case LF_INDEX_V2:
969  if (!codeview_add_type_struct_field_list(ctp, symt, type->index_v2.ref))
970  return FALSE;
971  ptr += 2 + 2 + 4;
972  break;
973 
974  default:
975  FIXME("Unsupported type %04x in STRUCT field list\n", type->generic.id);
976  return FALSE;
977  }
978  }
979 
980  return TRUE;
981 }
#define LF_IVBCLASS_V1
Definition: mscvpdb.h:1171
#define LF_VFUNCTAB_V1
Definition: mscvpdb.h:1179
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
POINT last
Definition: font.c:46
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define LF_VFUNCTAB_V2
Definition: mscvpdb.h:1195
#define LF_MEMBER_V2
Definition: mscvpdb.h:1191
#define LF_BCLASS_V2
Definition: mscvpdb.h:1186
#define LF_ONEMETHOD_V1
Definition: mscvpdb.h:1181
while(1)
Definition: macro.lex.yy.c:740
#define LF_ONEMETHOD_V3
Definition: mscvpdb.h:1211
#define FALSE
Definition: types.h:117
static void codeview_add_udt_element(struct codeview_type_parse *ctp, struct symt_udt *symt, const char *name, int value, unsigned type)
Definition: msc.c:725
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
#define LF_NESTTYPE_V2
Definition: mscvpdb.h:1194
struct codeview_reftype::@3550 fieldlist
#define LF_METHOD_V1
Definition: mscvpdb.h:1177
static int codeview_add_type_struct_field_list(struct codeview_type_parse *ctp, struct symt_udt *symt, unsigned fieldlistno)
Definition: msc.c:761
#define LF_STMEMBER_V3
Definition: mscvpdb.h:1208
#define LF_METHOD_V3
Definition: mscvpdb.h:1209
struct codeview_reftype::@3549 generic
enum value::value_type type
#define LF_NESTTYPE_V3
Definition: mscvpdb.h:1210
GLsizei const GLfloat * value
Definition: glext.h:6069
unsigned char BYTE
Definition: xxhash.c:193
#define LF_MEMBER_V1
Definition: mscvpdb.h:1175
#define LF_MEMBER_V3
Definition: mscvpdb.h:1207
struct p_string p_name
Definition: mscvpdb.h:496
#define LF_STMEMBER_V1
Definition: mscvpdb.h:1176
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
#define LF_STMEMBER_V2
Definition: mscvpdb.h:1192
static int numeric_leaf(int *value, const unsigned short int *leaf)
Definition: msc.c:385
#define LF_INDEX_V2
Definition: mscvpdb.h:1190
#define LF_NESTTYPE_V1
Definition: mscvpdb.h:1178
#define LF_METHOD_V2
Definition: mscvpdb.h:1193
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
#define LF_VBCLASS_V1
Definition: mscvpdb.h:1170
#define LF_INDEX_V1
Definition: mscvpdb.h:1174
#define LF_VBCLASS_V2
Definition: mscvpdb.h:1187
#define LF_ONEMETHOD_V2
Definition: mscvpdb.h:1197
unsigned char namelen
Definition: mscvpdb.h:109
#define LF_IVBCLASS_V2
Definition: mscvpdb.h:1188
#define LF_BCLASS_V1
Definition: mscvpdb.h:1169

Referenced by codeview_parse_one_type().

◆ codeview_add_udt_element()

static void codeview_add_udt_element ( struct codeview_type_parse ctp,
struct symt_udt symt,
const char name,
int  value,
unsigned  type 
)
static

Definition at line 725 of file msc.c.

728 {
729  struct symt* subtype;
730  const union codeview_reftype*cv_type;
731 
732  if ((cv_type = codeview_jump_to_type(ctp, type)))
733  {
734  switch (cv_type->generic.id)
735  {
736  case LF_BITFIELD_V1:
738  codeview_fetch_type(ctp, cv_type->bitfield_v1.type, FALSE),
739  (value << 3) + cv_type->bitfield_v1.bitoff,
740  cv_type->bitfield_v1.nbits);
741  return;
742  case LF_BITFIELD_V2:
744  codeview_fetch_type(ctp, cv_type->bitfield_v2.type, FALSE),
745  (value << 3) + cv_type->bitfield_v2.bitoff,
746  cv_type->bitfield_v2.nbits);
747  return;
748  }
749  }
750  subtype = codeview_fetch_type(ctp, type, FALSE);
751 
752  if (subtype)
753  {
754  DWORD64 elem_size = 0;
755  symt_get_info(ctp->module, subtype, TI_GET_LENGTH, &elem_size);
756  symt_add_udt_element(ctp->module, symt, name, subtype,
757  value << 3, (DWORD)elem_size << 3);
758  }
759 }
struct codeview_reftype::@3552 bitfield_v2
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define FALSE
Definition: types.h:117
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
#define LF_BITFIELD_V1
Definition: mscvpdb.h:1148
BOOL symt_add_udt_element(struct module *module, struct symt_udt *udt_type, const char *name, struct symt *elt_type, unsigned offset, unsigned size) DECLSPEC_HIDDEN
Definition: type.c:264
unsigned long DWORD
Definition: ntddk_ex.h:95
struct codeview_reftype::@3549 generic
BOOL symt_get_info(struct module *module, const struct symt *type, IMAGEHLP_SYMBOL_TYPE_INFO req, void *pInfo) DECLSPEC_HIDDEN
Definition: type.c:536
uint64_t DWORD64
Definition: typedefs.h:67
#define LF_BITFIELD_V2
Definition: mscvpdb.h:1161
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
struct module * module
Definition: msc.c:549
struct codeview_reftype::@3551 bitfield_v1
Definition: name.c:38

Referenced by codeview_add_type_struct_field_list().

◆ codeview_add_variable()

static void codeview_add_variable ( const struct msc_debug_info msc_dbg,
struct symt_compiland compiland,
const char name,
unsigned  segment,
unsigned  offset,
unsigned  symtype,
BOOL  is_local,
BOOL  in_tls,
BOOL  force 
)
inlinestatic

Definition at line 1562 of file msc.c.

1567 {
1568  if (name && *name)
1569  {
1570  struct location loc;
1571 
1572  loc.kind = in_tls ? loc_tlsrel : loc_absolute;
1573  loc.reg = 0;
1574  loc.offset = in_tls ? offset : codeview_get_address(msc_dbg, segment, offset);
1575  if (force || in_tls || !symt_find_nearest(msc_dbg->module, loc.offset))
1576  {
1577  symt_new_global_variable(msc_dbg->module, compiland,
1578  name, is_local, loc, 0,
1579  codeview_get_type(symtype, FALSE));
1580  }
1581  }
1582 }
int is_local(const attr_list_t *a)
Definition: header.c:938
GLintptr offset
Definition: glext.h:5920
#define FALSE
Definition: types.h:117
static ULONG_PTR codeview_get_address(const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
Definition: msc.c:1551
unsigned kind
static struct symt * codeview_get_type(unsigned int typeno, BOOL quiet)
Definition: msc.c:513
struct module * module
Definition: mscvpdb.h:2134
Definition: name.c:38
struct symt_data * symt_new_global_variable(struct module *module, struct symt_compiland *parent, const char *name, unsigned is_static, struct location loc, ULONG_PTR size, struct symt *type) DECLSPEC_HIDDEN
Definition: symbol.c:256
struct symt_ht * symt_find_nearest(struct module *module, DWORD_PTR addr) DECLSPEC_HIDDEN
Definition: symbol.c:903

Referenced by codeview_snarf(), and codeview_snarf_public().

◆ codeview_cast_symt()

static void* codeview_cast_symt ( struct symt symt,
enum SymTagEnum  tag 
)
static

Definition at line 621 of file msc.c.

622 {
623  if (symt->tag != tag)
624  {
625  FIXME("Bad tag. Expected %d, but got %d\n", tag, symt->tag);
626  return NULL;
627  }
628  return symt;
629 }
Definition: ecma_167.h:138
enum SymTagEnum tag
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416

Referenced by codeview_add_type_enum(), codeview_add_type_pointer(), codeview_add_type_struct(), codeview_new_func_signature(), and codeview_parse_one_type().

◆ codeview_clear_type_table()

static void codeview_clear_type_table ( void  )
static

Definition at line 602 of file msc.c.

603 {
604  int i;
605 
606  for (i = 0; i < CV_MAX_MODULES; i++)
607  {
608  if (cv_zmodules[i].allowed)
609  HeapFree(GetProcessHeap(), 0, cv_zmodules[i].defined_types);
610  cv_zmodules[i].allowed = FALSE;
611  cv_zmodules[i].defined_types = NULL;
612  cv_zmodules[i].num_defined_types = 0;
613  }
615 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
static struct cv_defined_module cv_zmodules[CV_MAX_MODULES]
Definition: msc.c:137
#define GetProcessHeap()
Definition: compat.h:484
#define CV_MAX_MODULES
Definition: msc.c:136
static struct cv_defined_module * cv_current_module
Definition: msc.c:138
#define HeapFree(x, y, z)
Definition: compat.h:483

Referenced by codeview_process_info(), and pdb_process_file().

◆ codeview_fetch_type()

static struct symt* codeview_fetch_type ( struct codeview_type_parse ctp,
unsigned  typeno,
BOOL  details 
)
static

Definition at line 631 of file msc.c.

633 {
634  struct symt* symt;
635  const union codeview_type* p;
636 
637  if (!typeno) return NULL;
638  if ((symt = codeview_get_type(typeno, TRUE))) return symt;
639 
640  /* forward declaration */
641  if (!(p = codeview_jump_to_type(ctp, typeno)))
642  {
643  FIXME("Cannot locate type %x\n", typeno);
644  return NULL;
645  }
646  symt = codeview_parse_one_type(ctp, typeno, p, details);
647  if (!symt) FIXME("Couldn't load forward type %x\n", typeno);
648  return symt;
649 }
#define TRUE
Definition: types.h:120
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
static struct symt * codeview_parse_one_type(struct codeview_type_parse *ctp, unsigned curr_type, const union codeview_type *type, BOOL details)
Definition: msc.c:1103
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
static struct symt * codeview_get_type(unsigned int typeno, BOOL quiet)
Definition: msc.c:513
int details
Definition: msacm.c:1365
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by codeview_add_func_signature_args(), codeview_add_type_array(), codeview_add_type_enum(), codeview_add_type_pointer(), codeview_add_udt_element(), and codeview_parse_one_type().

◆ codeview_get_address()

static ULONG_PTR codeview_get_address ( const struct msc_debug_info msc_dbg,
unsigned  seg,
unsigned  offset 
)
static

Definition at line 1551 of file msc.c.

1553 {
1554  int nsect = msc_dbg->nsect;
1555  const IMAGE_SECTION_HEADER* sectp = msc_dbg->sectp;
1556 
1557  if (!seg || seg > nsect) return 0;
1558  return msc_dbg->module->module.BaseOfImage +
1559  codeview_map_offset(msc_dbg, sectp[seg-1].VirtualAddress + offset);
1560 }
GLintptr offset
Definition: glext.h:5920
static unsigned int codeview_map_offset(const struct msc_debug_info *msc_dbg, unsigned int offset)
Definition: msc.c:1534
_In_ ULONG _In_ BOOLEAN _Must_inspect_result_ PVOID * VirtualAddress
Definition: ndis.h:3791
seg
Definition: i386-dis.c:3857
struct module * module
Definition: mscvpdb.h:2134
const IMAGE_SECTION_HEADER * sectp
Definition: mscvpdb.h:2136

Referenced by codeview_add_variable(), codeview_snarf(), codeview_snarf_linetab(), codeview_snarf_linetab2(), and codeview_snarf_public().

◆ codeview_get_type()

static struct symt* codeview_get_type ( unsigned int  typeno,
BOOL  quiet 
)
static

Definition at line 513 of file msc.c.

514 {
515  struct symt* symt = NULL;
516 
517  /*
518  * Convert Codeview type numbers into something we can grok internally.
519  * Numbers < FIRST_DEFINABLE_TYPE are all fixed builtin types.
520  * Numbers from FIRST_DEFINABLE_TYPE and up are all user defined (structs, etc).
521  */
522  if (typeno < FIRST_DEFINABLE_TYPE)
523  {
524  if (typeno < MAX_BUILTIN_TYPES)
525  symt = cv_basic_types[typeno];
526  }
527  else
528  {
529  unsigned mod_index = typeno >> 24;
530  unsigned mod_typeno = typeno & 0x00FFFFFF;
531  struct cv_defined_module* mod;
532 
533  mod = (mod_index == 0) ? cv_current_module : &cv_zmodules[mod_index];
534 
535  if (mod_index >= CV_MAX_MODULES || !mod->allowed)
536  FIXME("Module of index %d isn't loaded yet (%x)\n", mod_index, typeno);
537  else
538  {
539  if (mod_typeno - FIRST_DEFINABLE_TYPE < mod->num_defined_types)
540  symt = mod->defined_types[mod_typeno - FIRST_DEFINABLE_TYPE];
541  }
542  }
543  if (!quiet && !symt && typeno) FIXME("Returning NULL symt for type-id %x\n", typeno);
544  return symt;
545 }
static struct symt * cv_basic_types[MAX_BUILTIN_TYPES]
Definition: msc.c:127
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
static struct cv_defined_module cv_zmodules[CV_MAX_MODULES]
Definition: msc.c:137
#define CV_MAX_MODULES
Definition: msc.c:136
#define MAX_BUILTIN_TYPES
Definition: msc.c:124
static struct cv_defined_module * cv_current_module
Definition: msc.c:138
unsigned int num_defined_types
Definition: msc.c:132
#define FIRST_DEFINABLE_TYPE
Definition: msc.c:125
static int mod
Definition: i386-dis.c:1273

Referenced by codeview_add_variable(), codeview_fetch_type(), codeview_parse_one_type(), and codeview_snarf().

◆ codeview_init_basic_types()

static void codeview_init_basic_types ( struct module module)
static

Definition at line 140 of file msc.c.

141 {
142  /*
143  * These are the common builtin types that are used by VC++.
144  */
147  cv_basic_types[T_VOID] = &symt_new_basic(module, btVoid, "void", 0)->symt;
148  cv_basic_types[T_CHAR] = &symt_new_basic(module, btChar, "char", 1)->symt;
149  cv_basic_types[T_SHORT] = &symt_new_basic(module, btInt, "short int", 2)->symt;
150  cv_basic_types[T_LONG] = &symt_new_basic(module, btInt, "long int", 4)->symt;
151  cv_basic_types[T_QUAD] = &symt_new_basic(module, btInt, "long long int", 8)->symt;
152  cv_basic_types[T_UCHAR] = &symt_new_basic(module, btUInt, "unsigned char", 1)->symt;
153  cv_basic_types[T_USHORT] = &symt_new_basic(module, btUInt, "unsigned short", 2)->symt;
154  cv_basic_types[T_ULONG] = &symt_new_basic(module, btUInt, "unsigned long", 4)->symt;
155  cv_basic_types[T_UQUAD] = &symt_new_basic(module, btUInt, "unsigned long long", 8)->symt;
156  cv_basic_types[T_BOOL08] = &symt_new_basic(module, btBool, "BOOL08", 1)->symt;
157  cv_basic_types[T_BOOL16] = &symt_new_basic(module, btBool, "BOOL16", 2)->symt;
158  cv_basic_types[T_BOOL32] = &symt_new_basic(module, btBool, "BOOL32", 4)->symt;
159  cv_basic_types[T_BOOL64] = &symt_new_basic(module, btBool, "BOOL64", 8)->symt;
160  cv_basic_types[T_REAL32] = &symt_new_basic(module, btFloat, "float", 4)->symt;
161  cv_basic_types[T_REAL64] = &symt_new_basic(module, btFloat, "double", 8)->symt;
162  cv_basic_types[T_REAL80] = &symt_new_basic(module, btFloat, "long double", 10)->symt;
163  cv_basic_types[T_RCHAR] = &symt_new_basic(module, btInt, "signed char", 1)->symt;
164  cv_basic_types[T_WCHAR] = &symt_new_basic(module, btWChar, "wchar_t", 2)->symt;
165  cv_basic_types[T_CHAR16] = &symt_new_basic(module, btChar16,"char16_t", 2)->symt;
166  cv_basic_types[T_CHAR32] = &symt_new_basic(module, btChar32,"char32_t", 4)->symt;
167  cv_basic_types[T_INT2] = &symt_new_basic(module, btInt, "INT2", 2)->symt;
168  cv_basic_types[T_UINT2] = &symt_new_basic(module, btUInt, "UINT2", 2)->symt;
169  cv_basic_types[T_INT4] = &symt_new_basic(module, btInt, "INT4", 4)->symt;
170  cv_basic_types[T_UINT4] = &symt_new_basic(module, btUInt, "UINT4", 4)->symt;
171  cv_basic_types[T_INT8] = &symt_new_basic(module, btInt, "INT8", 8)->symt;
172  cv_basic_types[T_UINT8] = &symt_new_basic(module, btUInt, "UINT8", 8)->symt;
173  cv_basic_types[T_HRESULT]= &symt_new_basic(module, btUInt, "HRESULT", 4)->symt;
174 
202 
230 
257 }
#define T_REAL80
Definition: mscvpdb.h:859
#define T_WCHAR
Definition: mscvpdb.h:869
#define T_PINT4
Definition: mscvpdb.h:906
#define T_UCHAR
Definition: mscvpdb.h:849
#define T_PCHAR32
Definition: mscvpdb.h:911
#define T_32PUINT4
Definition: mscvpdb.h:1010
#define T_PREAL32
Definition: mscvpdb.h:893
#define T_UQUAD
Definition: mscvpdb.h:852
#define T_64PSHORT
Definition: mscvpdb.h:1055
#define T_BOOL32
Definition: mscvpdb.h:855
#define T_PBOOL64
Definition: mscvpdb.h:892
#define T_PVOID
Definition: mscvpdb.h:880
#define T_64PVOID
Definition: mscvpdb.h:1052
#define T_PUSHORT
Definition: mscvpdb.h:886
#define T_32PLONG
Definition: mscvpdb.h:986
#define T_64PREAL32
Definition: mscvpdb.h:1066
#define T_32PBOOL16
Definition: mscvpdb.h:993
static struct symt * cv_basic_types[MAX_BUILTIN_TYPES]
Definition: msc.c:127
#define T_32PINT4
Definition: mscvpdb.h:1009
#define T_PUINT4
Definition: mscvpdb.h:907
#define T_UINT2
Definition: mscvpdb.h:871
#define T_PBOOL32
Definition: mscvpdb.h:891
#define T_CHAR32
Definition: mscvpdb.h:877
#define T_32PREAL80
Definition: mscvpdb.h:998
#define T_32PBOOL32
Definition: mscvpdb.h:994
#define T_64PBOOL16
Definition: mscvpdb.h:1063
#define T_64PBOOL08
Definition: mscvpdb.h:1062
#define T_BOOL16
Definition: mscvpdb.h:854
#define T_PUCHAR
Definition: mscvpdb.h:885
#define T_BOOL08
Definition: mscvpdb.h:853
#define T_PUINT8
Definition: mscvpdb.h:909
#define T_32PUINT8
Definition: mscvpdb.h:1012
#define T_LONG
Definition: mscvpdb.h:847
#define T_SHORT
Definition: mscvpdb.h:846
#define T_PINT8
Definition: mscvpdb.h:908
#define T_32PREAL64
Definition: mscvpdb.h:997
#define T_UINT4
Definition: mscvpdb.h:873
#define T_INT8
Definition: mscvpdb.h:874
#define T_64PINT4
Definition: mscvpdb.h:1079
#define T_64PUINT4
Definition: mscvpdb.h:1080
#define T_INT4
Definition: mscvpdb.h:872
#define T_32PUCHAR
Definition: mscvpdb.h:988
#define T_32PSHORT
Definition: mscvpdb.h:985
#define T_32PREAL32
Definition: mscvpdb.h:996
#define T_32PRCHAR
Definition: mscvpdb.h:1005
#define T_64PCHAR
Definition: mscvpdb.h:1054
#define T_32PCHAR
Definition: mscvpdb.h:984
#define T_USHORT
Definition: mscvpdb.h:850
#define T_64PWCHAR
Definition: mscvpdb.h:1076
smooth NULL
Definition: ftsmooth.c:416
#define T_32PBOOL64
Definition: mscvpdb.h:995
#define T_PCHAR16
Definition: mscvpdb.h:910
#define T_PQUAD
Definition: mscvpdb.h:884
#define T_PLONG
Definition: mscvpdb.h:883
#define T_REAL32
Definition: mscvpdb.h:857
struct symt_basic * symt_new_basic(struct module *module, enum BasicType, const char *typename, unsigned size) DECLSPEC_HIDDEN
Definition: type.c:192
#define T_64PUCHAR
Definition: mscvpdb.h:1058
struct symt_pointer * symt_new_pointer(struct module *module, struct symt *ref_type, ULONG_PTR size) DECLSPEC_HIDDEN
Definition: type.c:414
#define T_64PCHAR16
Definition: mscvpdb.h:1083
#define T_32PBOOL08
Definition: mscvpdb.h:992
#define T_PBOOL16
Definition: mscvpdb.h:890
#define T_32PUINT2
Definition: mscvpdb.h:1008
#define T_32PCHAR32
Definition: mscvpdb.h:1014
#define T_32PUSHORT
Definition: mscvpdb.h:989
#define T_64PUQUAD
Definition: mscvpdb.h:1061
#define T_INT2
Definition: mscvpdb.h:870
#define T_64PBOOL64
Definition: mscvpdb.h:1065
#define T_PULONG
Definition: mscvpdb.h:887
#define T_PREAL80
Definition: mscvpdb.h:895
#define T_BOOL64
Definition: mscvpdb.h:856
#define T_PRCHAR
Definition: mscvpdb.h:902
#define T_REAL64
Definition: mscvpdb.h:858
#define T_PINT2
Definition: mscvpdb.h:904
#define T_32PQUAD
Definition: mscvpdb.h:987
#define T_32PWCHAR
Definition: mscvpdb.h:1006
#define T_PUINT2
Definition: mscvpdb.h:905
#define T_32PCHAR16
Definition: mscvpdb.h:1013
#define T_ABS
Definition: mscvpdb.h:837
#define T_32PULONG
Definition: mscvpdb.h:990
#define T_64PINT2
Definition: mscvpdb.h:1077
#define T_PUQUAD
Definition: mscvpdb.h:888
#define T_64PUINT8
Definition: mscvpdb.h:1082
#define T_NOTYPE
Definition: mscvpdb.h:836
#define T_64PQUAD
Definition: mscvpdb.h:1057
#define T_32PUQUAD
Definition: mscvpdb.h:991
#define T_PWCHAR
Definition: mscvpdb.h:903
#define T_UINT8
Definition: mscvpdb.h:875
#define T_64PREAL64
Definition: mscvpdb.h:1067
#define T_64PHRESULT
Definition: mscvpdb.h:1053
#define T_PBOOL08
Definition: mscvpdb.h:889
#define T_64PUINT2
Definition: mscvpdb.h:1078
#define T_PCHAR
Definition: mscvpdb.h:881
#define T_32PVOID
Definition: mscvpdb.h:982
#define T_64PINT8
Definition: mscvpdb.h:1081
#define T_CHAR
Definition: mscvpdb.h:845
#define T_32PINT8
Definition: mscvpdb.h:1011
Definition: compat.h:1369
#define T_ULONG
Definition: mscvpdb.h:851
#define T_PREAL64
Definition: mscvpdb.h:894
#define T_RCHAR
Definition: mscvpdb.h:868
#define T_64PCHAR32
Definition: mscvpdb.h:1084
#define T_64PLONG
Definition: mscvpdb.h:1056
#define T_32PINT2
Definition: mscvpdb.h:1007
#define T_64PBOOL32
Definition: mscvpdb.h:1064
#define T_64PREAL80
Definition: mscvpdb.h:1068
#define T_CHAR16
Definition: mscvpdb.h:876
#define T_VOID
Definition: mscvpdb.h:839
#define T_32PHRESULT
Definition: mscvpdb.h:983
#define T_64PUSHORT
Definition: mscvpdb.h:1059
#define T_HRESULT
Definition: mscvpdb.h:844
#define T_64PRCHAR
Definition: mscvpdb.h:1075
#define T_64PULONG
Definition: mscvpdb.h:1060
#define T_QUAD
Definition: mscvpdb.h:848
#define T_PSHORT
Definition: mscvpdb.h:882

Referenced by codeview_process_info(), and pdb_process_file().

◆ codeview_jump_to_type()

static const void* codeview_jump_to_type ( const struct codeview_type_parse ctp,
DWORD  idx 
)
inlinestatic

Definition at line 555 of file msc.c.

556 {
557  if (idx < FIRST_DEFINABLE_TYPE) return NULL;
559  return (idx >= ctp->num) ? NULL : (ctp->table + ctp->offset[idx]);
560 }
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
const DWORD * offset
Definition: msc.c:551
const BYTE * table
Definition: msc.c:550
#define FIRST_DEFINABLE_TYPE
Definition: msc.c:125

Referenced by codeview_add_func_signature_args(), codeview_add_type_enum(), codeview_add_type_struct_field_list(), codeview_add_udt_element(), codeview_fetch_type(), and codeview_parse_type_table().

◆ codeview_map_offset()

static unsigned int codeview_map_offset ( const struct msc_debug_info msc_dbg,
unsigned int  offset 
)
static

Definition at line 1534 of file msc.c.

1536 {
1537  int nomap = msc_dbg->nomap;
1538  const OMAP_DATA* omapp = msc_dbg->omapp;
1539  int i;
1540 
1541  if (!nomap || !omapp) return offset;
1542 
1543  /* FIXME: use binary search */
1544  for (i = 0; i < nomap - 1; i++)
1545  if (omapp[i].from <= offset && omapp[i+1].from > offset)
1546  return !omapp[i].to ? 0 : omapp[i].to + (offset - omapp[i].from);
1547 
1548  return 0;
1549 }
GLintptr offset
Definition: glext.h:5920
DWORD to
Definition: mscvpdb.h:2129
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
DWORD from
Definition: mscvpdb.h:2128
CardRegion * from
Definition: spigame.cpp:19
const OMAP_DATA * omapp
Definition: mscvpdb.h:2138

Referenced by codeview_get_address().

◆ codeview_new_func_signature()

static struct symt* codeview_new_func_signature ( struct codeview_type_parse ctp,
struct symt existing,
enum CV_call_e  call_conv 
)
static

Definition at line 1056 of file msc.c.

1059 {
1060  struct symt_function_signature* sym;
1061 
1062  if (existing)
1063  {
1064  sym = codeview_cast_symt(existing, SymTagFunctionType);
1065  if (!sym) return NULL;
1066  }
1067  else
1068  {
1070  }
1071  return &sym->symt;
1072 }
static void * codeview_cast_symt(struct symt *symt, enum SymTagEnum tag)
Definition: msc.c:621
smooth NULL
Definition: ftsmooth.c:416
struct symt_function_signature * symt_new_function_signature(struct module *module, struct symt *ret_type, enum CV_call_e call_conv) DECLSPEC_HIDDEN
Definition: type.c:377
struct module * module
Definition: msc.c:549

Referenced by codeview_parse_one_type().

◆ codeview_parse_one_type()

static struct symt * codeview_parse_one_type ( struct codeview_type_parse ctp,
unsigned  curr_type,
const union codeview_type type,
BOOL  details 
)
static

Definition at line 1103 of file msc.c.

1106 {
1107  struct symt* symt;
1108  int value, leaf_len;
1109  const struct p_string* p_name;
1110  const char* c_name;
1111  struct symt* existing;
1112 
1113  existing = codeview_get_type(curr_type, TRUE);
1114 
1115  switch (type->generic.id)
1116  {
1117  case LF_MODIFIER_V1:
1118  /* FIXME: we don't handle modifiers,
1119  * but read previous type on the curr_type
1120  */
1121  WARN("Modifier on %x: %s%s%s%s\n",
1122  type->modifier_v1.type,
1123  type->modifier_v1.attribute & 0x01 ? "const " : "",
1124  type->modifier_v1.attribute & 0x02 ? "volatile " : "",
1125  type->modifier_v1.attribute & 0x04 ? "unaligned " : "",
1126  type->modifier_v1.attribute & ~0x07 ? "unknown " : "");
1127  symt = codeview_fetch_type(ctp, type->modifier_v1.type, details);
1128  break;
1129  case LF_MODIFIER_V2:
1130  /* FIXME: we don't handle modifiers, but readd previous type on the curr_type */
1131  WARN("Modifier on %x: %s%s%s%s\n",
1132  type->modifier_v2.type,
1133  type->modifier_v2.attribute & 0x01 ? "const " : "",
1134  type->modifier_v2.attribute & 0x02 ? "volatile " : "",
1135  type->modifier_v2.attribute & 0x04 ? "unaligned " : "",
1136  type->modifier_v2.attribute & ~0x07 ? "unknown " : "");
1137  symt = codeview_fetch_type(ctp, type->modifier_v2.type, details);
1138  break;
1139 
1140  case LF_POINTER_V1:
1141  symt = codeview_add_type_pointer(ctp, existing, type->pointer_v1.datatype);
1142  break;
1143  case LF_POINTER_V2:
1144  symt = codeview_add_type_pointer(ctp, existing, type->pointer_v2.datatype);
1145  break;
1146 
1147  case LF_ARRAY_V1:
1148  if (existing) symt = codeview_cast_symt(existing, SymTagArrayType);
1149  else
1150  {
1151  leaf_len = numeric_leaf(&value, &type->array_v1.arrlen);
1152  p_name = (const struct p_string*)((const unsigned char*)&type->array_v1.arrlen + leaf_len);
1154  type->array_v1.elemtype,
1155  type->array_v1.idxtype, value);
1156  }
1157  break;
1158  case LF_ARRAY_V2:
1159  if (existing) symt = codeview_cast_symt(existing, SymTagArrayType);
1160  else
1161  {
1162  leaf_len = numeric_leaf(&value, &type->array_v2.arrlen);
1163  p_name = (const struct p_string*)((const unsigned char*)&type->array_v2.arrlen + leaf_len);
1164 
1166  type->array_v2.elemtype,
1167  type->array_v2.idxtype, value);
1168  }
1169  break;
1170  case LF_ARRAY_V3:
1171  if (existing) symt = codeview_cast_symt(existing, SymTagArrayType);
1172  else
1173  {
1174  leaf_len = numeric_leaf(&value, &type->array_v3.arrlen);
1175  c_name = (const char*)&type->array_v3.arrlen + leaf_len;
1176 
1177  symt = codeview_add_type_array(ctp, c_name,
1178  type->array_v3.elemtype,
1179  type->array_v3.idxtype, value);
1180  }
1181  break;
1182 
1183  case LF_STRUCTURE_V1:
1184  case LF_CLASS_V1:
1185  leaf_len = numeric_leaf(&value, &type->struct_v1.structlen);
1186  p_name = (const struct p_string*)((const unsigned char*)&type->struct_v1.structlen + leaf_len);
1187  symt = codeview_add_type_struct(ctp, existing, terminate_string(p_name), value,
1188  type->generic.id == LF_CLASS_V1 ? UdtClass : UdtStruct,
1189  type->struct_v1.property);
1190  if (details)
1191  {
1192  codeview_add_type(curr_type, symt);
1193  if (!(type->struct_v1.property & 0x80)) /* 0x80 = forward declaration */
1195  type->struct_v1.fieldlist);
1196  }
1197  break;
1198 
1199  case LF_STRUCTURE_V2:
1200  case LF_CLASS_V2:
1201  leaf_len = numeric_leaf(&value, &type->struct_v2.structlen);
1202  p_name = (const struct p_string*)((const unsigned char*)&type->struct_v2.structlen + leaf_len);
1203  symt = codeview_add_type_struct(ctp, existing, terminate_string(p_name), value,
1204  type->generic.id == LF_CLASS_V2 ? UdtClass : UdtStruct,
1205  type->struct_v2.property);
1206  if (details)
1207  {
1208  codeview_add_type(curr_type, symt);
1209  if (!(type->struct_v2.property & 0x80)) /* 0x80 = forward declaration */
1211  type->struct_v2.fieldlist);
1212  }
1213  break;
1214 
1215  case LF_STRUCTURE_V3:
1216  case LF_CLASS_V3:
1217  leaf_len = numeric_leaf(&value, &type->struct_v3.structlen);
1218  c_name = (const char*)&type->struct_v3.structlen + leaf_len;
1219  symt = codeview_add_type_struct(ctp, existing, c_name, value,
1220  type->generic.id == LF_CLASS_V3 ? UdtClass : UdtStruct,
1221  type->struct_v3.property);
1222  if (details)
1223  {
1224  codeview_add_type(curr_type, symt);
1225  if (!(type->struct_v3.property & 0x80)) /* 0x80 = forward declaration */
1227  type->struct_v3.fieldlist);
1228  }
1229  break;
1230 
1231  case LF_UNION_V1:
1232  leaf_len = numeric_leaf(&value, &type->union_v1.un_len);
1233  p_name = (const struct p_string*)((const unsigned char*)&type->union_v1.un_len + leaf_len);
1234  symt = codeview_add_type_struct(ctp, existing, terminate_string(p_name),
1235  value, UdtUnion, type->union_v1.property);
1236  if (details)
1237  {
1238  codeview_add_type(curr_type, symt);
1240  type->union_v1.fieldlist);
1241  }
1242  break;
1243 
1244  case LF_UNION_V2:
1245  leaf_len = numeric_leaf(&value, &type->union_v2.un_len);
1246  p_name = (const struct p_string*)((const unsigned char*)&type->union_v2.un_len + leaf_len);
1247  symt = codeview_add_type_struct(ctp, existing, terminate_string(p_name),
1248  value, UdtUnion, type->union_v2.property);
1249  if (details)
1250  {
1251  codeview_add_type(curr_type, symt);
1253  type->union_v2.fieldlist);
1254  }
1255  break;
1256 
1257  case LF_UNION_V3:
1258  leaf_len = numeric_leaf(&value, &type->union_v3.un_len);
1259  c_name = (const char*)&type->union_v3.un_len + leaf_len;
1260  symt = codeview_add_type_struct(ctp, existing, c_name,
1261  value, UdtUnion, type->union_v3.property);
1262  if (details)
1263  {
1264  codeview_add_type(curr_type, symt);
1266  type->union_v3.fieldlist);
1267  }
1268  break;
1269 
1270  case LF_ENUM_V1:
1271  symt = codeview_add_type_enum(ctp, existing,
1272  terminate_string(&type->enumeration_v1.p_name),
1273  type->enumeration_v1.fieldlist,
1274  type->enumeration_v1.type);
1275  break;
1276 
1277  case LF_ENUM_V2:
1278  symt = codeview_add_type_enum(ctp, existing,
1279  terminate_string(&type->enumeration_v2.p_name),
1280  type->enumeration_v2.fieldlist,
1281  type->enumeration_v2.type);
1282  break;
1283 
1284  case LF_ENUM_V3:
1285  symt = codeview_add_type_enum(ctp, existing, type->enumeration_v3.name,
1286  type->enumeration_v3.fieldlist,
1287  type->enumeration_v3.type);
1288  break;
1289 
1290  case LF_PROCEDURE_V1:
1291  symt = codeview_new_func_signature(ctp, existing, type->procedure_v1.call);
1292  if (details)
1293  {
1294  codeview_add_type(curr_type, symt);
1296  (struct symt_function_signature*)symt,
1297  type->procedure_v1.rvtype,
1298  type->procedure_v1.arglist);
1299  }
1300  break;
1301  case LF_PROCEDURE_V2:
1302  symt = codeview_new_func_signature(ctp, existing,type->procedure_v2.call);
1303  if (details)
1304  {
1305  codeview_add_type(curr_type, symt);
1307  (struct symt_function_signature*)symt,
1308  type->procedure_v2.rvtype,
1309  type->procedure_v2.arglist);
1310  }
1311  break;
1312 
1313  case LF_MFUNCTION_V1:
1314  /* FIXME: for C++, this is plain wrong, but as we don't use arg types
1315  * nor class information, this would just do for now
1316  */
1317  symt = codeview_new_func_signature(ctp, existing, type->mfunction_v1.call);
1318  if (details)
1319  {
1320  codeview_add_type(curr_type, symt);
1322  (struct symt_function_signature*)symt,
1323  type->mfunction_v1.rvtype,
1324  type->mfunction_v1.arglist);
1325  }
1326  break;
1327  case LF_MFUNCTION_V2:
1328  /* FIXME: for C++, this is plain wrong, but as we don't use arg types
1329  * nor class information, this would just do for now
1330  */
1331  symt = codeview_new_func_signature(ctp, existing, type->mfunction_v2.call);
1332  if (details)
1333  {
1334  codeview_add_type(curr_type, symt);
1336  (struct symt_function_signature*)symt,
1337  type->mfunction_v2.rvtype,
1338  type->mfunction_v2.arglist);
1339  }
1340  break;
1341 
1342  case LF_VTSHAPE_V1:
1343  /* this is an ugly hack... FIXME when we have C++ support */
1344  if (!(symt = existing))
1345  {
1346  char buf[128];
1347  snprintf(buf, sizeof(buf), "__internal_vt_shape_%x\n", curr_type);
1348  symt = &symt_new_udt(ctp->module, buf, 0, UdtStruct)->symt;
1349  }
1350  break;
1351  default:
1352  FIXME("Unsupported type-id leaf %x\n", type->generic.id);
1353  dump(type, 2 + type->generic.len);
1354  return NULL;
1355  }
1356  return codeview_add_type(curr_type, symt) ? symt : NULL;
1357 }
#define LF_MODIFIER_V2
Definition: mscvpdb.h:1126
static struct symt * codeview_add_type_struct(struct codeview_type_parse *ctp, struct symt *existing, const char *name, int structlen, enum UdtKind kind, unsigned property)
Definition: msc.c:1010
#define LF_MODIFIER_V1
Definition: mscvpdb.h:1103
static struct symt * codeview_add_type_array(struct codeview_type_parse *ctp, const char *name, unsigned int elemtype, unsigned int indextype, unsigned int arr_len)
Definition: msc.c:666
#define LF_UNION_V1
Definition: mscvpdb.h:1108
#define LF_CLASS_V2
Definition: mscvpdb.h:1129
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TRUE
Definition: types.h:120
#define LF_UNION_V2
Definition: mscvpdb.h:1131
#define WARN(fmt,...)
Definition: debug.h:112
#define LF_PROCEDURE_V1
Definition: mscvpdb.h:1110
#define snprintf
Definition: wintirpc.h:48
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define LF_ARRAY_V3
Definition: mscvpdb.h:1202
static int codeview_add_type(unsigned int typeno, struct symt *dt)
Definition: msc.c:562
#define LF_ENUM_V2
Definition: mscvpdb.h:1132
#define LF_MFUNCTION_V2
Definition: mscvpdb.h:1134
#define LF_ARRAY_V2
Definition: mscvpdb.h:1128
static struct symt * codeview_fetch_type(struct codeview_type_parse *ctp, unsigned typeno, BOOL details)
Definition: msc.c:631
#define FIXME(fmt,...)
Definition: debug.h:111
static void * codeview_cast_symt(struct symt *symt, enum SymTagEnum tag)
Definition: msc.c:621
smooth NULL
Definition: ftsmooth.c:416
static struct symt * codeview_new_func_signature(struct codeview_type_parse *ctp, struct symt *existing, enum CV_call_e call_conv)
Definition: msc.c:1056
#define LF_UNION_V3
Definition: mscvpdb.h:1205
#define LF_ARRAY_V1
Definition: mscvpdb.h:1105
static int codeview_add_type_struct_field_list(struct codeview_type_parse *ctp, struct symt_udt *symt, unsigned fieldlistno)
Definition: msc.c:761
static struct symt * codeview_add_type_pointer(struct codeview_type_parse *ctp, struct symt *existing, unsigned int pointee_type)
Definition: msc.c:651
GLsizei const GLfloat * value
Definition: glext.h:6069
#define LF_CLASS_V1
Definition: mscvpdb.h:1106
#define LF_STRUCTURE_V2
Definition: mscvpdb.h:1130
#define LF_STRUCTURE_V3
Definition: mscvpdb.h:1204
#define LF_MFUNCTION_V1
Definition: mscvpdb.h:1111
struct symt_udt * symt_new_udt(struct module *module, const char *typename, unsigned size, enum UdtKind kind) DECLSPEC_HIDDEN
Definition: type.c:219
static struct symt * codeview_get_type(unsigned int typeno, BOOL quiet)
Definition: msc.c:513
static int numeric_leaf(int *value, const unsigned short int *leaf)
Definition: msc.c:385
#define LF_POINTER_V1
Definition: mscvpdb.h:1104
static void codeview_add_func_signature_args(struct codeview_type_parse *ctp, struct symt_function_signature *sym, unsigned ret_type, unsigned args_list)
Definition: msc.c:1074
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
struct module * module
Definition: msc.c:549
static struct symt * codeview_add_type_enum(struct codeview_type_parse *ctp, struct symt *existing, const char *name, unsigned fieldlistno, unsigned basetype)
Definition: msc.c:983
int details
Definition: msacm.c:1365
#define LF_POINTER_V2
Definition: mscvpdb.h:1127
#define LF_PROCEDURE_V2
Definition: mscvpdb.h:1133
#define LF_STRUCTURE_V1
Definition: mscvpdb.h:1107
static void dump(const void *ptr, unsigned len)
Definition: msc.c:95
#define LF_VTSHAPE_V1
Definition: mscvpdb.h:1112
#define LF_ENUM_V1
Definition: mscvpdb.h:1109
#define LF_CLASS_V3
Definition: mscvpdb.h:1203
#define LF_ENUM_V3
Definition: mscvpdb.h:1206

Referenced by codeview_fetch_type(), and codeview_parse_type_table().

◆ codeview_parse_type_table()

static BOOL codeview_parse_type_table ( struct codeview_type_parse ctp)
static

Definition at line 1359 of file msc.c.

1360 {
1361  unsigned int curr_type = FIRST_DEFINABLE_TYPE;
1362  const union codeview_type* type;
1363 
1364  for (curr_type = FIRST_DEFINABLE_TYPE; curr_type < FIRST_DEFINABLE_TYPE + ctp->num; curr_type++)
1365  {
1366  type = codeview_jump_to_type(ctp, curr_type);
1367 
1368  /* type records we're interested in are the ones referenced by symbols
1369  * The known ranges are (X mark the ones we want):
1370  * X 0000-0016 for V1 types
1371  * 0200-020c for V1 types referenced by other types
1372  * 0400-040f for V1 types (complex lists & sets)
1373  * X 1000-100f for V2 types
1374  * 1200-120c for V2 types referenced by other types
1375  * 1400-140f for V1 types (complex lists & sets)
1376  * X 1500-150d for V3 types
1377  * 8000-8010 for numeric leafes
1378  */
1379  if (!(type->generic.id & 0x8600) || (type->generic.id & 0x0100))
1380  codeview_parse_one_type(ctp, curr_type, type, TRUE);
1381  }
1382 
1383  return TRUE;
1384 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static struct symt * codeview_parse_one_type(struct codeview_type_parse *ctp, unsigned curr_type, const union codeview_type *type, BOOL details)
Definition: msc.c:1103
static const void * codeview_jump_to_type(const struct codeview_type_parse *ctp, DWORD idx)
Definition: msc.c:555
#define FIRST_DEFINABLE_TYPE
Definition: msc.c:125

Referenced by codeview_process_info(), and pdb_process_types().

◆ codeview_process_info()

static BOOL codeview_process_info ( const struct process pcs,
const struct msc_debug_info msc_dbg 
)
static

Definition at line 3262 of file msc.c.

3264 {
3265  const DWORD* signature = (const DWORD*)msc_dbg->root;
3266  BOOL ret = FALSE;
3267  struct pdb_lookup pdb_lookup;
3268 
3269  TRACE("Processing signature %.4s\n", (const char*)signature);
3270 
3271  switch (*signature)
3272  {
3273  case CODEVIEW_NB09_SIG:
3274  case CODEVIEW_NB11_SIG:
3275  {
3276  const OMFSignature* cv = (const OMFSignature*)msc_dbg->root;
3277  const OMFDirHeader* hdr = (const OMFDirHeader*)(msc_dbg->root + cv->filepos);
3278  const OMFDirEntry* ent;
3279  const OMFDirEntry* prev;
3280  const OMFDirEntry* next;
3281  unsigned int i;
3282 
3284 
3285  for (i = 0; i < hdr->cDir; i++)
3286  {
3287  ent = (const OMFDirEntry*)((const BYTE*)hdr + hdr->cbDirHeader + i * hdr->cbDirEntry);
3288  if (ent->SubSection == sstGlobalTypes)
3289  {
3290  const OMFGlobalTypes* types;
3291  struct codeview_type_parse ctp;
3292 
3293  types = (const OMFGlobalTypes*)(msc_dbg->root + ent->lfo);
3294  ctp.module = msc_dbg->module;
3295  ctp.offset = (const DWORD*)(types + 1);
3296  ctp.num = types->cTypes;
3297  ctp.table = (const BYTE*)(ctp.offset + types->cTypes);
3298 
3300  if (cv_current_module->allowed) FIXME("Already allowed??\n");
3301  cv_current_module->allowed = TRUE;
3302 
3304  break;
3305  }
3306  }
3307 
3308  ent = (const OMFDirEntry*)((const BYTE*)hdr + hdr->cbDirHeader);
3309  for (i = 0; i < hdr->cDir; i++, ent = next)
3310  {
3311  next = (i == hdr->cDir-1) ? NULL :
3312  (const OMFDirEntry*)((const BYTE*)ent + hdr->cbDirEntry);
3313  prev = (i == 0) ? NULL :
3314  (const OMFDirEntry*)((const BYTE*)ent - hdr->cbDirEntry);
3315 
3316  if (ent->SubSection == sstAlignSym)
3317  {
3318  codeview_snarf(msc_dbg, msc_dbg->root + ent->lfo, sizeof(DWORD),
3319  ent->cb, TRUE);
3320 
3321  /*
3322  * Check the next and previous entry. If either is a
3323  * sstSrcModule, it contains the line number info for
3324  * this file.
3325  *
3326  * FIXME: This is not a general solution!
3327  */
3328  if (next && next->iMod == ent->iMod && next->SubSection == sstSrcModule)
3329  codeview_snarf_linetab(msc_dbg, msc_dbg->root + next->lfo,
3330  next->cb, TRUE);
3331 
3332  if (prev && prev->iMod == ent->iMod && prev->SubSection == sstSrcModule)
3333  codeview_snarf_linetab(msc_dbg, msc_dbg->root + prev->lfo,
3334  prev->cb, TRUE);
3335 
3336  }
3337  }
3338 
3339  msc_dbg->module->module.SymType = SymCv;
3340  /* FIXME: we could have a finer grain here */
3341  msc_dbg->module->module.LineNumbers = TRUE;
3342  msc_dbg->module->module.GlobalSymbols = TRUE;
3343  msc_dbg->module->module.TypeInfo = TRUE;
3344  msc_dbg->module->module.SourceIndexed = TRUE;
3345  msc_dbg->module->module.Publics = TRUE;
3347  ret = TRUE;
3348  break;
3349  }
3350 
3351  case CODEVIEW_NB10_SIG:
3352  {
3353  const CODEVIEW_PDB_DATA* pdb = (const CODEVIEW_PDB_DATA*)msc_dbg->root;
3354  pdb_lookup.filename = pdb->name;
3356  pdb_lookup.timestamp = pdb->timestamp;
3357  pdb_lookup.age = pdb->age;
3358  ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
3359  break;
3360  }
3361  case CODEVIEW_RSDS_SIG:
3362  {
3363  const OMFSignatureRSDS* rsds = (const OMFSignatureRSDS*)msc_dbg->root;
3364 
3365  TRACE("Got RSDS type of PDB file: guid=%s age=%08x name=%s\n",
3366  wine_dbgstr_guid(&rsds->guid), rsds->age, rsds->name);
3367  pdb_lookup.filename = rsds->name;
3369  pdb_lookup.guid = rsds->guid;
3370  pdb_lookup.age = rsds->age;
3371  ret = pdb_process_file(pcs, msc_dbg, &pdb_lookup);
3372  break;
3373  }
3374  default:
3375  ERR("Unknown CODEVIEW signature %08x in module %s\n",
3376  *signature, debugstr_w(msc_dbg->module->module.ModuleName));
3377  break;
3378  }
3379  if (ret)
3380  {
3381  msc_dbg->module->module.CVSig = *signature;
3382  memcpy(msc_dbg->module->module.CVData, msc_dbg->root,
3383  sizeof(msc_dbg->module->module.CVData));
3384  }
3385  return ret;
3386 }
#define CODEVIEW_RSDS_SIG
Definition: msc.c:3260
char hdr[14]
Definition: iptest.cpp:33
static PDB pdb
Definition: db.cpp:170
#define sstAlignSym
Definition: mscvpdb.h:2154
#define TRUE
Definition: types.h:120
long filepos
Definition: mscvpdb.h:2172
Definition: compat.h:806
#define sstSrcModule
Definition: mscvpdb.h:2156
GLsizei GLenum GLenum * types
Definition: glext.h:7753
#define CODEVIEW_NB09_SIG
Definition: msc.c:3257
const char * wine_dbgstr_guid(const GUID *guid)
static BOOL pdb_process_file(const struct process *pcs, const struct msc_debug_info *msc_dbg, struct pdb_lookup *pdb_lookup)
Definition: msc.c:2862
CHAR name[1]
Definition: mscvpdb.h:2180
static void codeview_snarf_linetab(const struct msc_debug_info *msc_dbg, const BYTE *linetab, int size, BOOL pascal_str)
Definition: msc.c:1392
enum pdb_kind kind
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define CODEVIEW_NB10_SIG
Definition: msc.c:3258
smooth NULL
Definition: ftsmooth.c:416
static struct cv_defined_module cv_zmodules[CV_MAX_MODULES]
Definition: msc.c:137
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cmds.c:130
#define CODEVIEW_NB11_SIG
Definition: msc.c:3259
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD cb
Definition: mscvpdb.h:2206
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: xxhash.c:193
const BYTE * root
Definition: mscvpdb.h:2139
#define ERR(fmt,...)
Definition: debug.h:110
#define sstGlobalTypes
Definition: mscvpdb.h:2160
static void codeview_clear_type_table(void)
Definition: msc.c:602
static unsigned __int64 next
Definition: rand_nt.c:6
static BOOL codeview_snarf(const struct msc_debug_info *msc_dbg, const BYTE *root, int offset, int size, BOOL do_globals)
Definition: msc.c:1584
struct module * module
Definition: mscvpdb.h:2134
static void codeview_init_basic_types(struct module *module)
Definition: msc.c:140
static struct cv_defined_module * cv_current_module
Definition: msc.c:138
WORD SubSection
Definition: mscvpdb.h:2203
static BOOL codeview_parse_type_table(struct codeview_type_parse *ctp)
Definition: msc.c:1359
WORD iMod
Definition: mscvpdb.h:2204
const char * filename
DWORD lfo
Definition: mscvpdb.h:2205

Referenced by pe_load_debug_directory().

◆ codeview_snarf()

static BOOL codeview_snarf ( const struct msc_debug_info msc_dbg,
const BYTE root,
int  offset,
int  size,
BOOL  do_globals 
)
static

Definition at line 1584 of file msc.c.

1586 {
1587  struct symt_function* curr_func = NULL;
1588  int i, length;
1589  struct symt_block* block = NULL;
1590  struct symt* symt;
1591  struct symt_compiland* compiland = NULL;
1592  struct location loc;
1593 
1594  /*
1595  * Loop over the different types of records and whenever we
1596  * find something we are interested in, record it and move on.
1597  */
1598  for (i = offset; i < size; i += length)
1599  {
1600  const union codeview_symbol* sym = (const union codeview_symbol*)(root + i);
1601  length = sym->generic.len + 2;
1602  if (i + length > size) break;
1603  if (!sym->generic.id || length < 4) break;
1604  if (length & 3) FIXME("unpadded len %u\n", length);
1605 
1606  switch (sym->generic.id)
1607  {
1608  /*
1609  * Global and local data symbols. We don't associate these
1610  * with any given source file.
1611  */
1612  case S_GDATA_V1:
1613  case S_LDATA_V1:
1614  if (do_globals)
1615  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->data_v1.p_name),
1616  sym->data_v1.segment, sym->data_v1.offset, sym->data_v1.symtype,
1617  sym->generic.id == S_LDATA_V1, FALSE, TRUE);
1618  break;
1619  case S_GDATA_V2:
1620  case S_LDATA_V2:
1621  if (do_globals)
1622  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->data_v2.p_name),
1623  sym->data_v2.segment, sym->data_v2.offset, sym->data_v2.symtype,
1624  sym->generic.id == S_LDATA_V2, FALSE, TRUE);
1625  break;
1626  case S_GDATA_V3:
1627  case S_LDATA_V3:
1628  if (do_globals)
1629  codeview_add_variable(msc_dbg, compiland, sym->data_v3.name,
1630  sym->data_v3.segment, sym->data_v3.offset, sym->data_v3.symtype,
1631  sym->generic.id == S_LDATA_V3, FALSE, TRUE);
1632  break;
1633 
1634  /* variables with thread storage */
1635  case S_GTHREAD_V1:
1636  case S_LTHREAD_V1:
1637  if (do_globals)
1638  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->thread_v1.p_name),
1639  sym->thread_v1.segment, sym->thread_v1.offset, sym->thread_v1.symtype,
1640  sym->generic.id == S_LTHREAD_V1, TRUE, TRUE);
1641  break;
1642  case S_GTHREAD_V2:
1643  case S_LTHREAD_V2:
1644  if (do_globals)
1645  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->thread_v2.p_name),
1646  sym->thread_v2.segment, sym->thread_v2.offset, sym->thread_v2.symtype,
1647  sym->generic.id == S_LTHREAD_V2, TRUE, TRUE);
1648  break;
1649  case S_GTHREAD_V3:
1650  case S_LTHREAD_V3:
1651  if (do_globals)
1652  codeview_add_variable(msc_dbg, compiland, sym->thread_v3.name,
1653  sym->thread_v3.segment, sym->thread_v3.offset, sym->thread_v3.symtype,
1654  sym->generic.id == S_LTHREAD_V3, TRUE, TRUE);
1655  break;
1656 
1657  /* Public symbols */
1658  case S_PUB_V1:
1659  case S_PUB_V2:
1660  case S_PUB_V3:
1661  case S_PUB_FUNC1_V3:
1662  case S_PUB_FUNC2_V3:
1663  /* will be handled later on in codeview_snarf_public */
1664  break;
1665 
1666  /*
1667  * Sort of like a global function, but it just points
1668  * to a thunk, which is a stupid name for what amounts to
1669  * a PLT slot in the normal jargon that everyone else uses.
1670  */
1671  case S_THUNK_V1:
1672  symt_new_thunk(msc_dbg->module, compiland,
1673  terminate_string(&sym->thunk_v1.p_name), sym->thunk_v1.thtype,
1674  codeview_get_address(msc_dbg, sym->thunk_v1.segment, sym->thunk_v1.offset),
1675  sym->thunk_v1.thunk_len);
1676  break;
1677  case S_THUNK_V3:
1678  symt_new_thunk(msc_dbg->module, compiland,
1679  sym->thunk_v3.name, sym->thunk_v3.thtype,
1680  codeview_get_address(msc_dbg, sym->thunk_v3.segment, sym->thunk_v3.offset),
1681  sym->thunk_v3.thunk_len);
1682  break;
1683 
1684  /*
1685  * Global and static functions.
1686  */
1687  case S_GPROC_V1:
1688  case S_LPROC_V1:
1689  if (curr_func) FIXME("nested function\n");
1690  curr_func = symt_new_function(msc_dbg->module, compiland,
1691  terminate_string(&sym->proc_v1.p_name),
1692  codeview_get_address(msc_dbg, sym->proc_v1.segment, sym->proc_v1.offset),
1693  sym->proc_v1.proc_len,
1694  codeview_get_type(sym->proc_v1.proctype, FALSE));
1695  loc.kind = loc_absolute;
1696  loc.offset = sym->proc_v1.debug_start;
1697  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugStart, &loc, NULL);
1698  loc.offset = sym->proc_v1.debug_end;
1699  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugEnd, &loc, NULL);
1700  break;
1701  case S_GPROC_V2:
1702  case S_LPROC_V2:
1703  if (curr_func) FIXME("nested function\n");
1704  curr_func = symt_new_function(msc_dbg->module, compiland,
1705  terminate_string(&sym->proc_v2.p_name),
1706  codeview_get_address(msc_dbg, sym->proc_v2.segment, sym->proc_v2.offset),
1707  sym->proc_v2.proc_len,
1708  codeview_get_type(sym->proc_v2.proctype, FALSE));
1709  loc.kind = loc_absolute;
1710  loc.offset = sym->proc_v2.debug_start;
1711  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugStart, &loc, NULL);
1712  loc.offset = sym->proc_v2.debug_end;
1713  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugEnd, &loc, NULL);
1714  break;
1715  case S_GPROC_V3:
1716  case S_LPROC_V3:
1717  if (curr_func) FIXME("nested function\n");
1718  curr_func = symt_new_function(msc_dbg->module, compiland,
1719  sym->proc_v3.name,
1720  codeview_get_address(msc_dbg, sym->proc_v3.segment, sym->proc_v3.offset),
1721  sym->proc_v3.proc_len,
1722  codeview_get_type(sym->proc_v3.proctype, FALSE));
1723  loc.kind = loc_absolute;
1724  loc.offset = sym->proc_v3.debug_start;
1725  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugStart, &loc, NULL);
1726  loc.offset = sym->proc_v3.debug_end;
1727  symt_add_function_point(msc_dbg->module, curr_func, SymTagFuncDebugEnd, &loc, NULL);
1728  break;
1729  /*
1730  * Function parameters and stack variables.
1731  */
1732  case S_BPREL_V1:
1733  loc.kind = loc_regrel;
1734  /* Yes, it's i386 dependent, but that's the symbol purpose. S_REGREL is used on other CPUs */
1735  loc.reg = CV_REG_EBP;
1736  loc.offset = sym->stack_v1.offset;
1737  symt_add_func_local(msc_dbg->module, curr_func,
1738  sym->stack_v1.offset > 0 ? DataIsParam : DataIsLocal,
1739  &loc, block,
1740  codeview_get_type(sym->stack_v1.symtype, FALSE),
1741  terminate_string(&sym->stack_v1.p_name));
1742  break;
1743  case S_BPREL_V2:
1744  loc.kind = loc_regrel;
1745  /* Yes, it's i386 dependent, but that's the symbol purpose. S_REGREL is used on other CPUs */
1746  loc.reg = CV_REG_EBP;
1747  loc.offset = sym->stack_v2.offset;
1748  symt_add_func_local(msc_dbg->module, curr_func,
1749  sym->stack_v2.offset > 0 ? DataIsParam : DataIsLocal,
1750  &loc, block,
1751  codeview_get_type(sym->stack_v2.symtype, FALSE),
1752  terminate_string(&sym->stack_v2.p_name));
1753  break;
1754  case S_BPREL_V3:
1755  loc.kind = loc_regrel;
1756  /* Yes, it's i386 dependent, but that's the symbol purpose. S_REGREL is used on other CPUs */
1757  loc.reg = CV_REG_EBP;
1758  loc.offset = sym->stack_v3.offset;
1759  symt_add_func_local(msc_dbg->module, curr_func,
1760  sym->stack_v3.offset > 0 ? DataIsParam : DataIsLocal,
1761  &loc, block,
1762  codeview_get_type(sym->stack_v3.symtype, FALSE),
1763  sym->stack_v3.name);
1764  break;
1765  case S_REGREL_V3:
1766  loc.kind = loc_regrel;
1767  loc.reg = sym->regrel_v3.reg;
1768  loc.offset = sym->regrel_v3.offset;
1769  symt_add_func_local(msc_dbg->module, curr_func,
1770  /* FIXME this is wrong !!! */
1771  sym->regrel_v3.offset > 0 ? DataIsParam : DataIsLocal,
1772  &loc, block,
1773  codeview_get_type(sym->regrel_v3.symtype, FALSE),
1774  sym->regrel_v3.name);
1775  break;
1776 
1777  case S_REGISTER_V1:
1778  loc.kind = loc_register;
1779  loc.reg = sym->register_v1.reg;
1780  loc.offset = 0;
1781  symt_add_func_local(msc_dbg->module, curr_func,
1782  DataIsLocal, &loc,
1784  terminate_string(&sym->register_v1.p_name));
1785  break;
1786  case S_REGISTER_V2:
1787  loc.kind = loc_register;
1788  loc.reg = sym->register_v2.reg;
1789  loc.offset = 0;
1790  symt_add_func_local(msc_dbg->module, curr_func,
1791  DataIsLocal, &loc,
1793  terminate_string(&sym->register_v2.p_name));
1794  break;
1795  case S_REGISTER_V3:
1796  loc.kind = loc_register;
1797  loc.reg = sym->register_v3.reg;
1798  loc.offset = 0;
1799  symt_add_func_local(msc_dbg->module, curr_func,
1800  DataIsLocal, &loc,
1802  sym->register_v3.name);
1803  break;
1804 
1805  case S_BLOCK_V1:
1806  block = symt_open_func_block(msc_dbg->module, curr_func, block,
1807  codeview_get_address(msc_dbg, sym->block_v1.segment, sym->block_v1.offset),
1808  sym->block_v1.length);
1809  break;
1810  case S_BLOCK_V3:
1811  block = symt_open_func_block(msc_dbg->module, curr_func, block,
1812  codeview_get_address(msc_dbg, sym->block_v3.segment, sym->block_v3.offset),
1813  sym->block_v3.length);
1814  break;
1815 
1816  case S_END_V1:
1817  if (block)
1818  {
1819  block = symt_close_func_block(msc_dbg->module, curr_func, block, 0);
1820  }
1821  else if (curr_func)
1822  {
1823  symt_normalize_function(msc_dbg->module, curr_func);
1824  curr_func = NULL;
1825  }
1826  break;
1827 
1828  case S_COMPILAND_V1:
1829  TRACE("S-Compiland-V1 %x %s\n",
1830  sym->compiland_v1.unknown, terminate_string(&sym->compiland_v1.p_name));
1831  break;
1832 
1833  case S_COMPILAND_V2:
1834  TRACE("S-Compiland-V2 %s\n", terminate_string(&sym->compiland_v2.p_name));
1835  if (TRACE_ON(dbghelp_msc))
1836  {
1837  const char* ptr1 = sym->compiland_v2.p_name.name + sym->compiland_v2.p_name.namelen;
1838  const char* ptr2;
1839  while (*ptr1)
1840  {
1841  ptr2 = ptr1 + strlen(ptr1) + 1;
1842  TRACE("\t%s => %s\n", ptr1, debugstr_a(ptr2));
1843  ptr1 = ptr2 + strlen(ptr2) + 1;
1844  }
1845  }
1846  break;
1847  case S_COMPILAND_V3:
1848  TRACE("S-Compiland-V3 %s\n", sym->compiland_v3.name);
1849  if (TRACE_ON(dbghelp_msc))
1850  {
1851  const char* ptr1 = sym->compiland_v3.name + strlen(sym->compiland_v3.name);
1852  const char* ptr2;
1853  while (*ptr1)
1854  {
1855  ptr2 = ptr1 + strlen(ptr1) + 1;
1856  TRACE("\t%s => %s\n", ptr1, debugstr_a(ptr2));
1857  ptr1 = ptr2 + strlen(ptr2) + 1;
1858  }
1859  }
1860  break;
1861 
1862  case S_OBJNAME_V1:
1863  TRACE("S-ObjName %s\n", terminate_string(&sym->objname_v1.p_name));
1864  compiland = symt_new_compiland(msc_dbg->module, 0 /* FIXME */,
1865  source_new(msc_dbg->module, NULL,
1866  terminate_string(&sym->objname_v1.p_name)));
1867  break;
1868 
1869  case S_LABEL_V1:
1870  if (curr_func)
1871  {
1872  loc.kind = loc_absolute;
1873  loc.offset = codeview_get_address(msc_dbg, sym->label_v1.segment, sym->label_v1.offset) - curr_func->address;
1874  symt_add_function_point(msc_dbg->module, curr_func, SymTagLabel, &loc,
1875  terminate_string(&sym->label_v1.p_name));
1876  }
1877  else symt_new_label(msc_dbg->module, compiland,
1878  terminate_string(&sym->label_v1.p_name),
1879  codeview_get_address(msc_dbg, sym->label_v1.segment, sym->label_v1.offset));
1880  break;
1881  case S_LABEL_V3:
1882  if (curr_func)
1883  {
1884  loc.kind = loc_absolute;
1885  loc.offset = codeview_get_address(msc_dbg, sym->label_v3.segment, sym->label_v3.offset) - curr_func->address;
1886  symt_add_function_point(msc_dbg->module, curr_func, SymTagLabel,
1887  &loc, sym->label_v3.name);
1888  }
1889  else symt_new_label(msc_dbg->module, compiland, sym->label_v3.name,
1890  codeview_get_address(msc_dbg, sym->label_v3.segment, sym->label_v3.offset));
1891  break;
1892 
1893  case S_CONSTANT_V1:
1894  {
1895  int vlen;
1896  const struct p_string* name;
1897  struct symt* se;
1898  VARIANT v;
1899 
1900  vlen = leaf_as_variant(&v, &sym->constant_v1.cvalue);
1901  name = (const struct p_string*)((const char*)&sym->constant_v1.cvalue + vlen);
1902  se = codeview_get_type(sym->constant_v1.type, FALSE);
1903 
1904  TRACE("S-Constant-V1 %u %s %x\n",
1905  v.n1.n2.n3.intVal, terminate_string(name), sym->constant_v1.type);
1906  symt_new_constant(msc_dbg->module, compiland, terminate_string(name),
1907  se, &v);
1908  }
1909  break;
1910  case S_CONSTANT_V2:
1911  {
1912  int vlen;
1913  const struct p_string* name;
1914  struct symt* se;
1915  VARIANT v;
1916 
1917  vlen = leaf_as_variant(&v, &sym->constant_v2.cvalue);
1918  name = (const struct p_string*)((const char*)&sym->constant_v2.cvalue + vlen);
1919  se = codeview_get_type(sym->constant_v2.type, FALSE);
1920 
1921  TRACE("S-Constant-V2 %u %s %x\n",
1922  v.n1.n2.n3.intVal, terminate_string(name), sym->constant_v2.type);
1923  symt_new_constant(msc_dbg->module, compiland, terminate_string(name),
1924  se, &v);
1925  }
1926  break;
1927  case S_CONSTANT_V3:
1928  {
1929  int vlen;
1930  const char* name;
1931  struct symt* se;
1932  VARIANT v;
1933 
1934  vlen = leaf_as_variant(&v, &sym->constant_v3.cvalue);
1935  name = (const char*)&sym->constant_v3.cvalue + vlen;
1936  se = codeview_get_type(sym->constant_v3.type, FALSE);
1937 
1938  TRACE("S-Constant-V3 %u %s %x\n",
1939  v.n1.n2.n3.intVal, name, sym->constant_v3.type);
1940  /* FIXME: we should add this as a constant value */
1941  symt_new_constant(msc_dbg->module, compiland, name, se, &v);
1942  }
1943  break;
1944 
1945  case S_UDT_V1:
1946  if (sym->udt_v1.type)
1947  {
1948  if ((symt = codeview_get_type(sym->udt_v1.type, FALSE)))
1949  symt_new_typedef(msc_dbg->module, symt,
1950  terminate_string(&sym->udt_v1.p_name));
1951  else
1952  FIXME("S-Udt %s: couldn't find type 0x%x\n",
1953  terminate_string(&sym->udt_v1.p_name), sym->udt_v1.type);
1954  }
1955  break;
1956  case S_UDT_V2:
1957  if (sym->udt_v2.type)
1958  {
1959  if ((symt = codeview_get_type(sym->udt_v2.type, FALSE)))
1960  symt_new_typedef(msc_dbg->module, symt,
1961  terminate_string(&sym->udt_v2.p_name));
1962  else
1963  FIXME("S-Udt %s: couldn't find type 0x%x\n",
1964  terminate_string(&sym->udt_v2.p_name), sym->udt_v2.type);
1965  }
1966  break;
1967  case S_UDT_V3:
1968  if (sym->udt_v3.type)
1969  {
1970  if ((symt = codeview_get_type(sym->udt_v3.type, FALSE)))
1971  symt_new_typedef(msc_dbg->module, symt, sym->udt_v3.name);
1972  else
1973  FIXME("S-Udt %s: couldn't find type 0x%x\n",
1974  sym->udt_v3.name, sym->udt_v3.type);
1975  }
1976  break;
1977 
1978  /*
1979  * These are special, in that they are always followed by an
1980  * additional length-prefixed string which is *not* included
1981  * into the symbol length count. We need to skip it.
1982  */
1983  case S_PROCREF_V1:
1984  case S_DATAREF_V1:
1985  case S_LPROCREF_V1:
1986  {
1987  const char* name;
1988 
1989  name = (const char*)sym + length;
1990  length += (*name + 1 + 3) & ~3;
1991  break;
1992  }
1993 
1994  case S_MSTOOL_V3: /* just to silence a few warnings */
1995  case S_MSTOOLINFO_V3:
1996  case S_MSTOOLENV_V3:
1997  break;
1998 
1999  case S_SSEARCH_V1:
2000  TRACE("Start search: seg=0x%x at offset 0x%08x\n",
2001  sym->ssearch_v1.segment, sym->ssearch_v1.offset);
2002  break;
2003 
2004  case S_ALIGN_V1:
2005  TRACE("S-Align V1\n");
2006  break;
2007  case S_HEAPALLOCSITE:
2008  TRACE("heap site: offset=0x%08x at sect_idx 0x%04x, inst_len 0x%08x, index 0x%08x\n",
2009  sym->heap_alloc_site.offset, sym->heap_alloc_site.sect_idx,
2010  sym->heap_alloc_site.inst_len, sym->heap_alloc_site.index);
2011  break;
2012 
2013  /* the symbols we can safely ignore for now */
2014  case S_TRAMPOLINE:
2015  case S_FRAMEINFO_V2:
2016  case S_SECUCOOKIE_V3:
2017  case S_SECTINFO_V3:
2018  case S_SUBSECTINFO_V3:
2019  case S_ENTRYPOINT_V3:
2020  case S_LOCAL_VS2013:
2021  case S_CALLSITEINFO:
2022  case S_DEFRANGE_REGISTER:
2025  case S_FPOFF_VS2013:
2027  case S_BUILDINFO:
2028  case S_INLINESITE:
2029  case S_INLINESITE_END:
2030  case S_FILESTATIC:
2031  case S_CALLEES:
2032  TRACE("Unsupported symbol id %x\n", sym->generic.id);
2033  break;
2034 
2035  default:
2036  FIXME("Unsupported symbol id %x\n", sym->generic.id);
2037  dump(sym, 2 + sym->generic.len);
2038  break;
2039  }
2040  }
2041 
2042  if (curr_func) symt_normalize_function(msc_dbg->module, curr_func);
2043 
2044  return TRUE;
2045 }
#define S_LDATA_V3
Definition: mscvpdb.h:1726
static unsigned int block
Definition: xmlmemory.c:118
struct codeview_symbol::@3625 compiland_v1
struct symt_function * symt_new_function(struct module *module, struct symt_compiland *parent, const char *name, ULONG_PTR addr, ULONG_PTR size, struct symt *type) DECLSPEC_HIDDEN
Definition: symbol.c:293
#define S_BUILDINFO
Definition: mscvpdb.h:1791
#define S_PUB_FUNC2_V3
Definition: mscvpdb.h:1753
#define S_DEFRANGE_REGISTER
Definition: mscvpdb.h:1780
#define S_REGISTER_V2
Definition: mscvpdb.h:1697
struct symt_block * symt_open_func_block(struct module *module, struct symt_function *func, struct symt_block *block, unsigned pc, unsigned len) DECLSPEC_HIDDEN
Definition: symbol.c:413
#define S_CONSTANT_V2
Definition: mscvpdb.h:1698
#define S_COMPILAND_V1
Definition: mscvpdb.h:1661
#define S_UDT_V3
Definition: mscvpdb.h:1722
#define S_INLINESITE
Definition: mscvpdb.h:1792
#define S_DATAREF_V1
Definition: mscvpdb.h:1693
struct symt_data * symt_add_func_local(struct module *module, struct symt_function *func, enum DataKind dt, const struct location *loc, struct symt_block *block, struct symt *type, const char *name) DECLSPEC_HIDDEN
Definition: symbol.c:378
#define S_DEFRANGE_SUBFIELD_REGISTER
Definition: mscvpdb.h:1782
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
#define S_REGREL_V3
Definition: mscvpdb.h:1731
#define S_GTHREAD_V1
Definition: mscvpdb.h:1690
#define S_MSTOOLINFO_V3
Definition: mscvpdb.h:1774
struct codeview_symbol::@3608 stack_v2
struct codeview_symbol::@3631 ssearch_v1
struct codeview_symbol::@3607 stack_v1
struct codeview_symbol::@3620 constant_v3
struct codeview_symbol::@3616 label_v1
#define S_UDT_V1
Definition: mscvpdb.h:1664
#define S_CALLSITEINFO
Definition: mscvpdb.h:1771
#define S_THUNK_V3
Definition: mscvpdb.h:1716
GLintptr offset
Definition: glext.h:5920
#define S_LTHREAD_V3
Definition: mscvpdb.h:1732
#define S_MSTOOL_V3
Definition: mscvpdb.h:1736
#define S_LPROC_V1
Definition: mscvpdb.h:1680
struct codeview_symbol::@3629 thread_v2
#define S_GPROC_V2
Definition: mscvpdb.h:1707
struct symt_typedef * symt_new_typedef(struct module *module, struct symt *ref, const char *name) DECLSPEC_HIDDEN
Definition: type.c:428
#define S_THUNK_V1
Definition: mscvpdb.h:1682
#define S_HEAPALLOCSITE
Definition: mscvpdb.h:1805
struct codeview_symbol::@3600 thunk_v3
struct codeview_symbol::@3630 thread_v3
#define S_BPREL_V3
Definition: mscvpdb.h:1725
static void codeview_add_variable(const struct msc_debug_info *msc_dbg, struct symt_compiland *compiland, const char *name, unsigned segment, unsigned offset, unsigned symtype, BOOL is_local, BOOL in_tls, BOOL force)
Definition: msc.c:1562
#define S_BPREL_V1
Definition: mscvpdb.h:1676
#define S_LDATA_V2
Definition: mscvpdb.h:1703
#define S_COMPILAND_V3
Definition: mscvpdb.h:1715
#define S_COMPILAND_V2
Definition: mscvpdb.h:1713
#define S_LPROC_V2
Definition: mscvpdb.h:1706
#define S_UDT_V2
Definition: mscvpdb.h:1699
struct symt_hierarchy_point * symt_new_label(struct module *module, struct symt_compiland *compiland, const char *name, ULONG_PTR address) DECLSPEC_HIDDEN
Definition: symbol.c:554
#define S_SECTINFO_V3
Definition: mscvpdb.h:1768
#define S_CONSTANT_V3
Definition: mscvpdb.h:1721
struct codeview_symbol::@3601 proc_v1
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_DEFRANGE_FRAMEPOINTER_REL
Definition: mscvpdb.h:1781
#define FALSE
Definition: types.h:117
#define S_ENTRYPOINT_V3
Definition: mscvpdb.h:1770
#define S_LTHREAD_V1
Definition: mscvpdb.h:1689
#define S_GDATA_V3
Definition: mscvpdb.h:1727
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_INLINESITE_END
Definition: mscvpdb.h:1793
struct symt_data * symt_new_constant(struct module *module, struct symt_compiland *parent, const char *name, struct symt *type, const VARIANT *v) DECLSPEC_HIDDEN
Definition: symbol.c:525
smooth NULL
Definition: ftsmooth.c:416
struct codeview_symbol::@3617 label_v3
struct codeview_symbol::@3603 proc_v3
struct codeview_symbol::@3624 objname_v1
#define S_LABEL_V1
Definition: mscvpdb.h:1685
#define S_SECUCOOKIE_V3
Definition: mscvpdb.h:1772
#define S_GDATA_V1
Definition: mscvpdb.h:1678
#define S_END_V1
Definition: mscvpdb.h:1666
#define S_TRAMPOLINE
Definition: mscvpdb.h:1758
#define S_BLOCK_V3
Definition: mscvpdb.h:1717
static int leaf_as_variant(VARIANT *v, const unsigned short int *leaf)
Definition: msc.c:259
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
struct codeview_symbol::@3614 block_v1
#define debugstr_a
Definition: kernel32.h:31
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define S_PUB_V2
Definition: mscvpdb.h:1705
#define S_LDATA_V1
Definition: mscvpdb.h:1677
#define S_CONSTANT_V1
Definition: mscvpdb.h:1663
struct symt_thunk * symt_new_thunk(struct module *module, struct symt_compiland *parent, const char *name, THUNK_ORDINAL ord, ULONG_PTR addr, ULONG_PTR size) DECLSPEC_HIDDEN
Definition: symbol.c:496
struct codeview_symbol::@3634 heap_alloc_site
struct codeview_symbol::@3615 block_v3
#define S_PUB_FUNC1_V3
Definition: mscvpdb.h:1751
#define S_OBJNAME_V1
Definition: mscvpdb.h:1669
struct codeview_symbol::@3609 stack_v3
#define S_LABEL_V3
Definition: mscvpdb.h:1719
struct codeview_symbol::@3599 thunk_v1
#define S_LTHREAD_V2
Definition: mscvpdb.h:1710
static ULONG_PTR codeview_get_address(const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
Definition: msc.c:1551
#define S_GPROC_V1
Definition: mscvpdb.h:1681
struct symt_hierarchy_point * symt_add_function_point(struct module *module, struct symt_function *func, enum SymTagEnum point, const struct location *loc, const char *name) DECLSPEC_HIDDEN
Definition: symbol.c:452
#define S_MSTOOLENV_V3
Definition: mscvpdb.h:1775
struct codeview_symbol::@3598 data_v3
#define S_LOCAL_VS2013
Definition: mscvpdb.h:1777
#define S_FRAMEINFO_V2
Definition: mscvpdb.h:1712
struct codeview_symbol::@3612 register_v2
struct codeview_symbol::@3613 register_v3
struct codeview_symbol::@3595 generic
BOOL symt_normalize_function(struct module *module, const struct symt_function *func) DECLSPEC_HIDDEN
Definition: symbol.c:473
#define S_ALIGN_V1
Definition: mscvpdb.h:1694
struct codeview_symbol::@3611 register_v1
static struct symt * codeview_get_type(unsigned int typeno, BOOL quiet)
Definition: msc.c:513
const GLdouble * v
Definition: gl.h:2040
struct module * module
Definition: mscvpdb.h:2134
struct codeview_symbol::@3627 compiland_v3
#define S_REGISTER_V1
Definition: mscvpdb.h:1662
ULONG_PTR address
struct codeview_symbol::@3622 udt_v2
#define S_CALLEES
Definition: mscvpdb.h:1801
#define S_DEFRANGE_REGISTER_REL
Definition: mscvpdb.h:1784
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
#define S_SUBSECTINFO_V3
Definition: mscvpdb.h:1769
#define S_BLOCK_V1
Definition: mscvpdb.h:1683
struct codeview_symbol::@3626 compiland_v2
#define S_GPROC_V3
Definition: mscvpdb.h:1730
#define S_LPROCREF_V1
Definition: mscvpdb.h:1695
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
Definition: source.c:66
#define S_SSEARCH_V1
Definition: mscvpdb.h:1665
#define S_PUB_V3
Definition: mscvpdb.h:1728
Definition: name.c:38
#define S_LPROC_V3
Definition: mscvpdb.h:1729
#define S_FPOFF_VS2013
Definition: mscvpdb.h:1783
struct codeview_symbol::@3602 proc_v2
struct codeview_symbol::@3623 udt_v3
#define S_GDATA_V2
Definition: mscvpdb.h:1704
#define S_GTHREAD_V2
Definition: mscvpdb.h:1711
struct codeview_symbol::@3619 constant_v2
#define S_REGISTER_V3
Definition: mscvpdb.h:1720
#define S_GTHREAD_V3
Definition: mscvpdb.h:1733
struct codeview_symbol::@3621 udt_v1
#define S_PROCREF_V1
Definition: mscvpdb.h:1692
#define S_FILESTATIC
Definition: mscvpdb.h:1799
#define S_BPREL_V2
Definition: mscvpdb.h:1702
#define TRACE_ON(x)
Definition: compat.h:75
struct codeview_symbol::@3597 data_v2
struct symt_block * symt_close_func_block(struct module *module, const struct symt_function *func, struct symt_block *block, unsigned pc) DECLSPEC_HIDDEN
Definition: symbol.c:440
static void dump(const void *ptr, unsigned len)
Definition: msc.c:95
struct codeview_symbol::@3618 constant_v1
struct codeview_symbol::@3596 data_v1
struct symt_compiland * symt_new_compiland(struct module *module, ULONG_PTR address, unsigned src_idx) DECLSPEC_HIDDEN
Definition: symbol.c:207
#define S_PUB_V1
Definition: mscvpdb.h:1679
struct codeview_symbol::@3610 regrel_v3
struct codeview_symbol::@3628 thread_v1
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by codeview_process_info(), and pdb_process_internal().

◆ codeview_snarf_linetab()

static void codeview_snarf_linetab ( const struct msc_debug_info msc_dbg,
const BYTE linetab,
int  size,
BOOL  pascal_str 
)
static

Definition at line 1392 of file msc.c.

1394 {
1395  const BYTE* ptr = linetab;
1396  int nfile, nseg;
1397  int i, j;
1398  unsigned int k;
1399  const unsigned int* filetab;
1400  const unsigned int* lt_ptr;
1401  const unsigned short* linenos;
1402  const struct startend* start;
1403  unsigned source;
1404  ULONG_PTR addr, func_addr0;
1405  struct symt_function* func;
1406  const struct codeview_linetab_block* ltb;
1407 
1408  nfile = *(const short*)linetab;
1409  filetab = (const unsigned int*)(linetab + 2 * sizeof(short));
1410 
1411  for (i = 0; i < nfile; i++)
1412  {
1413  ptr = linetab + filetab[i];
1414  nseg = *(const short*)ptr;
1415  lt_ptr = (const unsigned int*)(ptr + 2 * sizeof(short));
1416  start = (const struct startend*)(lt_ptr + nseg);
1417 
1418  /*
1419  * Now snarf the filename for all of the segments for this file.
1420  */
1421  if (pascal_str)
1422  source = source_new(msc_dbg->module, NULL, terminate_string((const struct p_string*)(start + nseg)));
1423  else
1424  source = source_new(msc_dbg->module, NULL, (const char*)(start + nseg));
1425 
1426  for (j = 0; j < nseg; j++)
1427  {
1428  ltb = (const struct codeview_linetab_block*)(linetab + *lt_ptr++);
1429  linenos = (const unsigned short*)&ltb->offsets[ltb->num_lines];
1430  func_addr0 = codeview_get_address(msc_dbg, ltb->seg, start[j].start);
1431  if (!func_addr0) continue;
1432  for (func = NULL, k = 0; k < ltb->num_lines; k++)
1433  {
1434  /* now locate function (if any) */
1435  addr = func_addr0 + ltb->offsets[k] - start[j].start;
1436  /* unfortunately, we can have several functions in the same block, if there's no
1437  * gap between them... find the new function if needed
1438  */
1439  if (!func || addr >= func->address + func->size)
1440  {
1441  func = (struct symt_function*)symt_find_nearest(msc_dbg->module, addr);
1442  /* FIXME: at least labels support line numbers */
1443  if (!func || func->symt.tag != SymTagFunction)
1444  {
1445  WARN("--not a func at %04x:%08x %lx tag=%d\n",
1446  ltb->seg, ltb->offsets[k], addr, func ? func->symt.tag : -1);
1447  func = NULL;
1448  break;
1449  }
1450  }
1451  symt_add_func_line(msc_dbg->module, func, source,
1452  linenos[k], addr - func->address);
1453  }
1454  }
1455  }
1456 }
GLenum func
Definition: glext.h:6028
unsigned int offsets[1]
Definition: mscvpdb.h:1822
#define WARN(fmt,...)
Definition: debug.h:112
unsigned short seg
Definition: mscvpdb.h:1820
uint32_t ULONG_PTR
Definition: typedefs.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
unsigned short num_lines
Definition: mscvpdb.h:1821
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static ULONG_PTR codeview_get_address(const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
Definition: msc.c:1551
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: xxhash.c:193
struct module * module
Definition: mscvpdb.h:2134
GLuint start
Definition: gl.h:1545
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
void symt_add_func_line(struct module *module, struct symt_function *func, unsigned source_idx, int line_num, ULONG_PTR offset) DECLSPEC_HIDDEN
Definition: symbol.c:326
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
Definition: source.c:66
int k
Definition: mpi.c:3369
struct symt_ht * symt_find_nearest(struct module *module, DWORD_PTR addr) DECLSPEC_HIDDEN
Definition: symbol.c:903

Referenced by codeview_process_info(), and pdb_process_internal().

◆ codeview_snarf_linetab2()

static void codeview_snarf_linetab2 ( const struct msc_debug_info msc_dbg,
const BYTE linetab,
DWORD  size,
const char strimage,
DWORD  strsize 
)
static

Definition at line 1458 of file msc.c.

1460 {
1461  unsigned i;
1462  DWORD_PTR addr;
1463  const struct codeview_linetab2* lt2;
1464  const struct codeview_linetab2* lt2_files = NULL;
1465  const struct codeview_lt2blk_lines* lines_blk;
1466  const struct codeview_linetab2_file*fd;
1467  unsigned source;
1468  struct symt_function* func;
1469 
1470  /* locate LT2_FILES_BLOCK (if any) */
1471  lt2 = (const struct codeview_linetab2*)linetab;
1472  while ((const BYTE*)(lt2 + 1) < linetab + size)
1473  {
1474  if (lt2->header == LT2_FILES_BLOCK)
1475  {
1476  lt2_files = lt2;
1477  break;
1478  }
1479  lt2 = codeview_linetab2_next_block(lt2);
1480  }
1481  if (!lt2_files)
1482  {
1483  TRACE("No LT2_FILES_BLOCK found\n");
1484  return;
1485  }
1486 
1487  lt2 = (const struct codeview_linetab2*)linetab;
1488  while ((const BYTE*)(lt2 + 1) < linetab + size)
1489  {
1490  /* FIXME: should also check that whole lines_blk fits in linetab + size */
1491  switch (lt2->header)
1492  {
1493  case LT2_LINES_BLOCK:
1494  /* Skip blocks that are too small - Intel C Compiler generates these. */
1495  if (lt2->size_of_block < sizeof (struct codeview_lt2blk_lines)) break;
1496  lines_blk = (const struct codeview_lt2blk_lines*)lt2;
1497  /* FIXME: should check that file_offset is within the LT2_FILES_BLOCK we've seen */
1498  addr = codeview_get_address(msc_dbg, lines_blk->seg, lines_blk->start);
1499  TRACE("block from %04x:%08x #%x (%x lines)\n",
1500  lines_blk->seg, lines_blk->start, lines_blk->size, lines_blk->nlines);
1501  fd = (const struct codeview_linetab2_file*)((const char*)lt2_files + 8 + lines_blk->file_offset);
1502  /* FIXME: should check that string is within strimage + strsize */
1503  source = source_new(msc_dbg->module, NULL, strimage + fd->offset);
1504  func = (struct symt_function*)symt_find_nearest(msc_dbg->module, addr);
1505  /* FIXME: at least labels support line numbers */
1506  if (!func || func->symt.tag != SymTagFunction)
1507  {
1508  WARN("--not a func at %04x:%08x %lx tag=%d\n",
1509  lines_blk->seg, lines_blk->start, addr, func ? func->symt.tag : -1);
1510  break;
1511  }
1512  for (i = 0; i < lines_blk->nlines; i++)
1513  {
1514  symt_add_func_line(msc_dbg->module, func, source,
1515  lines_blk->l[i].lineno ^ 0x80000000,
1516  lines_blk->l[i].offset);
1517  }
1518  break;
1519  case LT2_FILES_BLOCK: /* skip */
1520  break;
1521  default:
1522  TRACE("Block end %x\n", lt2->header);
1523  lt2 = (const struct codeview_linetab2*)((const char*)linetab + size);
1524  continue;
1525  }
1526  lt2 = codeview_linetab2_next_block(lt2);
1527  }
1528 }
GLenum func
Definition: glext.h:6028
DWORD size_of_block
Definition: mscvpdb.h:1846
struct codeview_linetab2 lt2
Definition: mscvpdb.h:1870
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define WARN(fmt,...)
Definition: debug.h:112
static int fd
Definition: io.c:51
#define LT2_LINES_BLOCK
Definition: mscvpdb.h:1832
static const struct codeview_linetab2 * codeview_linetab2_next_block(const struct codeview_linetab2 *lt2)
Definition: mscvpdb.h:1849
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define LT2_FILES_BLOCK
Definition: mscvpdb.h:1833
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static ULONG_PTR codeview_get_address(const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
Definition: msc.c:1551
GLenum const GLvoid * addr
Definition: glext.h:9621
struct codeview_lt2blk_lines::@3635 l[1]
uint32_t DWORD_PTR
Definition: typedefs.h:65
unsigned char BYTE
Definition: xxhash.c:193
struct module * module
Definition: mscvpdb.h:2134
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
void symt_add_func_line(struct module *module, struct symt_function *func, unsigned source_idx, int line_num, ULONG_PTR offset) DECLSPEC_HIDDEN
Definition: symbol.c:326
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
Definition: source.c:66
struct symt_ht * symt_find_nearest(struct module *module, DWORD_PTR addr) DECLSPEC_HIDDEN
Definition: symbol.c:903

Referenced by pdb_process_internal().

◆ codeview_snarf_public()

static BOOL codeview_snarf_public ( const struct msc_debug_info msc_dbg,
const BYTE root,
int  offset,
int  size 
)
static

Definition at line 2047 of file msc.c.

2050 {
2051  int i, length;
2052  struct symt_compiland* compiland = NULL;
2053 
2054  /*
2055  * Loop over the different types of records and whenever we
2056  * find something we are interested in, record it and move on.
2057  */
2058  for (i = offset; i < size; i += length)
2059  {
2060  const union codeview_symbol* sym = (const union codeview_symbol*)(root + i);
2061  length = sym->generic.len + 2;
2062  if (i + length > size) break;
2063  if (!sym->generic.id || length < 4) break;
2064  if (length & 3) FIXME("unpadded len %u\n", length);
2065 
2066  switch (sym->generic.id)
2067  {
2068  case S_PUB_V1:
2070  {
2071  symt_new_public(msc_dbg->module, compiland,
2072  terminate_string(&sym->public_v1.p_name),
2073  sym->public_v1.symtype == SYMTYPE_FUNCTION,
2074  codeview_get_address(msc_dbg, sym->public_v1.segment, sym->public_v1.offset), 1);
2075  }
2076  break;
2077  case S_PUB_V2:
2079  {
2080  symt_new_public(msc_dbg->module, compiland,
2081  terminate_string(&sym->public_v2.p_name),
2082  sym->public_v2.symtype == SYMTYPE_FUNCTION,
2083  codeview_get_address(msc_dbg, sym->public_v2.segment, sym->public_v2.offset), 1);
2084  }
2085  break;
2086 
2087  case S_PUB_V3:
2089  {
2090  symt_new_public(msc_dbg->module, compiland,
2091  sym->public_v3.name,
2092  sym->public_v3.symtype == SYMTYPE_FUNCTION,
2093  codeview_get_address(msc_dbg, sym->public_v3.segment, sym->public_v3.offset), 1);
2094  }
2095  break;
2096  case S_PUB_FUNC1_V3:
2097  case S_PUB_FUNC2_V3: /* using a data_v3 isn't what we'd expect */
2098 #if 0
2099  /* FIXME: this is plain wrong (from a simple test) */
2101  {
2102  symt_new_public(msc_dbg->module, compiland,
2103  sym->data_v3.name,
2104  codeview_get_address(msc_dbg, sym->data_v3.segment, sym->data_v3.offset), 1);
2105  }
2106 #endif
2107  break;
2108  /*
2109  * Global and local data symbols. We don't associate these
2110  * with any given source file.
2111  */
2112  case S_GDATA_V1:
2113  case S_LDATA_V1:
2114  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->data_v1.p_name),
2115  sym->data_v1.segment, sym->data_v1.offset, sym->data_v1.symtype,
2116  sym->generic.id == S_LDATA_V1, FALSE, FALSE);
2117  break;
2118  case S_GDATA_V2:
2119  case S_LDATA_V2:
2120  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->data_v2.p_name),
2121  sym->data_v2.segment, sym->data_v2.offset, sym->data_v2.symtype,
2122  sym->generic.id == S_LDATA_V2, FALSE, FALSE);
2123  break;
2124  case S_GDATA_V3:
2125  case S_LDATA_V3:
2126  codeview_add_variable(msc_dbg, compiland, sym->data_v3.name,
2127  sym->data_v3.segment, sym->data_v3.offset, sym->data_v3.symtype,
2128  sym->generic.id == S_LDATA_V3, FALSE, FALSE);
2129  break;
2130 
2131  /* variables with thread storage */
2132  case S_GTHREAD_V1:
2133  case S_LTHREAD_V1:
2134  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->thread_v1.p_name),
2135  sym->thread_v1.segment, sym->thread_v1.offset, sym->thread_v1.symtype,
2136  sym->generic.id == S_LTHREAD_V1, TRUE, FALSE);
2137  break;
2138  case S_GTHREAD_V2:
2139  case S_LTHREAD_V2:
2140  codeview_add_variable(msc_dbg, compiland, terminate_string(&sym->thread_v2.p_name),
2141  sym->thread_v2.segment, sym->thread_v2.offset, sym->thread_v2.symtype,
2142  sym->generic.id == S_LTHREAD_V2, TRUE, FALSE);
2143  break;
2144  case S_GTHREAD_V3:
2145  case S_LTHREAD_V3:
2146  codeview_add_variable(msc_dbg, compiland, sym->thread_v3.name,
2147  sym->thread_v3.segment, sym->thread_v3.offset, sym->thread_v3.symtype,
2148  sym->generic.id == S_LTHREAD_V3, TRUE, FALSE);
2149  break;
2150 
2151  /*
2152  * These are special, in that they are always followed by an
2153  * additional length-prefixed string which is *not* included
2154  * into the symbol length count. We need to skip it.
2155  */
2156  case S_PROCREF_V1:
2157  case S_DATAREF_V1:
2158  case S_LPROCREF_V1:
2159  length += (((const char*)sym)[length] + 1 + 3) & ~3;
2160  break;
2161  }
2162  msc_dbg->module->sortlist_valid = TRUE;
2163  }
2164  msc_dbg->module->sortlist_valid = FALSE;
2165  return TRUE;
2166 }
#define S_LDATA_V3
Definition: mscvpdb.h:1726
#define S_PUB_FUNC2_V3
Definition: mscvpdb.h:1753
#define S_DATAREF_V1
Definition: mscvpdb.h:1693
#define TRUE
Definition: types.h:120
struct codeview_symbol::@3605 public_v2
#define S_GTHREAD_V1
Definition: mscvpdb.h:1690
GLintptr offset
Definition: glext.h:5920
#define S_LTHREAD_V3
Definition: mscvpdb.h:1732
struct codeview_symbol::@3629 thread_v2
struct codeview_symbol::@3630 thread_v3
static void codeview_add_variable(const struct msc_debug_info *msc_dbg, struct symt_compiland *compiland, const char *name, unsigned segment, unsigned offset, unsigned symtype, BOOL is_local, BOOL in_tls, BOOL force)
Definition: msc.c:1562
#define S_LDATA_V2
Definition: mscvpdb.h:1703
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FALSE
Definition: types.h:117
#define S_LTHREAD_V1
Definition: mscvpdb.h:1689
#define S_GDATA_V3
Definition: mscvpdb.h:1727
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define SYMTYPE_FUNCTION
Definition: mscvpdb.h:1235
#define S_GDATA_V1
Definition: mscvpdb.h:1678
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define S_PUB_V2
Definition: mscvpdb.h:1705
struct codeview_symbol::@3604 public_v1
#define S_LDATA_V1
Definition: mscvpdb.h:1677
#define S_PUB_FUNC1_V3
Definition: mscvpdb.h:1751
#define S_LTHREAD_V2
Definition: mscvpdb.h:1710
static ULONG_PTR codeview_get_address(const struct msc_debug_info *msc_dbg, unsigned seg, unsigned offset)
Definition: msc.c:1551
struct codeview_symbol::@3598 data_v3
struct symt_public * symt_new_public(struct module *module, struct symt_compiland *parent, const char *typename, BOOL is_function, ULONG_PTR address, unsigned size) DECLSPEC_HIDDEN
Definition: symbol.c:224
struct codeview_symbol::@3606 public_v3
struct codeview_symbol::@3595 generic
struct module * module
Definition: mscvpdb.h:2134
unsigned dbghelp_options
Definition: dbghelp.c:73
static const char * terminate_string(const struct p_string *p_name)
Definition: msc.c:503
#define S_LPROCREF_V1
Definition: mscvpdb.h:1695
#define S_PUB_V3
Definition: mscvpdb.h:1728
#define S_GDATA_V2
Definition: mscvpdb.h:1704
#define S_GTHREAD_V2
Definition: mscvpdb.h:1711
#define SYMOPT_NO_PUBLICS
Definition: compat.h:741
#define S_GTHREAD_V3
Definition: mscvpdb.h:1733
#define S_PROCREF_V1
Definition: mscvpdb.h:1692
struct codeview_symbol::@3597 data_v2
struct codeview_symbol::@3596 data_v1
#define S_PUB_V1
Definition: mscvpdb.h:1679
struct codeview_symbol::@3628 thread_v1

Referenced by pdb_process_internal().

◆ dump()

static void dump ( const void ptr,
unsigned  len 
)
static

Definition at line 95 of file msc.c.

96 {
97  unsigned int i, j;
98  char msg[128];
99  const char* hexof = "0123456789abcdef";
100  const BYTE* x = ptr;
101 
102  for (i = 0; i < len; i += 16)
103  {
104  sprintf(msg, "%08x: ", i);
105  memset(msg + 10, ' ', 3 * 16 + 1 + 16);
106  for (j = 0; j < min(16, len - i); j++)
107  {
108  msg[10 + 3 * j + 0] = hexof[x[i + j] >> 4];
109  msg[10 + 3 * j + 1] = hexof[x[i + j] & 15];
110  msg[10 + 3 * j + 2] = ' ';
111  msg[10 + 3 * 16 + 1 + j] = (x[i + j] >= 0x20 && x[i + j] < 0x7f) ?
112  x[i + j] : '.';
113  }
114  msg[10 + 3 * 16] = ' ';
115  msg[10 + 3 * 16 + 1 + 16] = '\0';
116  FIXME("%s\n", msg);
117  }
118 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define sprintf(buf, format,...)
Definition: sprintf.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: xxhash.c:193
#define min(a, b)
Definition: monoChain.cc:55
#define msg(x)
Definition: auth_time.c:54
#define memset(x, y, z)
Definition: compat.h:39

Referenced by codeview_parse_one_type(), codeview_snarf(), DumpCommand(), ok_sequence_(), pdb_init(), and xmlMemoryDump().

◆ leaf_as_variant()

static int leaf_as_variant ( VARIANT v,
const unsigned short int leaf 
)
static

Definition at line 259 of file msc.c.

260 {
261  unsigned short int type = *leaf++;
262  int length = 2;
263 
264  if (type < LF_NUMERIC)
265  {
266  v->n1.n2.vt = VT_UINT;
267  v->n1.n2.n3.uintVal = type;
268  }
269  else
270  {
271  switch (type)
272  {
273  case LF_CHAR:
274  length += 1;
275  v->n1.n2.vt = VT_I1;
276  v->n1.n2.n3.cVal = *(const char*)leaf;
277  break;
278 
279  case LF_SHORT:
280  length += 2;
281  v->n1.n2.vt = VT_I2;
282  v->n1.n2.n3.iVal = *(const short*)leaf;
283  break;
284 
285  case LF_USHORT:
286  length += 2;
287  v->n1.n2.vt = VT_UI2;
288  v->n1.n2.n3.uiVal = *leaf;
289  break;
290 
291  case LF_LONG:
292  length += 4;
293  v->n1.n2.vt = VT_I4;
294  v->n1.n2.n3.lVal = *(const int*)leaf;
295  break;
296 
297  case LF_ULONG:
298  length += 4;
299  v->n1.n2.vt = VT_UI4;
300  v->n1.n2.n3.uiVal = *(const unsigned int*)leaf;
301  break;
302 
303  case LF_QUADWORD:
304  length += 8;
305  v->n1.n2.vt = VT_I8;
306  v->n1.n2.n3.llVal = *(const long long int*)leaf;
307  break;
308 
309  case LF_UQUADWORD:
310  length += 8;
311  v->n1.n2.vt = VT_UI8;
312  v->n1.n2.n3.ullVal = *(const long long unsigned int*)leaf;
313  break;
314 
315  case LF_REAL32:
316  length += 4;
317  v->n1.n2.vt = VT_R4;
318  v->n1.n2.n3.fltVal = *(const float*)leaf;
319  break;
320 
321  case LF_REAL48:
322  FIXME("Unsupported numeric leaf type %04x\n", type);
323  length += 6;
324  v->n1.n2.vt = VT_EMPTY; /* FIXME */
325  break;
326 
327  case LF_REAL64:
328  length += 8;
329  v->n1.n2.vt = VT_R8;
330  v->n1.n2.n3.fltVal = *(const double*)leaf;
331  break;
332 
333  case LF_REAL80:
334  FIXME("Unsupported numeric leaf type %04x\n", type);
335  length += 10;
336  v->n1.n2.vt = VT_EMPTY; /* FIXME */
337  break;
338 
339  case LF_REAL128:
340  FIXME("Unsupported numeric leaf type %04x\n", type);
341  length += 16;
342  v->n1.n2.vt = VT_EMPTY; /* FIXME */
343  break;
344 
345  case LF_COMPLEX32:
346  FIXME("Unsupported numeric leaf type %04x\n", type);
347  length += 4;
348  v->n1.n2.vt = VT_EMPTY; /* FIXME */
349  break;
350 
351  case LF_COMPLEX64:
352  FIXME("Unsupported numeric leaf type %04x\n", type);
353  length += 8;
354  v->n1.n2.vt = VT_EMPTY; /* FIXME */
355  break;
356 
357  case LF_COMPLEX80:
358  FIXME("Unsupported numeric leaf type %04x\n", type);
359  length += 10;
360  v->n1.n2.vt = VT_EMPTY; /* FIXME */
361  break;
362 
363  case LF_COMPLEX128:
364  FIXME("Unsupported numeric leaf type %04x\n", type);
365  length += 16;
366  v->n1.n2.vt = VT_EMPTY; /* FIXME */
367  break;
368 
369  case LF_VARSTRING:
370  FIXME("Unsupported numeric leaf type %04x\n", type);
371  length += 2 + *leaf;
372  v->n1.n2.vt = VT_EMPTY; /* FIXME */
373  break;
374 
375  default:
376  FIXME("Unknown numeric leaf type %04x\n", type);
377  v->n1.n2.vt = VT_EMPTY; /* FIXME */
378  break;
379  }
380  }
381 
382  return length;
383 }
#define LF_COMPLEX32
Definition: mscvpdb.h:1226
#define LF_NUMERIC
Definition: mscvpdb.h:1213
Definition: compat.h:2046
Definition: compat.h:2062
Definition: compat.h:2058
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define LF_UQUADWORD
Definition: mscvpdb.h:1224
#define LF_COMPLEX64
Definition: mscvpdb.h:1227
#define LF_COMPLEX80
Definition: mscvpdb.h:1228
#define LF_QUADWORD
Definition: mscvpdb.h:1223
#define LF_REAL48
Definition: mscvpdb.h:1225
#define FIXME(fmt,...)
Definition: debug.h:111
#define LF_REAL32
Definition: mscvpdb.h:1219
#define LF_LONG
Definition: mscvpdb.h:1217
#define LF_COMPLEX128
Definition: mscvpdb.h:1229
#define LF_REAL128
Definition: mscvpdb.h:1222
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define LF_USHORT
Definition: mscvpdb.h:1216
#define LF_VARSTRING
Definition: mscvpdb.h:1230
Definition: compat.h:2047
const GLdouble * v
Definition: gl.h:2040
#define LF_REAL80
Definition: mscvpdb.h:1221
#define LF_CHAR
Definition: mscvpdb.h:1214
#define LF_REAL64
Definition: mscvpdb.h:1220
#define LF_SHORT
Definition: mscvpdb.h:1215
#define LF_ULONG
Definition: mscvpdb.h:1218
Definition: compat.h:2048
Definition: compat.h:2045

Referenced by codeview_snarf().

◆ map_pdb_file()

static HANDLE map_pdb_file ( const struct process pcs,
const struct pdb_lookup lookup,
struct module module 
)
static

Definition at line 2443 of file msc.c.

2446 {
2447  HANDLE hFile, hMap = NULL;
2448  WCHAR dbg_file_path[MAX_PATH];
2449  BOOL ret = FALSE;
2450 
2451  switch (lookup->kind)
2452  {
2453  case PDB_JG:
2454  ret = path_find_symbol_file(pcs, module, lookup->filename, DMT_PDB, NULL, lookup->timestamp,
2455  lookup->age, dbg_file_path, &module->module.PdbUnmatched);
2456  break;
2457  case PDB_DS:
2458  ret = path_find_symbol_file(pcs, module, lookup->filename, DMT_PDB, &lookup->guid, 0,
2459  lookup->age, dbg_file_path, &module->module.PdbUnmatched);
2460  break;
2461  }
2462  if (!ret)
2463  {
2464