}
static BOOL i386_build_addr(HANDLE hThread, const CONTEXT* ctx, ADDRESS64* addr,
- unsigned seg, unsigned long offset)
+ unsigned seg, ULONG_PTR offset)
{
addr->Mode = AddrModeFlat;
addr->Segment = seg;
};
void sparse_array_init(struct sparse_array* sa, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN;
-void* sparse_array_find(const struct sparse_array* sa, unsigned long idx) DECLSPEC_HIDDEN;
-void* sparse_array_add(struct sparse_array* sa, unsigned long key, struct pool* pool) DECLSPEC_HIDDEN;
+void* sparse_array_find(const struct sparse_array* sa, ULONG_PTR idx) DECLSPEC_HIDDEN;
+void* sparse_array_add(struct sparse_array* sa, ULONG_PTR key, struct pool* pool) DECLSPEC_HIDDEN;
unsigned sparse_array_length(const struct sparse_array* sa) DECLSPEC_HIDDEN;
struct hash_table_elt
{
unsigned kind : 8,
reg;
-#ifndef __REACTOS__
- unsigned long offset;
-#else
- uintptr_t offset;
-#endif
+ ULONG_PTR offset;
};
struct symt
struct symt_block
{
struct symt symt;
- unsigned long address;
- unsigned long size;
+ ULONG_PTR address;
+ ULONG_PTR size;
struct symt* container; /* block, or func */
struct vector vchildren; /* sub-blocks & local variables */
};
struct symt_compiland
{
struct symt symt;
- unsigned long address;
+ ULONG_PTR address;
unsigned source;
struct vector vchildren; /* global variables & functions */
};
/* DataIs{Member} (all values are in bits, not bytes) */
struct
{
- long offset;
- unsigned long length;
+ LONG_PTR offset;
+ ULONG_PTR length;
} member;
/* DataIsConstant */
VARIANT value;
{
struct symt symt;
struct hash_table_elt hash_elt; /* if global symbol */
- unsigned long address;
+ ULONG_PTR address;
struct symt* container; /* compiland */
struct symt* type; /* points to function_signature */
- unsigned long size;
+ ULONG_PTR size;
struct vector vlines;
struct vector vchildren; /* locals, params, blocks, start/end, labels */
};
struct hash_table_elt hash_elt;
struct symt* container; /* compiland */
BOOL is_function;
- unsigned long address;
- unsigned long size;
+ ULONG_PTR address;
+ ULONG_PTR size;
};
struct symt_thunk
struct symt symt;
struct hash_table_elt hash_elt;
struct symt* container; /* compiland */
- unsigned long address;
- unsigned long size;
+ ULONG_PTR address;
+ ULONG_PTR size;
THUNK_ORDINAL ordinal; /* FIXME: doesn't seem to be accessible */
};
struct symt symt;
struct hash_table_elt hash_elt;
enum BasicType bt;
- unsigned long size;
+ ULONG_PTR size;
};
struct symt_enum
{
struct symt symt;
struct symt* pointsto;
- unsigned long size;
+ ULONG_PTR size;
};
struct symt_typedef
struct wine_rb_tree sources_offsets_tree;
};
-typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
+typedef BOOL (*enum_modules_cb)(const WCHAR*, ULONG_PTR addr, void* user);
struct loader_ops
{
DWORD64 reg_user;
struct module* lmodules;
- unsigned long dbg_hdr_addr;
+ ULONG_PTR dbg_hdr_addr;
IMAGEHLP_STACK_FRAME ctx_frame;
struct line_info
{
- unsigned long is_first : 1,
+ ULONG_PTR is_first : 1,
is_last : 1,
is_source_file : 1,
line_number;
union
{
- unsigned long pc_offset; /* if is_source_file isn't set */
+ ULONG_PTR pc_offset; /* if is_source_file isn't set */
unsigned source_file; /* if is_source_file is set */
} u;
};
/* elf_module.c */
extern BOOL elf_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN;
struct elf_thunk_area;
-extern int elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN;
+extern int elf_is_in_thunk_area(ULONG_PTR addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN;
/* macho_module.c */
extern BOOL macho_read_wine_loader_dbg_info(struct process* pcs, ULONG_PTR addr) DECLSPEC_HIDDEN;
module_new(struct process* pcs, const WCHAR* name,
enum module_type type, BOOL virtual,
DWORD64 addr, DWORD64 size,
- unsigned long stamp, unsigned long checksum) DECLSPEC_HIDDEN;
+ ULONG_PTR stamp, ULONG_PTR checksum) DECLSPEC_HIDDEN;
extern struct module*
module_get_containee(const struct process* pcs,
const struct module* inner) DECLSPEC_HIDDEN;
extern int source_rb_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN;
/* stabs.c */
-typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset,
- const char* name, unsigned long offset,
+typedef 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);
-extern BOOL stabs_parse(struct module* module, unsigned long load_offset,
+extern BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
const char* stabs, int stablen,
const char* strs, int strtablen,
stabs_def_cb callback, void* user) DECLSPEC_HIDDEN;
/* dwarf.c */
struct image_file_map;
-extern BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
+extern BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset,
const struct elf_thunk_area* thunks,
struct image_file_map* fmap) DECLSPEC_HIDDEN;
extern BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
extern struct symt_ht*
symt_find_nearest(struct module* module, DWORD_PTR addr) DECLSPEC_HIDDEN;
extern struct symt_compiland*
- symt_new_compiland(struct module* module, unsigned long address,
+ symt_new_compiland(struct module* module, ULONG_PTR address,
unsigned src_idx) DECLSPEC_HIDDEN;
extern struct symt_public*
symt_new_public(struct module* module,
struct symt_compiland* parent,
const char* typename,
BOOL is_function,
- unsigned long address,
+ ULONG_PTR address,
unsigned size) DECLSPEC_HIDDEN;
extern struct symt_data*
symt_new_global_variable(struct module* module,
struct symt_compiland* parent,
const char* name, unsigned is_static,
- struct location loc, unsigned long size,
+ struct location loc, ULONG_PTR size,
struct symt* type) DECLSPEC_HIDDEN;
extern struct symt_function*
symt_new_function(struct module* module,
struct symt_compiland* parent,
const char* name,
- unsigned long addr, unsigned long size,
+ ULONG_PTR addr, ULONG_PTR size,
struct symt* type) DECLSPEC_HIDDEN;
extern BOOL symt_normalize_function(struct module* module,
const struct symt_function* func) DECLSPEC_HIDDEN;
extern void symt_add_func_line(struct module* module,
struct symt_function* func,
unsigned source_idx, int line_num,
- unsigned long offset) DECLSPEC_HIDDEN;
+ ULONG_PTR offset) DECLSPEC_HIDDEN;
extern struct symt_data*
symt_add_func_local(struct module* module,
struct symt_function* func,
symt_new_thunk(struct module* module,
struct symt_compiland* parent,
const char* name, THUNK_ORDINAL ord,
- unsigned long addr, unsigned long size) DECLSPEC_HIDDEN;
+ ULONG_PTR addr, ULONG_PTR size) DECLSPEC_HIDDEN;
extern struct symt_data*
symt_new_constant(struct module* module,
struct symt_compiland* parent,
extern struct symt_hierarchy_point*
symt_new_label(struct module* module,
struct symt_compiland* compiland,
- const char* name, unsigned long address) DECLSPEC_HIDDEN;
+ const char* name, ULONG_PTR address) DECLSPEC_HIDDEN;
extern struct symt* symt_index2ptr(struct module* module, DWORD id) DECLSPEC_HIDDEN;
extern DWORD symt_ptr2index(struct module* module, const struct symt* sym) DECLSPEC_HIDDEN;
extern struct symt_pointer*
symt_new_pointer(struct module* module,
struct symt* ref_type,
- unsigned long size) DECLSPEC_HIDDEN;
+ ULONG_PTR size) DECLSPEC_HIDDEN;
extern struct symt_typedef*
symt_new_typedef(struct module* module, struct symt* ref,
const char* name) DECLSPEC_HIDDEN;
typedef struct dwarf2_abbrev_entry_attr_s
{
- unsigned long attribute;
- unsigned long form;
+ ULONG_PTR attribute;
+ ULONG_PTR form;
struct dwarf2_abbrev_entry_attr_s* next;
} dwarf2_abbrev_entry_attr_t;
typedef struct dwarf2_abbrev_entry_s
{
- unsigned long entry_code;
- unsigned long tag;
+ ULONG_PTR entry_code;
+ ULONG_PTR tag;
unsigned char have_child;
unsigned num_attr;
dwarf2_abbrev_entry_attr_t* attrs;
struct attribute
{
- unsigned long form;
+ ULONG_PTR form;
enum {attr_direct, attr_abstract_origin, attr_specification} gotten_from;
union
{
- unsigned long uvalue;
+ ULONG_PTR uvalue;
ULONGLONG lluvalue;
- long svalue;
+ LONG_PTR svalue;
const char* string;
struct dwarf2_block block;
} u;
const struct elf_thunk_area*thunks;
struct sparse_array abbrev_table;
struct sparse_array debug_info_table;
- unsigned long load_offset;
- unsigned long ref_offset;
+ ULONG_PTR load_offset;
+ ULONG_PTR ref_offset;
struct symt* symt_cache[sc_num]; /* void, int1, int2, int4 */
char* cpp_name;
} dwarf2_parse_context_t;
return uvalue;
}
-static unsigned long dwarf2_get_u4(const unsigned char* ptr)
+static ULONG_PTR dwarf2_get_u4(const unsigned char* ptr)
{
return *(const UINT32*)ptr;
}
-static unsigned long dwarf2_parse_u4(dwarf2_traverse_context_t* ctx)
+static ULONG_PTR dwarf2_parse_u4(dwarf2_traverse_context_t* ctx)
{
- unsigned long uvalue = dwarf2_get_u4(ctx->data);
+ ULONG_PTR uvalue = dwarf2_get_u4(ctx->data);
ctx->data += 4;
return uvalue;
}
return uvalue;
}
-static unsigned long dwarf2_get_leb128_as_unsigned(const unsigned char* ptr, const unsigned char** end)
+static ULONG_PTR dwarf2_get_leb128_as_unsigned(const unsigned char* ptr, const unsigned char** end)
{
- unsigned long ret = 0;
+ ULONG_PTR ret = 0;
unsigned char byte;
unsigned shift = 0;
return ret;
}
-static unsigned long dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx)
+static ULONG_PTR dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t* ctx)
{
- unsigned long ret;
+ ULONG_PTR ret;
assert(ctx);
return ret;
}
-static long dwarf2_get_leb128_as_signed(const unsigned char* ptr, const unsigned char** end)
+static LONG_PTR dwarf2_get_leb128_as_signed(const unsigned char* ptr, const unsigned char** end)
{
- long ret = 0;
+ LONG_PTR ret = 0;
unsigned char byte;
unsigned shift = 0;
const unsigned size = sizeof(int) * 8;
return ret;
}
-static long dwarf2_leb128_as_signed(dwarf2_traverse_context_t* ctx)
+static LONG_PTR dwarf2_leb128_as_signed(dwarf2_traverse_context_t* ctx)
{
- long ret = 0;
+ LONG_PTR ret = 0;
assert(ctx);
* We assume that in all cases word size from Dwarf matches the size of
* addresses in platform where the exec is compiled.
*/
-static unsigned long dwarf2_get_addr(const unsigned char* ptr, unsigned word_size)
+static ULONG_PTR dwarf2_get_addr(const unsigned char* ptr, unsigned word_size)
{
- unsigned long ret;
+ ULONG_PTR ret;
switch (word_size)
{
return ret;
}
-static unsigned long dwarf2_parse_addr(dwarf2_traverse_context_t* ctx)
+static ULONG_PTR dwarf2_parse_addr(dwarf2_traverse_context_t* ctx)
{
- unsigned long ret = dwarf2_get_addr(ctx->data, ctx->word_size);
+ ULONG_PTR ret = dwarf2_get_addr(ctx->data, ctx->word_size);
ctx->data += ctx->word_size;
return ret;
}
static dwarf2_abbrev_entry_t*
dwarf2_abbrev_table_find_entry(const struct sparse_array* abbrev_table,
- unsigned long entry_code)
+ ULONG_PTR entry_code)
{
assert( NULL != abbrev_table );
return sparse_array_find(abbrev_table, entry_code);
struct sparse_array* abbrev_table,
struct pool* pool)
{
- unsigned long entry_code;
+ ULONG_PTR entry_code;
dwarf2_abbrev_entry_t* abbrev_entry;
dwarf2_abbrev_entry_attr_t* new = NULL;
dwarf2_abbrev_entry_attr_t* last = NULL;
- unsigned long attribute;
- unsigned long form;
+ ULONG_PTR attribute;
+ ULONG_PTR form;
assert( NULL != abbrev_ctx );
case DW_FORM_strp:
{
- unsigned long offset = dwarf2_get_u4(data);
+ ULONG_PTR offset = dwarf2_get_u4(data);
attr->u.string = (const char*)ctx->sections[section_string].address + offset;
}
TRACE("strp<%s>\n", debugstr_a(attr->u.string));
static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx,
const dwarf2_debug_info_t* di,
- unsigned long dw,
+ ULONG_PTR dw,
struct location* loc,
const struct location* frame)
{
sizeof(unsigned) + xloc.u.block.size);
*ptr = xloc.u.block.size;
memcpy(ptr + 1, xloc.u.block.ptr, xloc.u.block.size);
-#ifndef __REACTOS__
- loc->offset = (unsigned long)ptr;
-#else
- loc->offset = (uintptr_t)ptr;
-#endif
+ loc->offset = (ULONG_PTR)ptr;
compute_location(&lctx, loc, NULL, frame);
}
}
* in all cases, range is relative to beginning of compilation unit
*/
static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_info_t* di,
- unsigned long* plow, unsigned long* phigh)
+ ULONG_PTR* plow, ULONG_PTR* phigh)
{
struct attribute range;
if (dwarf2_find_attribute(ctx, di, DW_AT_ranges, &range))
{
dwarf2_traverse_context_t traverse;
- unsigned long low, high;
+ ULONG_PTR low, high;
traverse.data = ctx->sections[section_ranges].address + range.u.uvalue;
traverse.end_data = ctx->sections[section_ranges].address +
dwarf2_debug_info_t** pdi)
{
const dwarf2_abbrev_entry_t*abbrev;
- unsigned long entry_code;
- unsigned long offset;
+ ULONG_PTR entry_code;
+ ULONG_PTR offset;
dwarf2_debug_info_t* di;
dwarf2_debug_info_t* child;
dwarf2_debug_info_t** where;
{
DWORD64 size;
nbytes.u.uvalue = symt_get_info(ctx->module, elt_type, TI_GET_LENGTH, &size) ?
- (unsigned long)size : 0;
+ (ULONG_PTR)size : 0;
}
bit_offset.u.uvalue = nbytes.u.uvalue * 8 - bit_offset.u.uvalue - bit_size.u.uvalue;
}
dwarf2_debug_info_t* di)
{
struct symt_block* block;
- unsigned long low_pc, high_pc;
+ ULONG_PTR low_pc, high_pc;
struct vector* children;
dwarf2_debug_info_t*child;
unsigned int i;
dwarf2_debug_info_t* di)
{
struct symt_block* block;
- unsigned long low_pc, high_pc;
+ ULONG_PTR low_pc, high_pc;
struct vector* children;
dwarf2_debug_info_t*child;
unsigned int i;
dwarf2_debug_info_t* di)
{
struct attribute name;
- unsigned long low_pc, high_pc;
+ ULONG_PTR low_pc, high_pc;
struct attribute is_decl;
struct attribute inline_flags;
struct symt* ret_type;
}
}
-static void dwarf2_set_line_number(struct module* module, unsigned long address,
+static void dwarf2_set_line_number(struct module* module, ULONG_PTR address,
const struct vector* v, unsigned file, unsigned line)
{
struct symt_function* func;
static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
dwarf2_parse_context_t* ctx,
const char* compile_dir,
- unsigned long offset)
+ ULONG_PTR offset)
{
dwarf2_traverse_context_t traverse;
- unsigned long length;
+ ULONG_PTR length;
unsigned insn_size, default_stmt;
unsigned line_range, opcode_base;
int line_base;
while (traverse.data < traverse.end_data)
{
- unsigned long address = 0;
+ ULONG_PTR address = 0;
unsigned file = 1;
unsigned line = 1;
unsigned is_stmt = default_stmt;
struct module* module,
const struct elf_thunk_area* thunks,
dwarf2_traverse_context_t* mod_ctx,
- unsigned long load_offset)
+ ULONG_PTR load_offset)
{
dwarf2_parse_context_t ctx;
dwarf2_traverse_context_t abbrev_ctx;
dwarf2_debug_info_t* di;
dwarf2_traverse_context_t cu_ctx;
const unsigned char* comp_unit_start = mod_ctx->data;
- unsigned long cu_length;
+ ULONG_PTR cu_length;
unsigned short cu_version;
- unsigned long cu_abbrev_offset;
+ ULONG_PTR cu_abbrev_offset;
BOOL ret = FALSE;
cu_length = dwarf2_parse_u4(mod_ctx);
}
static BOOL dwarf2_lookup_loclist(const struct module_format* modfmt, const BYTE* start,
- unsigned long ip, dwarf2_traverse_context_t* lctx)
+ ULONG_PTR ip, dwarf2_traverse_context_t* lctx)
{
DWORD_PTR beg, end;
const BYTE* ptr = start;
return TRUE;
}
-static BOOL dwarf2_get_cie(unsigned long addr, struct module* module, DWORD_PTR delta,
+static BOOL dwarf2_get_cie(ULONG_PTR addr, struct module* module, DWORD_PTR delta,
dwarf2_traverse_context_t* fde_ctx, dwarf2_traverse_context_t* cie_ctx,
struct frame_info* info, BOOL in_eh_frame)
{
const unsigned char* cie_ptr;
const unsigned char* last_cie_ptr = (const unsigned char*)~0;
unsigned len, id;
- unsigned long start, range;
+ ULONG_PTR start, range;
unsigned cie_id;
const BYTE* start_data = fde_ctx->data;
HeapFree(GetProcessHeap(), 0, modfmt);
}
-BOOL dwarf2_parse(struct module* module, unsigned long load_offset,
+BOOL dwarf2_parse(struct module* module, ULONG_PTR load_offset,
const struct elf_thunk_area* thunks,
struct image_file_map* fmap)
{
{
const char* symname;
THUNK_ORDINAL ordinal;
- unsigned long rva_start;
- unsigned long rva_end;
+ ULONG_PTR rva_start;
+ ULONG_PTR rva_end;
};
struct elf_module_info
{
- unsigned long elf_addr;
+ ULONG_PTR elf_addr;
unsigned short elf_mark : 1,
elf_loader : 1;
struct image_file_map file_map;
return ReadFile(fmap->u.elf.handle, buf, len, &bytes_read, NULL);
case from_process:
return ReadProcessMemory(emfd->u.process.handle,
- (void*)((unsigned long)emfd->u.process.load_addr + (unsigned long)off),
+ (void*)((ULONG_PTR)emfd->u.process.load_addr + (ULONG_PTR)off),
buf, len, &dw) && dw == len;
default:
assert(0);
* Check whether an address lies within one of the thunk area we
* know of.
*/
-int elf_is_in_thunk_area(unsigned long addr,
+int elf_is_in_thunk_area(ULONG_PTR addr,
const struct elf_thunk_area* thunks)
{
unsigned i;
}
static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
- struct image_file_map* fmap, unsigned long load_offset,
- unsigned long dyn_addr, struct elf_info* elf_info)
+ struct image_file_map* fmap, ULONG_PTR load_offset,
+ ULONG_PTR dyn_addr, struct elf_info* elf_info)
{
BOOL ret = FALSE;
if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism))
{
char* ptr = (char*)(ULONG_PTR)fmap->u.elf.sect[ism.sidx].shdr.sh_addr;
- unsigned long len;
+ ULONG_PTR len;
if (load_offset) ptr += load_offset - fmap->u.elf.elf_start;
struct elf_module_info *elf_module_info;
struct module_format* modfmt;
struct image_section_map ism;
- unsigned long modbase = load_offset;
+ ULONG_PTR modbase = load_offset;
if (elf_find_section_type(fmap, ".dynamic", SHT_DYNAMIC, &ism))
{
- unsigned long rva_dyn = elf_get_map_rva(&ism);
+ ULONG_PTR rva_dyn = elf_get_map_rva(&ism);
TRACE("For module %s, got ELF (start=%lx dyn=%lx), link_map (start=%lx dyn=%lx)\n",
- debugstr_w(filename), (unsigned long)fmap->u.elf.elf_start, rva_dyn,
+ debugstr_w(filename), (ULONG_PTR)fmap->u.elf.elf_start, rva_dyn,
load_offset, dyn_addr);
if (dyn_addr && load_offset + rva_dyn != dyn_addr)
{
* 1 on success
*/
static BOOL elf_load_file(struct process* pcs, const WCHAR* filename,
- unsigned long load_offset, unsigned long dyn_addr,
+ ULONG_PTR load_offset, ULONG_PTR dyn_addr,
struct elf_info* elf_info)
{
BOOL ret = FALSE;
*
* locate some a value from the debuggee auxiliary vector
*/
-static BOOL elf_search_auxv(const struct process* pcs, unsigned type, unsigned long* val)
+static BOOL elf_search_auxv(const struct process* pcs, unsigned type, ULONG_PTR* val)
{
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME];
SYMBOL_INFO*si = (SYMBOL_INFO*)buffer;
* lookup a file in standard ELF locations, and if found, load it
*/
static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
- unsigned long load_offset, unsigned long dyn_addr,
+ ULONG_PTR load_offset, ULONG_PTR dyn_addr,
struct elf_info* elf_info)
{
BOOL ret = FALSE;
return ret;
}
-typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, unsigned long load_addr,
- unsigned long dyn_addr, BOOL is_system, void* user);
+typedef BOOL (*enum_elf_modules_cb)(const WCHAR*, ULONG_PTR load_addr,
+ ULONG_PTR dyn_addr, BOOL is_system, void* user);
/******************************************************************
* elf_enum_modules_internal
bufstr[sizeof(bufstr) - 1] = '\0';
MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW));
if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name);
- if (!cb(bufstrW, (unsigned long)lm.l_addr, (unsigned long)lm.l_ld, FALSE, user))
+ if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user))
break;
}
}
bufstr[sizeof(bufstr) - 1] = '\0';
MultiByteToWideChar(CP_UNIXCP, 0, bufstr, -1, bufstrW, ARRAY_SIZE(bufstrW));
if (main_name && !bufstrW[0]) strcpyW(bufstrW, main_name);
- if (!cb(bufstrW, (unsigned long)lm.l_addr, (unsigned long)lm.l_ld, FALSE, user))
+ if (!cb(bufstrW, (ULONG_PTR)lm.l_addr, (ULONG_PTR)lm.l_ld, FALSE, user))
break;
}
}
#ifdef AT_SYSINFO_EHDR
if (!lm_addr)
{
- unsigned long ehdr_addr;
+ ULONG_PTR ehdr_addr;
if (elf_search_auxv(pcs, AT_SYSINFO_EHDR, &ehdr_addr))
{
void* user;
};
-static BOOL elf_enum_modules_translate(const WCHAR* name, unsigned long load_addr,
- unsigned long dyn_addr, BOOL is_system, void* user)
+static BOOL elf_enum_modules_translate(const WCHAR* name, ULONG_PTR load_addr,
+ ULONG_PTR dyn_addr, BOOL is_system, void* user)
{
struct elf_enum_user* eeu = user;
return eeu->cb(name, load_addr, eeu->user);
* Callback for elf_load_module, used to walk the list of loaded
* modules.
*/
-static BOOL elf_load_cb(const WCHAR* name, unsigned long load_addr,
- unsigned long dyn_addr, BOOL is_system, void* user)
+static BOOL elf_load_cb(const WCHAR* name, ULONG_PTR load_addr,
+ ULONG_PTR dyn_addr, BOOL is_system, void* user)
{
struct elf_load* el = user;
BOOL ret = TRUE;
* Also, find module real name and load address from
* the real loaded modules list in pcs address space
*/
-static struct module* elf_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
+static struct module* elf_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr)
{
struct elf_load el;
return FALSE;
}
-int elf_is_in_thunk_area(unsigned long addr,
+int elf_is_in_thunk_area(ULONG_PTR addr,
const struct elf_thunk_area* thunks)
{
return -1;
struct image_section_map
{
struct image_file_map* fmap;
- long sidx;
+ LONG_PTR sidx;
};
BOOL image_check_alternate(struct image_file_map* fmap, const struct module* module) DECLSPEC_HIDDEN;
struct macho_module_info
{
struct image_file_map file_map;
- unsigned long load_addr;
+ ULONG_PTR load_addr;
unsigned short in_use : 1,
is_loader : 1;
};
* that encompasses it. For a fat binary, the architecture will
* itself be offset within the file, so take that into account.
*/
-static void macho_calc_range(const struct macho_file_map* fmap, unsigned long offset,
- unsigned long len, unsigned long* out_aligned_offset,
- unsigned long* out_aligned_end, unsigned long* out_misalign)
+static void macho_calc_range(const struct macho_file_map* fmap, ULONG_PTR offset,
+ ULONG_PTR len, ULONG_PTR* out_aligned_offset,
+ ULONG_PTR* out_aligned_end, ULONG_PTR* out_misalign)
{
- unsigned long pagemask;
- unsigned long file_offset, misalign;
+ ULONG_PTR pagemask;
+ ULONG_PTR file_offset, misalign;
pagemask = sysinfo.dwAllocationGranularity - 1;
file_offset = fmap->arch_offset + offset;
*
* Maps a range (offset, length in bytes) from a Mach-O file into memory
*/
-static const char* macho_map_range(const struct macho_file_map* fmap, unsigned long offset, unsigned long len,
+static const char* macho_map_range(const struct macho_file_map* fmap, ULONG_PTR offset, ULONG_PTR len,
const char** base)
{
- unsigned long misalign, aligned_offset, aligned_map_end;
+ ULONG_PTR misalign, aligned_offset, aligned_map_end;
const void* aligned_ptr;
HANDLE mapping;
* Unmaps a range (offset, length in bytes) of a Mach-O file from memory
*/
static void macho_unmap_range(const char** base, const void** mapped, const struct macho_file_map* fmap,
- unsigned long offset, unsigned long len)
+ ULONG_PTR offset, ULONG_PTR len)
{
TRACE("(%p, %p, %p/%p, 0x%08lx, 0x%08lx)\n", base, mapped, fmap, fmap->handle, offset, len);
if ((mapped && *mapped != IMAGE_NO_MAP) || (base && *base != IMAGE_NO_MAP))
{
- unsigned long misalign, aligned_offset, aligned_map_end;
+ ULONG_PTR misalign, aligned_offset, aligned_map_end;
void* aligned_ptr;
macho_calc_range(fmap, offset, len, &aligned_offset, &aligned_map_end, &misalign);
* the munmap doesn't fragment the mapping.
*/
static BOOL macho_map_ranges(const struct macho_file_map* fmap,
- unsigned long offset1, unsigned long len1,
- unsigned long offset2, unsigned long len2,
+ ULONG_PTR offset1, ULONG_PTR len1,
+ ULONG_PTR offset2, ULONG_PTR len2,
const void** mapped1, const void** mapped2)
{
- unsigned long aligned_offset1, aligned_map_end1;
- unsigned long aligned_offset2, aligned_map_end2;
+ ULONG_PTR aligned_offset1, aligned_map_end1;
+ ULONG_PTR aligned_offset2, aligned_map_end2;
TRACE("(%p/%p, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p, %p)\n", fmap, fmap->handle,
offset1, len1, offset2, len2, mapped1, mapped2);
* macho_map_ranges.
*/
static void macho_unmap_ranges(const struct macho_file_map* fmap,
- unsigned long offset1, unsigned long len1,
- unsigned long offset2, unsigned long len2,
+ ULONG_PTR offset1, ULONG_PTR len1,
+ ULONG_PTR offset2, ULONG_PTR len2,
const void** mapped1, const void** mapped2)
{
- unsigned long aligned_offset1, aligned_map_end1;
- unsigned long aligned_offset2, aligned_map_end2;
+ ULONG_PTR aligned_offset1, aligned_map_end1;
+ ULONG_PTR aligned_offset2, aligned_map_end2;
TRACE("(%p/%p, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx, %p/%p, %p/%p)\n", fmap, fmap->handle,
offset1, len1, offset2, len2, mapped1, *mapped1, mapped2, *mapped2);
struct section_info* info = user;
BOOL ignore;
int i;
- unsigned long tmp, page_mask = sysinfo.dwPageSize - 1;
+ ULONG_PTR tmp, page_mask = sysinfo.dwPageSize - 1;
uint64_t vmaddr, vmsize;
char segname[16];
uint32_t nsects;
}
TRACE("(%p/%p, %p, %p) before: 0x%08lx - 0x%08lx\n", fmap, fmap->handle, lc, user,
- (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size);
- TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (unsigned long)vmaddr,
- (unsigned long)(vmaddr + vmsize));
+ (ULONG_PTR)fmap->segs_start, (ULONG_PTR)fmap->segs_size);
+ TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (ULONG_PTR)vmaddr,
+ (ULONG_PTR)(vmaddr + vmsize));
/* Images in the dyld shared cache have their segments mapped non-contiguously.
We don't know how to properly locate any of the segments other than __TEXT,
tmp = (vmaddr + vmsize + page_mask) & ~page_mask;
if (fmap->segs_size < tmp) fmap->segs_size = tmp;
- TRACE("after: 0x%08lx - 0x%08lx\n", (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size);
+ TRACE("after: 0x%08lx - 0x%08lx\n", (ULONG_PTR)fmap->segs_start, (ULONG_PTR)fmap->segs_size);
}
for (i = 0; i < nsects; i++)
}
fmap->segs_size -= fmap->segs_start;
- TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (unsigned long)fmap->segs_start,
- (unsigned long)fmap->segs_size);
+ TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (ULONG_PTR)fmap->segs_start,
+ (ULONG_PTR)fmap->segs_size);
if (macho_enum_load_commands(ifm, LC_UUID, find_uuid, NULL) < 0)
goto done;
{
struct hash_table_elt ht_elt;
struct symt_compiland* compiland;
- unsigned long addr;
+ ULONG_PTR addr;
unsigned char is_code:1,
is_public:1,
is_global:1,
*
* Callback for stabs_parse. Collect symbol definitions.
*/
-static void macho_stabs_def_cb(struct module* module, unsigned long load_offset,
- const char* name, unsigned long offset,
+static void macho_stabs_def_cb(struct module* module, ULONG_PTR load_offset,
+ const char* name, ULONG_PTR offset,
BOOL is_public, BOOL is_global, unsigned char sectidx,
struct symt_compiland* compiland, void* user)
{
* The image header has to be loaded from the process's memory
* because the relevant flag is only set in memory, not in the file.
*/
-static BOOL image_uses_split_segs(struct process* process, unsigned long load_addr)
+static BOOL image_uses_split_segs(struct process* process, ULONG_PTR load_addr)
{
BOOL split_segs = FALSE;
* TRUE on success
*/
static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
- unsigned long load_addr, struct macho_info* macho_info)
+ ULONG_PTR load_addr, struct macho_info* macho_info)
{
BOOL ret = TRUE;
BOOL split_segs;
* Lookup a file in standard Mach-O locations, and if found, load it
*/
static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filename,
- unsigned long load_addr,
+ ULONG_PTR load_addr,
struct macho_info* macho_info)
{
BOOL ret = FALSE;
{
union wine_all_image_infos image_infos;
union wine_image_info* info_array = NULL;
- unsigned long len;
+ ULONG_PTR len;
int i;
char bufstr[256];
WCHAR bufstrW[MAX_PATH];
struct macho_info macho_info;
};
-static BOOL macho_enum_sync_cb(const WCHAR* name, unsigned long addr, void* user)
+static BOOL macho_enum_sync_cb(const WCHAR* name, ULONG_PTR addr, void* user)
{
struct macho_sync* ms = user;
* Callback for macho_load_module, used to walk the list of loaded
* modules.
*/
-static BOOL macho_load_cb(const WCHAR* name, unsigned long addr, void* user)
+static BOOL macho_load_cb(const WCHAR* name, ULONG_PTR addr, void* user)
{
struct macho_load* ml = user;
const WCHAR* p;
* Also, find module real name and load address from
* the real loaded modules list in pcs address space.
*/
-static struct module* macho_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
+static struct module* macho_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr)
{
struct macho_load ml;
*
* Callback for accumulating in dump_context an host modules set
*/
-static BOOL fetch_host_module_info_cb(const WCHAR* name, unsigned long base,
+static BOOL fetch_host_module_info_cb(const WCHAR* name, ULONG_PTR base,
void* user)
{
struct dump_context* dc = user;
struct module* module_new(struct process* pcs, const WCHAR* name,
enum module_type type, BOOL virtual,
DWORD64 mod_addr, DWORD64 size,
- unsigned long stamp, unsigned long checksum)
+ ULONG_PTR stamp, ULONG_PTR checksum)
{
struct module* module;
unsigned i;
return FALSE;
}
-static struct module* native_load_module(struct process* pcs, const WCHAR* name, unsigned long addr)
+static struct module* native_load_module(struct process* pcs, const WCHAR* name, ULONG_PTR addr)
{
return NULL;
}
/*========================================================================
* Process CodeView line number information.
*/
-static unsigned long codeview_get_address(const struct msc_debug_info* msc_dbg,
+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,
const unsigned short* linenos;
const struct startend* start;
unsigned source;
- unsigned long addr, func_addr0;
+ ULONG_PTR addr, func_addr0;
struct symt_function* func;
const struct codeview_linetab_block* ltb;
return 0;
}
-static unsigned long codeview_get_address(const struct msc_debug_info* msc_dbg,
+static ULONG_PTR codeview_get_address(const struct msc_debug_info* msc_dbg,
unsigned seg, unsigned offset)
{
int nsect = msc_dbg->nsect;
typedef struct
{
char* name;
- unsigned long value;
+ ULONG_PTR value;
struct symt** vector;
int nrofentries;
} include_def;
static int cu_nrofentries = 0;
static struct symt_basic* stabs_basic[36];
-static int stabs_new_include(const char* file, unsigned long val)
+static int stabs_new_include(const char* file, ULONG_PTR val)
{
if (num_include_def == num_alloc_include_def)
{
return num_include_def++;
}
-static int stabs_find_include(const char* file, unsigned long val)
+static int stabs_find_include(const char* file, ULONG_PTR val)
{
int i;
cu_nrofentries = 0;
}
-static struct symt** stabs_find_ref(long filenr, long subnr)
+static struct symt** stabs_find_ref(LONG_PTR filenr, LONG_PTR subnr)
{
struct symt** ret;
static struct symt** stabs_read_type_enum(const char** x)
{
- long filenr, subnr;
+ LONG_PTR filenr, subnr;
const char* iter;
char* end;
return -1;
}
-static int stabs_pts_read_number(struct ParseTypedefData* ptd, long* v)
+static int stabs_pts_read_number(struct ParseTypedefData* ptd, LONG_PTR* v)
{
char* last;
}
static int stabs_pts_read_type_reference(struct ParseTypedefData* ptd,
- long* filenr, long* subnr)
+ LONG_PTR* filenr, LONG_PTR* subnr)
{
if (*ptd->ptr == '(')
{
ptd->ptr++;
if (mthd == '*')
{
- long int ofs;
+ LONG_PTR ofs;
PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &ofs) == -1);
PTS_ABORTIF(ptd, *ptd->ptr++ != ';');
static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd,
struct symt_udt* sdt)
{
- long sz, ofs;
+ LONG_PTR sz, ofs;
struct symt* adt;
struct symt* dt = NULL;
int idx;
doadd = symt_set_udt_size(ptd->module, sdt, sz);
if (*ptd->ptr == '!') /* C++ inheritance */
{
- long num_classes;
+ LONG_PTR num_classes;
ptd->ptr++;
PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &num_classes) == -1);
if (ptd->ptr[0] == '$' && ptd->ptr[1] == 'v')
{
- long x;
+ LONG_PTR x;
if (ptd->ptr[2] == 'f')
{
static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd,
struct symt_enum* edt)
{
- long value;
+ LONG_PTR value;
int idx;
while (*ptd->ptr != ';')
static inline int stabs_pts_read_array(struct ParseTypedefData* ptd,
struct symt** adt)
{
- long lo, hi;
+ LONG_PTR lo, hi;
struct symt* range_dt;
struct symt* base_dt;
struct symt** ret_dt)
{
int idx;
- long sz = -1;
+ LONG_PTR sz = -1;
struct symt* new_dt = NULL; /* newly created data type */
struct symt* ref_dt; /* referenced data type (pointer...) */
- long filenr1, subnr1, tmp;
+ LONG_PTR filenr1, subnr1, tmp;
/* things are a bit complicated because of the way the typedefs are stored inside
* the file, because addresses can change when realloc is done, so we must call
break;
case 'R':
{
- long type, len, unk;
- int basic;
+ LONG_PTR type, len, unk;
+ int basic;
PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &type) == -1);
PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); /* ';' */
{
int source_idx;
int line_num;
- unsigned long offset;
- unsigned long load_offset;
+ ULONG_PTR offset;
+ ULONG_PTR load_offset;
};
struct pending_object
}
static inline void pending_add_line(struct pending_list* pending, int source_idx,
- int line_num, unsigned long offset,
- unsigned long load_offset)
+ int line_num, ULONG_PTR offset,
+ ULONG_PTR load_offset)
{
pending_make_room(pending);
pending->objs[pending->num].tag = PENDING_LINE;
* function (assuming that current function ends where next function starts)
*/
static void stabs_finalize_function(struct module* module, struct symt_function* func,
- unsigned long size)
+ ULONG_PTR size)
{
IMAGEHLP_LINE64 il;
struct location loc;
strcpy(*buf+buf_len, str);
}
-BOOL stabs_parse(struct module* module, unsigned long load_offset,
+BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
const char* pv_stab_ptr, int stablen,
const char* strs, int strtablen,
stabs_def_cb callback, void* user)
case 35:
case 36: loc.reg = CV_REG_MM0 + n_value - 29; break;
default:
- FIXME("Unknown register value (%lu)\n", (unsigned long)n_value);
+ FIXME("Unknown register value (%lu)\n", (ULONG_PTR)n_value);
loc.reg = CV_REG_NONE;
break;
}
assert(source_idx >= 0);
if (curr_func != NULL)
{
- unsigned long offset = n_value;
+ ULONG_PTR offset = n_value;
if (module->type == DMT_MACHO)
offset -= curr_func->address - load_offset;
symt_add_func_line(module, curr_func, source_idx,
case N_EXCL:
if (stabs_add_include(stabs_find_include(ptr, n_value)) < 0)
{
- ERR("Excluded header not found (%s,%ld)\n", ptr, (unsigned long)n_value);
+ ERR("Excluded header not found (%s,%ld)\n", ptr, (ULONG_PTR)n_value);
module_reset_debug_info(module);
ret = FALSE;
goto done;
}
stabbuff[0] = '\0';
TRACE("0x%02x %lx %s\n",
- stab_ptr->n_type, (unsigned long)n_value, debugstr_a(strs + stab_ptr->n_strx));
+ stab_ptr->n_type, (ULONG_PTR)n_value, debugstr_a(strs + stab_ptr->n_strx));
}
module->module.SymType = SymDia;
module->module.CVSig = 'S' | ('T' << 8) | ('A' << 16) | ('B' << 24);
*/
struct key2index
{
- unsigned long key;
+ ULONG_PTR key;
unsigned index;
};
* Returns the first index which key is >= at passed key
*/
static struct key2index* sparse_array_lookup(const struct sparse_array* sa,
- unsigned long key, unsigned* idx)
+ ULONG_PTR key, unsigned* idx)
{
struct key2index* pk2i;
unsigned low, high;
return pk2i;
}
-void* sparse_array_find(const struct sparse_array* sa, unsigned long key)
+void* sparse_array_find(const struct sparse_array* sa, ULONG_PTR key)
{
unsigned idx;
struct key2index* pk2i;
return NULL;
}
-void* sparse_array_add(struct sparse_array* sa, unsigned long key,
+void* sparse_array_add(struct sparse_array* sa, ULONG_PTR key,
struct pool* pool)
{
unsigned idx, i;
}
struct symt_compiland* symt_new_compiland(struct module* module,
- unsigned long address, unsigned src_idx)
+ ULONG_PTR address, unsigned src_idx)
{
struct symt_compiland* sym;
struct symt_compiland* compiland,
const char* name,
BOOL is_function,
- unsigned long address, unsigned size)
+ ULONG_PTR address, unsigned size)
{
struct symt_public* sym;
struct symt** p;
struct symt_data* symt_new_global_variable(struct module* module,
struct symt_compiland* compiland,
const char* name, unsigned is_static,
- struct location loc, unsigned long size,
+ struct location loc, ULONG_PTR size,
struct symt* type)
{
struct symt_data* sym;
struct symt_function* symt_new_function(struct module* module,
struct symt_compiland* compiland,
const char* name,
- unsigned long addr, unsigned long size,
+ ULONG_PTR addr, ULONG_PTR size,
struct symt* sig_type)
{
struct symt_function* sym;
}
void symt_add_func_line(struct module* module, struct symt_function* func,
- unsigned source_idx, int line_num, unsigned long offset)
+ unsigned source_idx, int line_num, ULONG_PTR offset)
{
struct line_info* dli;
BOOL last_matches = FALSE;
struct symt_thunk* symt_new_thunk(struct module* module,
struct symt_compiland* compiland,
const char* name, THUNK_ORDINAL ord,
- unsigned long addr, unsigned long size)
+ ULONG_PTR addr, ULONG_PTR size)
{
struct symt_thunk* sym;
struct symt_hierarchy_point* symt_new_label(struct module* module,
struct symt_compiland* compiland,
- const char* name, unsigned long address)
+ const char* name, ULONG_PTR address)
{
struct symt_hierarchy_point* sym;
switch (data->u.value.n1.n2.vt)
{
case VT_I4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.lVal; break;
- case VT_I2: sym_info->Value = (ULONG)(long)data->u.value.n1.n2.n3.iVal; break;
- case VT_I1: sym_info->Value = (ULONG)(long)data->u.value.n1.n2.n3.cVal; break;
+ case VT_I2: sym_info->Value = (ULONG)(LONG_PTR)data->u.value.n1.n2.n3.iVal; break;
+ case VT_I1: sym_info->Value = (ULONG)(LONG_PTR)data->u.value.n1.n2.n3.cVal; break;
case VT_UI4: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.ulVal; break;
case VT_UI2: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.uiVal; break;
case VT_UI1: sym_info->Value = (ULONG)data->u.value.n1.n2.n3.bVal; break;
return TRUE;
}
-struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, unsigned long size)
+struct symt_pointer* symt_new_pointer(struct module* module, struct symt* ref_type, ULONG_PTR size)
{
struct symt_pointer* sym;
include/dbghelp.h: sdk/include/psdk/dbghelp.h
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
tags:
- wine: 8d702a3aa54fc61bd146f584e66364a12a0ee3a0
+ wine: f803da493aeb4cf118fb9b076e8042c2535fbcdb