42#ifndef DBGHELP_STATIC_LIB
51#ifndef DBGHELP_STATIC_LIB
57#ifndef DBGHELP_STATIC_LIB
58#define strtoull _strtoui64
107 else if (
source[1] ==
':' && (sz -= 2) > 0)
125 if (*
ptr ==
'.') *
ptr =
'\0';
138#define MAX_INCLUDES 5120
189 if (
idx < 0)
return -1;
268 TRACE(
"(%ld,%ld) => %p (%p)\n", filenr, subnr,
ret, *
ret);
319 ptd->errors[
ptd->err_idx].ptr =
ptd->ptr;
322#define PTS_ABORTIF(ptd, t) do { if (t) { stabs_pts_push((ptd), __LINE__); return -1;} } while (0)
324#define PTS_ABORTIF(ptd, t) do { if (t) return -1; } while (0)
368 const char*
typename,
struct symt** dt);
373 unsigned int template = 0;
376 while ((ch = *
ptd->ptr++) !=
'\0')
391 case '<':
template++;
break;
411 if (*
ptd->ptr ==
'(')
441 while (*
ptd->ptr ==
'0')
ptd->ptr++;
442 if (*
ptd->ptr >=
'1' && *
ptd->ptr <=
'7')
459 }
else prv->
sign = 0;
504 else if (lo.
sign < 0 && hi.
sign == 0)
509 else if (lo.
sign > 0 && hi.
sign == 0)
514 else if (lo.
sign < 0 && hi.
sign > 0)
517 for (
i = 7;
i < 64;
i += 8)
529 else if (lo.
sign == 0 && hi.
sign > 0)
539 for (
i = 8;
i <= 64;
i += 8)
568 if (*
ptd->ptr ==
';')
ptd->ptr++;
571 if (*
ptd->ptr ==
':')
591 }
while (*
ptd->ptr !=
';');
609 if (*
ptd->ptr ==
'!')
616 while (--num_classes >= 0)
629 strcpy(tmp,
"__inherited_class_");
651 while (*
ptd->ptr !=
';')
656 if (
ptd->ptr[0] ==
'$' &&
ptd->ptr[1] ==
'v')
660 if (
ptd->ptr[2] ==
'f')
673 else if (
ptd->ptr[2] ==
'b')
691 if (*
ptd->ptr ==
':')
701 if (*
ptd->ptr ==
'/')
ptd->ptr += 2;
729 if (*
ptd->ptr ==
'~')
745 while (*
ptd->ptr !=
';')
762 struct symt* range_dt;
763 struct symt* base_dt;
783 struct symt** ret_dt)
797 while (*
ptd->ptr ==
'=')
806 if (*++
ptd->ptr ==
's')
811 ERR(
"Not an attribute... NIY\n");
873 ERR(
"Forward declaration (%p/%s) is not an aggregate (%u)\n",
890 ERR(
"Forward declaration name mismatch %s <> %s\n",
926 if (*
ptd->ptr ==
'#')
941 while (*
ptd->ptr ==
',')
962 case 1: basic = 12;
break;
963 case 2: basic = 13;
break;
964 case 3: basic = 25;
break;
965 case 4: basic = 26;
break;
966 case 5: basic = 35;
break;
967 case 6: basic = 14;
break;
974 ERR(
"Unknown type '%c'\n",
ptd->ptr[-1]);
986 if (!new_dt &&
typename)
1001 const char*
typename)
1015 for (
ptd.ptr =
ptr - 1; ;)
1018 if (
ptd.ptr ==
NULL || *++
ptd.ptr !=
':')
break;
1022 if (*
ptd.ptr !=
'(')
ptd.ptr++;
1024 if (*
ptd.ptr !=
'(')
ptd.ptr++;
1028 if (
ret == -1 || *
ptd.ptr)
1035 for (
i = 0;
i <
ptd.err_idx;
i++)
1037 TRACE(
"[%d]: line %d => %s\n",
1055 const char*
c = stab - 1;
1067 }
while (*++
c ==
':');
1147 sizeof(pending->
objs[pending->
num].u.var.name),
name);
1149 pending->
objs[pending->
num].u.var.kind = dt;
1150 pending->
objs[pending->
num].u.var.loc = *loc;
1160 pending->
objs[pending->
num].u.line.source_idx = source_idx;
1161 pending->
objs[pending->
num].u.line.line_num = line_num;
1163 pending->
objs[pending->
num].u.line.load_offset = load_offset;
1172 for (
i = 0;
i < pending->
num;
i++)
1174 switch (pending->
objs[
i].tag)
1178 pending->
objs[
i].u.var.kind, &pending->
objs[
i].u.var.loc,
1183 pending->
objs[
i].u.line.offset -=
func->address - pending->
objs[
i].u.line.load_offset;
1185 pending->
objs[
i].u.line.line_num, pending->
objs[
i].u.line.offset);
1188 ERR(
"Unknown pending object tag %u\n", (
unsigned)pending->
objs[
i].tag);
1233 if(
str_len+buf_len >= *buf_size) {
1234 *buf_size += buf_len +
str_len;
1242 const char* pv_stab_ptr,
size_t nstab,
size_t stabsize,
1243 const char* strs,
int strtablen,
1249 char* srcpath =
NULL;
1253 unsigned int stabbufflen;
1255 const char* strs_end;
1260 int source_idx = -1;
1268 strs_end = strs + strtablen;
1271 memset(&pending_block, 0,
sizeof(pending_block));
1272 memset(&pending_func, 0,
sizeof(pending_func));
1278 stabbufflen = 65536;
1283 for (
i = 0;
i < nstab;
i++)
1285 stab_ptr = (
struct stab_nlist *)(pv_stab_ptr +
i * stabsize);
1290 WARN(
"Bad stabs string %p\n",
ptr);
1303 else if (stabbuff[0] !=
'\0')
1333 if (
ptr != stabbuff)
1363 loc.
offset = load_offset + n_value;
1373 loc.
offset = load_offset + n_value;
1392 if (curr_func !=
NULL)
1401 &loc,
NULL, param_type, symname);
1409 if (curr_func !=
NULL)
1460 NULL, param_type, symname);
1482 if (curr_func !=
NULL)
1491 n_value, load_offset);
1519 (load_offset + n_value - curr_func->
address) : 0);
1524 load_offset + n_value, 0,
1575 strtabinc = n_value;
1590 incl[++incl_stk] = source_idx;
1595 source_idx = incl[incl_stk--];
1621 BOOL is_global = is_public;
1635 is_public, is_global, stab_ptr->
n_other, compiland,
user);
1639 ERR(
"Unknown stab type 0x%02x\n",
type);
1643 TRACE(
"0x%02x %lx %s\n",
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void user(int argc, const char *argv[])
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
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
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
BOOL symt_get_info(struct module *module, const struct symt *type, IMAGEHLP_SYMBOL_TYPE_INFO req, void *pInfo) DECLSPEC_HIDDEN
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
struct symt_pointer * symt_new_pointer(struct module *module, struct symt *ref_type, ULONG_PTR size) DECLSPEC_HIDDEN
const char * symt_get_name(const struct symt *sym) DECLSPEC_HIDDEN
BOOL symt_add_enum_element(struct module *module, struct symt_enum *enum_type, const char *name, int value) DECLSPEC_HIDDEN
struct symt_udt * symt_new_udt(struct module *module, const char *typename, unsigned size, enum UdtKind kind) DECLSPEC_HIDDEN
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
struct symt_function_signature * symt_new_function_signature(struct module *module, struct symt *ret_type, enum CV_call_e call_conv) DECLSPEC_HIDDEN
struct symt_block * symt_close_func_block(struct module *module, const struct symt_function *func, struct symt_block *block, unsigned pc) DECLSPEC_HIDDEN
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
struct symt_enum * symt_new_enum(struct module *module, const char *typename, struct symt *basetype) DECLSPEC_HIDDEN
BOOL symt_set_udt_size(struct module *module, struct symt_udt *type, unsigned size) DECLSPEC_HIDDEN
struct symt_block * symt_open_func_block(struct module *module, struct symt_function *func, struct symt_block *block, unsigned pc, unsigned len) DECLSPEC_HIDDEN
void module_reset_debug_info(struct module *module) DECLSPEC_HIDDEN
struct symt_array * symt_new_array(struct module *module, int min, int max, struct symt *base, struct symt *index) DECLSPEC_HIDDEN
struct symt_compiland * symt_new_compiland(struct module *module, ULONG_PTR address, unsigned src_idx) DECLSPEC_HIDDEN
BOOL symt_fill_func_line_info(const struct module *module, const struct symt_function *func, DWORD64 addr, IMAGEHLP_LINE64 *line) DECLSPEC_HIDDEN
BOOL symt_add_function_signature_parameter(struct module *module, struct symt_function_signature *sig, struct symt *param) DECLSPEC_HIDDEN
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
void(* stabs_def_cb)(struct module *module, ULONG_PTR load_offset, const char *name, ULONG_PTR offset, BOOL is_public, BOOL is_global, unsigned char other, struct symt_compiland *compiland, void *user)
struct symt_basic * symt_new_basic(struct module *module, enum BasicType, const char *typename, unsigned size) DECLSPEC_HIDDEN
void symt_add_func_line(struct module *module, struct symt_function *func, unsigned source_idx, int line_num, ULONG_PTR offset) DECLSPEC_HIDDEN
BOOL symt_normalize_function(struct module *module, const struct symt_function *func) DECLSPEC_HIDDEN
BOOL symt_get_func_line_next(const struct module *module, PIMAGEHLP_LINE64 line) DECLSPEC_HIDDEN
#define HeapFree(x, y, z)
struct cpu * dbghelp_current_cpu
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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 * u
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define memcpy(s1, s2, n)
static IPrintDialogCallback callback
BOOL stabs_parse(struct module *module, ULONG_PTR load_offset, const char *pv_stab_ptr, size_t nstab, size_t stabsize, const char *strs, int strtablen, stabs_def_cb callback, void *user)
static void stab_strcpy(char *dest, int sz, const char *source)
static int stabs_find_include(const char *file, ULONG_PTR val)
static void stabs_pts_push(struct ParseTypedefData *ptd, unsigned line)
static void pending_flush(struct pending_list *pending, struct module *module, struct symt_function *func, struct symt_block *block)
static void stabs_finalize_function(struct module *module, struct symt_function *func, ULONG_PTR size)
#define PTS_ABORTIF(ptd, t)
static int stabs_pts_read_enum(struct ParseTypedefData *ptd, struct symt_enum *edt)
static int stabs_pts_read_type_reference(struct ParseTypedefData *ptd, LONG_PTR *filenr, LONG_PTR *subnr)
static void stabs_free_includes(void)
static int num_alloc_include_def
static void stabs_reset_includes(void)
static int stabs_add_include(int idx)
static include_def * include_defs
static int cu_include_stk_idx
static void pending_make_room(struct pending_list *pending)
static int stabs_parse_typedef(struct module *module, const char *ptr, const char *typename)
static int stabs_pts_read_range_value(struct ParseTypedefData *ptd, struct pts_range_value *prv)
static struct symt ** stabs_read_type_enum(const char **x)
static int stabs_pts_read_number(struct ParseTypedefData *ptd, LONG_PTR *v)
static struct symt ** stabs_find_ref(LONG_PTR filenr, LONG_PTR subnr)
static struct symt ** cu_vector
static void pending_add_var(struct pending_list *pending, const char *name, enum DataKind dt, const struct location *loc)
static int num_include_def
static struct symt * stabs_parse_type(const char *stab)
static int stabs_pts_read_method_info(struct ParseTypedefData *ptd)
static int stabs_get_basic(struct ParseTypedefData *ptd, unsigned basic, struct symt **symt)
static int stabs_new_include(const char *file, ULONG_PTR val)
static int cu_nrofentries
static int stabs_pts_read_aggregate(struct ParseTypedefData *ptd, struct symt_udt *sdt)
static struct symt_basic * stabs_basic[36]
static int stabs_pts_read_range(struct ParseTypedefData *ptd, const char *typename, struct symt **dt)
static int stabs_pts_read_type_def(struct ParseTypedefData *ptd, const char *typename, struct symt **dt)
static int cu_include_stack[MAX_INCLUDES]
static int stabs_pts_read_array(struct ParseTypedefData *ptd, struct symt **adt)
static void pending_add_line(struct pending_list *pending, int source_idx, int line_num, ULONG_PTR offset, ULONG_PTR load_offset)
static void stabbuf_append(char **buf, unsigned *buf_size, const char *str)
static int stabs_pts_read_id(struct ParseTypedefData *ptd)
struct ParseTypedefData::PTS_Error errors[16]
IMAGEHLP_MODULEW64 module
struct pending_object * objs
struct pending_loc_var var
enum pending_obj_kind tag
struct hash_table_elt hash_elt
struct hash_table_elt hash_elt
static unsigned int block