ReactOS  0.4.13-dev-73-gcfe54aa
dbghelp_private.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winver.h"
#include "dbghelp.h"
#include "objbase.h"
#include "oaidl.h"
#include "winnls.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "wine/rbtree.h"
#include "cvconst.h"
Include dependency graph for dbghelp_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pool
 
class  vector< _Tp, >
 
struct  sparse_array
 
struct  hash_table_elt
 
struct  hash_table_bucket
 
struct  hash_table
 
struct  hash_table_iter
 
struct  location
 
struct  symt
 
struct  symt_ht
 
struct  symt_block
 
struct  symt_compiland
 
struct  symt_data
 
struct  symt_function
 
struct  symt_hierarchy_point
 
struct  symt_public
 
struct  symt_thunk
 
struct  symt_array
 
struct  symt_basic
 
struct  symt_enum
 
struct  symt_function_signature
 
struct  symt_function_arg_type
 
struct  symt_pointer
 
struct  symt_typedef
 
struct  symt_udt
 
struct  module_format
 
struct  module
 
struct  process
 
struct  line_info
 
struct  module_pair
 
struct  pdb_lookup
 
struct  cpu_stack_walk
 
struct  dump_memory
 
struct  dump_module
 
struct  dump_thread
 
struct  dump_context
 
struct  cpu
 
struct  pdb_cmd_pair
 

Macros

#define SYMOPT_WINE_WITH_NATIVE_MODULES   0x40000000
 

Typedefs

typedef BOOL(* enum_modules_cb) (const WCHAR *, unsigned long addr, void *user)
 
typedef void(* stabs_def_cb) (struct module *module, unsigned long load_offset, const char *name, unsigned long offset, BOOL is_public, BOOL is_global, unsigned char other, struct symt_compiland *compiland, void *user)
 

Enumerations

enum  location_kind {
  loc_error, loc_unavailable, loc_absolute, loc_register,
  loc_regrel, loc_tlsrel, loc_user
}
 
enum  location_error {
  loc_err_internal = -1, loc_err_too_complex = -2, loc_err_out_of_scope = -3, loc_err_cant_read = -4,
  loc_err_no_location = -5
}
 
enum  module_type {
  DMT_UNKNOWN, DMT_ELF, DMT_PE, DMT_MACHO,
  DMT_PDB, DMT_DBG
}
 
enum  format_info {
  DFI_ELF, DFI_PE, DFI_MACHO, DFI_DWARF,
  DFI_PDB, DFI_LAST
}
 
enum  pdb_kind { PDB_JG, PDB_DS }
 
enum  cpu_addr { cpu_addr_pc, cpu_addr_stack, cpu_addr_frame }
 

Functions

void pool_init (struct pool *a, size_t arena_size) DECLSPEC_HIDDEN
 
void pool_destroy (struct pool *a) DECLSPEC_HIDDEN
 
voidpool_alloc (struct pool *a, size_t len) DECLSPEC_HIDDEN
 
charpool_strdup (struct pool *a, const char *str) DECLSPEC_HIDDEN
 
void vector_init (struct vector *v, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN
 
unsigned vector_length (const struct vector *v) DECLSPEC_HIDDEN
 
voidvector_at (const struct vector *v, unsigned pos) DECLSPEC_HIDDEN
 
voidvector_add (struct vector *v, struct pool *pool) DECLSPEC_HIDDEN
 
void sparse_array_init (struct sparse_array *sa, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN
 
voidsparse_array_find (const struct sparse_array *sa, unsigned long idx) DECLSPEC_HIDDEN
 
voidsparse_array_add (struct sparse_array *sa, unsigned long key, struct pool *pool) DECLSPEC_HIDDEN
 
unsigned sparse_array_length (const struct sparse_array *sa) DECLSPEC_HIDDEN
 
void hash_table_init (struct pool *pool, struct hash_table *ht, unsigned num_buckets) DECLSPEC_HIDDEN
 
void hash_table_destroy (struct hash_table *ht) DECLSPEC_HIDDEN
 
void hash_table_add (struct hash_table *ht, struct hash_table_elt *elt) DECLSPEC_HIDDEN
 
void hash_table_iter_init (const struct hash_table *ht, struct hash_table_iter *hti, const char *name) DECLSPEC_HIDDEN
 
voidhash_table_iter_up (struct hash_table_iter *hti) DECLSPEC_HIDDEN
 
struct processprocess_find_by_handle (HANDLE hProcess) DECLSPEC_HIDDEN
 
BOOL validate_addr64 (DWORD64 addr) DECLSPEC_HIDDEN
 
BOOL pcs_callback (const struct process *pcs, ULONG action, void *data) DECLSPEC_HIDDEN
 
voidfetch_buffer (struct process *pcs, unsigned size) DECLSPEC_HIDDEN
 
const charwine_dbgstr_addr (const ADDRESS64 *addr) DECLSPEC_HIDDEN
 
struct cpucpu_find (DWORD) DECLSPEC_HIDDEN
 
DWORD calc_crc32 (int fd) DECLSPEC_HIDDEN
 
BOOL elf_enum_modules (HANDLE hProc, enum_modules_cb, void *) DECLSPEC_HIDDEN
 
BOOL elf_fetch_file_info (const WCHAR *name, DWORD_PTR *base, DWORD *size, DWORD *checksum) DECLSPEC_HIDDEN
 
BOOL elf_load_debug_info (struct module *module) DECLSPEC_HIDDEN
 
struct moduleelf_load_module (struct process *pcs, const WCHAR *name, unsigned long) DECLSPEC_HIDDEN
 
BOOL elf_read_wine_loader_dbg_info (struct process *pcs) DECLSPEC_HIDDEN
 
BOOL elf_synchronize_module_list (struct process *pcs) DECLSPEC_HIDDEN
 
int elf_is_in_thunk_area (unsigned long addr, const struct elf_thunk_area *thunks) DECLSPEC_HIDDEN
 
BOOL macho_enum_modules (HANDLE hProc, enum_modules_cb, void *) DECLSPEC_HIDDEN
 
BOOL macho_fetch_file_info (HANDLE process, const WCHAR *name, unsigned long load_addr, DWORD_PTR *base, DWORD *size, DWORD *checksum) DECLSPEC_HIDDEN
 
BOOL macho_load_debug_info (struct module *module) DECLSPEC_HIDDEN
 
struct modulemacho_load_module (struct process *pcs, const WCHAR *name, unsigned long) DECLSPEC_HIDDEN
 
BOOL macho_read_wine_loader_dbg_info (struct process *pcs) DECLSPEC_HIDDEN
 
BOOL macho_synchronize_module_list (struct process *pcs) DECLSPEC_HIDDEN
 
void minidump_add_memory_block (struct dump_context *dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN
 
struct modulemodule_find_by_addr (const struct process *pcs, DWORD64 addr, enum module_type type) DECLSPEC_HIDDEN
 
struct modulemodule_find_by_nameW (const struct process *pcs, const WCHAR *name) DECLSPEC_HIDDEN
 
struct modulemodule_find_by_nameA (const struct process *pcs, const char *name) DECLSPEC_HIDDEN
 
struct modulemodule_is_already_loaded (const struct process *pcs, const WCHAR *imgname) DECLSPEC_HIDDEN
 
BOOL module_get_debug (struct module_pair *) DECLSPEC_HIDDEN
 
struct modulemodule_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
 
struct modulemodule_get_containee (const struct process *pcs, const struct module *inner) DECLSPEC_HIDDEN
 
enum module_type module_get_type_by_name (const WCHAR *name) DECLSPEC_HIDDEN
 
void module_reset_debug_info (struct module *module) DECLSPEC_HIDDEN
 
BOOL module_remove (struct process *pcs, struct module *module) DECLSPEC_HIDDEN
 
void module_set_module (struct module *module, const WCHAR *name) DECLSPEC_HIDDEN
 
const WCHARget_wine_loader_name (void) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
BOOL pdb_fetch_file_info (const struct pdb_lookup *pdb_lookup, unsigned *matched) DECLSPEC_HIDDEN
 
BOOL pdb_virtual_unwind (struct cpu_stack_walk *csw, DWORD_PTR ip, CONTEXT *context, struct pdb_cmd_pair *cpair) DECLSPEC_HIDDEN
 
BOOL path_find_symbol_file (const struct process *pcs, const struct module *module, PCSTR full_path, const GUID *guid, DWORD dw1, DWORD dw2, PSTR buffer, BOOL *is_unmatched) DECLSPEC_HIDDEN
 
BOOL pe_load_nt_header (HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS *nth) DECLSPEC_HIDDEN
 
struct modulepe_load_native_module (struct process *pcs, const WCHAR *name, HANDLE hFile, DWORD64 base, DWORD size) DECLSPEC_HIDDEN
 
struct modulepe_load_builtin_module (struct process *pcs, const WCHAR *name, DWORD64 base, DWORD64 size) DECLSPEC_HIDDEN
 
BOOL pe_load_debug_info (const struct process *pcs, struct module *module) DECLSPEC_HIDDEN
 
const charpe_map_directory (struct module *module, int dirno, DWORD *size) DECLSPEC_HIDDEN
 
unsigned source_new (struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
 
const charsource_get (const struct module *module, unsigned idx) DECLSPEC_HIDDEN
 
int source_rb_compare (const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN
 
BOOL stabs_parse (struct module *module, unsigned long load_offset, const void *stabs, int stablen, const char *strs, int strtablen, stabs_def_cb callback, void *user) DECLSPEC_HIDDEN
 
BOOL dwarf2_parse (struct module *module, unsigned long load_offset, const struct elf_thunk_area *thunks, struct image_file_map *fmap) DECLSPEC_HIDDEN
 
BOOL dwarf2_virtual_unwind (struct cpu_stack_walk *csw, DWORD_PTR ip, CONTEXT *context, ULONG_PTR *cfa) DECLSPEC_HIDDEN
 
BOOL rsym_parse (struct module *module, unsigned long load_offset, const void *rsym, int rsymlen) DECLSPEC_HIDDEN
 
BOOL sw_read_mem (struct cpu_stack_walk *csw, DWORD64 addr, void *ptr, DWORD sz) DECLSPEC_HIDDEN
 
DWORD64 sw_xlat_addr (struct cpu_stack_walk *csw, ADDRESS64 *addr) DECLSPEC_HIDDEN
 
voidsw_table_access (struct cpu_stack_walk *csw, DWORD64 addr) DECLSPEC_HIDDEN
 
DWORD64 sw_module_base (struct cpu_stack_walk *csw, DWORD64 addr) DECLSPEC_HIDDEN
 
const charsymt_get_name (const struct symt *sym) DECLSPEC_HIDDEN
 
WCHARsymt_get_nameW (const struct symt *sym) DECLSPEC_HIDDEN
 
BOOL symt_get_address (const struct symt *type, ULONG64 *addr) DECLSPEC_HIDDEN
 
int symt_cmp_addr (const void *p1, const void *p2) DECLSPEC_HIDDEN
 
void copy_symbolW (SYMBOL_INFOW *siw, const SYMBOL_INFO *si) DECLSPEC_HIDDEN
 
struct symt_htsymt_find_nearest (struct module *module, DWORD_PTR addr) DECLSPEC_HIDDEN
 
struct symt_compilandsymt_new_compiland (struct module *module, unsigned long address, unsigned src_idx) DECLSPEC_HIDDEN
 
struct symt_publicsymt_new_public (struct module *module, struct symt_compiland *parent, const char *typename, BOOL is_function, unsigned long address, unsigned size) DECLSPEC_HIDDEN
 
struct symt_datasymt_new_global_variable (struct module *module, struct symt_compiland *parent, const char *name, unsigned is_static, struct location loc, unsigned long size, struct symt *type) DECLSPEC_HIDDEN
 
struct symt_functionsymt_new_function (struct module *module, struct symt_compiland *parent, const char *name, unsigned long addr, unsigned long size, struct symt *type) DECLSPEC_HIDDEN
 
BOOL symt_normalize_function (struct module *module, const struct symt_function *func) DECLSPEC_HIDDEN
 
void symt_add_func_line (struct module *module, struct symt_function *func, unsigned source_idx, int line_num, unsigned long offset) DECLSPEC_HIDDEN
 
struct symt_datasymt_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_blocksymt_open_func_block (struct module *module, struct symt_function *func, struct symt_block *block, unsigned pc, unsigned len) DECLSPEC_HIDDEN
 
struct symt_blocksymt_close_func_block (struct module *module, const struct symt_function *func, struct symt_block *block, unsigned pc) DECLSPEC_HIDDEN
 
struct symt_hierarchy_pointsymt_add_function_point (struct module *module, struct symt_function *func, enum SymTagEnum point, const struct location *loc, const char *name) 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_get_func_line_next (const struct module *module, PIMAGEHLP_LINE64 line) DECLSPEC_HIDDEN
 
struct symt_thunksymt_new_thunk (struct module *module, struct symt_compiland *parent, const char *name, THUNK_ORDINAL ord, unsigned long addr, unsigned long size) DECLSPEC_HIDDEN
 
struct symt_datasymt_new_constant (struct module *module, struct symt_compiland *parent, const char *name, struct symt *type, const VARIANT *v) DECLSPEC_HIDDEN
 
struct symt_hierarchy_pointsymt_new_label (struct module *module, struct symt_compiland *compiland, const char *name, unsigned long address) DECLSPEC_HIDDEN
 
struct symtsymt_index2ptr (struct module *module, DWORD id) DECLSPEC_HIDDEN
 
DWORD symt_ptr2index (struct module *module, const struct symt *sym) DECLSPEC_HIDDEN
 
void symt_init_basic (struct module *module) DECLSPEC_HIDDEN
 
BOOL symt_get_info (struct module *module, const struct symt *type, IMAGEHLP_SYMBOL_TYPE_INFO req, void *pInfo) DECLSPEC_HIDDEN
 
struct symt_basicsymt_new_basic (struct module *module, enum BasicType, const char *typename, unsigned size) DECLSPEC_HIDDEN
 
struct symt_udtsymt_new_udt (struct module *module, const char *typename, unsigned size, enum UdtKind kind) DECLSPEC_HIDDEN
 
BOOL symt_set_udt_size (struct module *module, struct symt_udt *type, unsigned size) 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
 
struct symt_enumsymt_new_enum (struct module *module, const char *typename, struct symt *basetype) DECLSPEC_HIDDEN
 
BOOL symt_add_enum_element (struct module *module, struct symt_enum *enum_type, const char *name, int value) DECLSPEC_HIDDEN
 
struct symt_arraysymt_new_array (struct module *module, int min, int max, struct symt *base, struct symt *index) DECLSPEC_HIDDEN
 
struct symt_function_signaturesymt_new_function_signature (struct module *module, struct symt *ret_type, enum CV_call_e call_conv) DECLSPEC_HIDDEN
 
BOOL symt_add_function_signature_parameter (struct module *module, struct symt_function_signature *sig, struct symt *param) DECLSPEC_HIDDEN
 
struct symt_pointersymt_new_pointer (struct module *module, struct symt *ref_type, unsigned long size) DECLSPEC_HIDDEN
 
struct symt_typedefsymt_new_typedef (struct module *module, struct symt *ref, const char *name) DECLSPEC_HIDDEN
 

Variables

unsigned dbghelp_options DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ SYMOPT_WINE_WITH_NATIVE_MODULES

#define SYMOPT_WINE_WITH_NATIVE_MODULES   0x40000000

Definition at line 131 of file dbghelp_private.h.

Typedef Documentation

◆ enum_modules_cb

typedef BOOL(* enum_modules_cb) (const WCHAR *, unsigned long addr, void *user)

Definition at line 584 of file dbghelp_private.h.

◆ stabs_def_cb

typedef void(* stabs_def_cb) (struct module *module, unsigned long load_offset, const char *name, unsigned long offset, BOOL is_public, BOOL is_global, unsigned char other, struct symt_compiland *compiland, void *user)

Definition at line 681 of file dbghelp_private.h.

Enumeration Type Documentation

◆ cpu_addr

Enumerator
cpu_addr_pc 
cpu_addr_stack 
cpu_addr_frame 

Definition at line 542 of file dbghelp_private.h.

◆ format_info

Enumerator
DFI_ELF 
DFI_PE 
DFI_MACHO 
DFI_DWARF 
DFI_PDB 
DFI_LAST 

Definition at line 342 of file dbghelp_private.h.

◆ location_error

Enumerator
loc_err_internal 
loc_err_too_complex 
loc_err_out_of_scope 
loc_err_cant_read 
loc_err_no_location 

Definition at line 143 of file dbghelp_private.h.

143  {loc_err_internal = -1, /* internal while computing */
144  loc_err_too_complex = -2, /* couldn't compute location (even at runtime) */
145  loc_err_out_of_scope = -3, /* variable isn't available at current address */
146  loc_err_cant_read = -4, /* couldn't read memory at given address */
147  loc_err_no_location = -5, /* likely optimized away (by compiler) */
148 };

◆ location_kind

Enumerator
loc_error 
loc_unavailable 
loc_absolute 
loc_register 
loc_regrel 
loc_tlsrel 
loc_user 

Definition at line 133 of file dbghelp_private.h.

133  {loc_error, /* reg is the error code */
134  loc_unavailable, /* location is not available */
135  loc_absolute, /* offset is the location */
136  loc_register, /* reg is the location */
137  loc_regrel, /* [reg+offset] is the location */
138  loc_tlsrel, /* offset is the address of the TLS index */
139  loc_user, /* value is debug information dependent,
140  reg & offset can be used ad libidem */
141 };

◆ module_type

Enumerator
DMT_UNKNOWN 
DMT_ELF 
DMT_PE 
DMT_MACHO 
DMT_PDB 
DMT_DBG 

Definition at line 326 of file dbghelp_private.h.

327 {
328  DMT_UNKNOWN, /* for lookup, not actually used for a module */
329  DMT_ELF, /* a real ELF shared module */
330  DMT_PE, /* a native or builtin PE module */
331  DMT_MACHO, /* a real Mach-O shared module */
332  DMT_PDB, /* .PDB file */
333  DMT_DBG, /* .DBG file */
334 };

◆ pdb_kind

Enumerator
PDB_JG 
PDB_DS 

Definition at line 458 of file dbghelp_private.h.

Function Documentation

◆ calc_crc32()

DWORD calc_crc32 ( int  fd)

Definition at line 89 of file crc32.c.

90 {
91 #define UPDC32(octet,crc) (crc_32_tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))
92  static const DWORD crc_32_tab[] =
93  { /* CRC polynomial 0xedb88320 */
94  0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
95  0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
96  0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
97  0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
98  0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
99  0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
100  0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c,
101  0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
102  0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
103  0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
104  0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106,
105  0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
106  0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
107  0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
108  0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
109  0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
110  0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
111  0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
112  0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa,
113  0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
114  0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
115  0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
116  0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84,
117  0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
118  0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
119  0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
120  0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,
121  0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
122  0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
123  0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
124  0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28,
125  0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
126  0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
127  0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
128  0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
129  0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
130  0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
131  0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
132  0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc,
133  0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
134  0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
135  0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
136  0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
137  };
138  int i, r;
139  unsigned char buffer[8192];
140  DWORD crc = ~0;
141 
142  lseek(fd, 0, SEEK_SET);
143  while ((r = read(fd, buffer, sizeof(buffer))) > 0)
144  {
145  for (i = 0; i < r; i++) crc = UPDC32(buffer[i], crc);
146  }
147  return ~crc;
148 #undef UPDC32
149 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint buffer
Definition: glext.h:5915
static int fd
Definition: io.c:51
_Check_return_opt_ _CRTIMP long __cdecl lseek(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin)
#define UPDC32(octet, crc)
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 SEEK_SET
Definition: jmemansi.c:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const unsigned int crc_32_tab[]
Definition: mspatcha.c:272
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

◆ copy_symbolW()

void copy_symbolW ( SYMBOL_INFOW siw,
const SYMBOL_INFO si 
)

Definition at line 1037 of file symbol.c.

1038 {
1039  siw->SizeOfStruct = si->SizeOfStruct;
1040  siw->TypeIndex = si->TypeIndex;
1041  siw->Reserved[0] = si->Reserved[0];
1042  siw->Reserved[1] = si->Reserved[1];
1043  siw->Index = si->Index;
1044  siw->Size = si->Size;
1045  siw->ModBase = si->ModBase;
1046  siw->Flags = si->Flags;
1047  siw->Value = si->Value;
1048  siw->Address = si->Address;
1049  siw->Register = si->Register;
1050  siw->Scope = si->Scope;
1051  siw->Tag = si->Tag;
1052  siw->NameLen = si->NameLen;
1053  siw->MaxNameLen = si->MaxNameLen;
1054  MultiByteToWideChar(CP_ACP, 0, si->Name, -1, siw->Name, siw->MaxNameLen);
1055 }
ULONG Tag
Definition: compat.h:698
CHAR Name[1]
Definition: compat.h:701
ULONG NameLen
Definition: compat.h:699
ULONG64 Address
Definition: compat.h:1007
ULONG MaxNameLen
Definition: compat.h:700
ULONG MaxNameLen
Definition: compat.h:1012
ULONG64 ModBase
Definition: compat.h:1004
#define CP_ACP
Definition: compat.h:99
ULONG Scope
Definition: compat.h:697
ULONG Flags
Definition: compat.h:693
ULONG TypeIndex
Definition: compat.h:688
ULONG64 Address
Definition: compat.h:695
ULONG NameLen
Definition: compat.h:1011
ULONG64 Reserved[2]
Definition: compat.h:689
ULONG64 Reserved[2]
Definition: compat.h:1001
ULONG SizeOfStruct
Definition: compat.h:999
ULONG Scope
Definition: compat.h:1009
ULONG64 ModBase
Definition: compat.h:692
ULONG Index
Definition: compat.h:690
ULONG64 Value
Definition: compat.h:1006
ULONG Index
Definition: compat.h:1002
ULONG Flags
Definition: compat.h:1005
ULONG SizeOfStruct
Definition: compat.h:687
ULONG Register
Definition: compat.h:696
ULONG TypeIndex
Definition: compat.h:1000
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR Name[1]
Definition: compat.h:1013
ULONG Register
Definition: compat.h:1008
ULONG64 Value
Definition: compat.h:694
ULONG Tag
Definition: compat.h:1010
ULONG Size
Definition: compat.h:691
ULONG Size
Definition: compat.h:1003

Referenced by enum_types_AtoW(), sym_enumW(), and SymFromAddrW().

◆ cpu_find()

struct cpu* cpu_find ( DWORD  )

Definition at line 166 of file dbghelp.c.

167 {
168  struct cpu** cpu;
169 
170  for (cpu = dbghelp_cpus ; *cpu; cpu++)
171  {
172  if (cpu[0]->machine == machine) return cpu[0];
173  }
174  return NULL;
175 }
static struct cpu * dbghelp_cpus[]
Definition: dbghelp.c:145
smooth NULL
Definition: ftsmooth.c:416
static const char machine[]
Definition: profile.c:104

Referenced by StackWalk(), and StackWalk64().

◆ dwarf2_parse()

BOOL dwarf2_parse ( struct module module,
unsigned long  load_offset,
const struct elf_thunk_area *  thunks,
struct image_file_map fmap 
)

Definition at line 3522 of file dwarf.c.

3525 {
3527  dwarf2_traverse_context_t mod_ctx;
3528  struct image_section_map debug_sect, debug_str_sect, debug_abbrev_sect,
3529  debug_line_sect, debug_ranges_sect, eh_frame_sect;
3530  BOOL ret = TRUE;
3531  struct module_format* dwarf2_modfmt;
3532 
3533  dwarf2_init_section(&eh_frame, fmap, ".eh_frame", NULL, &eh_frame_sect);
3534  dwarf2_init_section(&section[section_debug], fmap, ".debug_info", ".zdebug_info", &debug_sect);
3535  dwarf2_init_section(&section[section_abbrev], fmap, ".debug_abbrev", ".zdebug_abbrev", &debug_abbrev_sect);
3536  dwarf2_init_section(&section[section_string], fmap, ".debug_str", ".zdebug_str", &debug_str_sect);
3537  dwarf2_init_section(&section[section_line], fmap, ".debug_line", ".zdebug_line", &debug_line_sect);
3538  dwarf2_init_section(&section[section_ranges], fmap, ".debug_ranges", ".zdebug_ranges", &debug_ranges_sect);
3539 
3540  /* to do anything useful we need either .eh_frame or .debug_info */
3541  if ((!eh_frame.address || eh_frame.address == IMAGE_NO_MAP) &&
3542  (!section[section_debug].address || section[section_debug].address == IMAGE_NO_MAP))
3543  {
3544  ret = FALSE;
3545  goto leave;
3546  }
3547 
3548  if (fmap->modtype == DMT_ELF && debug_sect.fmap)
3549  {
3550  /* debug info might have a different base address than .so file
3551  * when elf file is prelinked after splitting off debug info
3552  * adjust symbol base addresses accordingly
3553  */
3554  load_offset += fmap->u.elf.elf_start - debug_sect.fmap->u.elf.elf_start;
3555  }
3556 
3557  TRACE("Loading Dwarf2 information for %s\n", debugstr_w(module->module.ModuleName));
3558 
3559  mod_ctx.data = section[section_debug].address;
3560  mod_ctx.end_data = mod_ctx.data + section[section_debug].size;
3561  mod_ctx.word_size = 0; /* will be correctly set later on */
3562 
3563  dwarf2_modfmt = HeapAlloc(GetProcessHeap(), 0,
3564  sizeof(*dwarf2_modfmt) + sizeof(*dwarf2_modfmt->u.dwarf2_info));
3565  if (!dwarf2_modfmt)
3566  {
3567  ret = FALSE;
3568  goto leave;
3569  }
3570  dwarf2_modfmt->module = module;
3571  dwarf2_modfmt->remove = dwarf2_module_remove;
3572  dwarf2_modfmt->loc_compute = dwarf2_location_compute;
3573  dwarf2_modfmt->u.dwarf2_info = (struct dwarf2_module_info_s*)(dwarf2_modfmt + 1);
3574  dwarf2_modfmt->u.dwarf2_info->word_size = 0; /* will be correctly set later on */
3575  dwarf2_modfmt->module->format_info[DFI_DWARF] = dwarf2_modfmt;
3576 
3577  /* As we'll need later some sections' content, we won't unmap these
3578  * sections upon existing this function
3579  */
3580  dwarf2_init_section(&dwarf2_modfmt->u.dwarf2_info->debug_loc, fmap, ".debug_loc", ".zdebug_loc", NULL);
3581  dwarf2_init_section(&dwarf2_modfmt->u.dwarf2_info->debug_frame, fmap, ".debug_frame", ".zdebug_frame", NULL);
3582  dwarf2_modfmt->u.dwarf2_info->eh_frame = eh_frame;
3583 
3584  while (mod_ctx.data < mod_ctx.end_data)
3585  {
3586  dwarf2_parse_compilation_unit(section, dwarf2_modfmt->module, thunks, &mod_ctx, load_offset);
3587  }
3588  dwarf2_modfmt->module->module.SymType = SymDia;
3589  dwarf2_modfmt->module->module.CVSig = 'D' | ('W' << 8) | ('A' << 16) | ('R' << 24);
3590  /* FIXME: we could have a finer grain here */
3591  dwarf2_modfmt->module->module.GlobalSymbols = TRUE;
3592  dwarf2_modfmt->module->module.TypeInfo = TRUE;
3593  dwarf2_modfmt->module->module.SourceIndexed = TRUE;
3594  dwarf2_modfmt->module->module.Publics = TRUE;
3595 
3596  /* set the word_size for eh_frame parsing */
3597  dwarf2_modfmt->u.dwarf2_info->word_size = fmap->addr_size / 8;
3598 
3599 leave:
3605 
3606  image_unmap_section(&debug_sect);
3607  image_unmap_section(&debug_abbrev_sect);
3608  image_unmap_section(&debug_str_sect);
3609  image_unmap_section(&debug_line_sect);
3610  image_unmap_section(&debug_ranges_sect);
3611  if (!ret) image_unmap_section(&eh_frame_sect);
3612 
3613  return ret;
3614 }
union image_file_map::@363 u
void(* remove)(struct process *pcs, struct module_format *modfmt)
unsigned addr_size
Definition: image_private.h:90
enum module_type modtype
Definition: image_private.h:89
const unsigned char * address
Definition: dwarf.c:173
#define TRUE
Definition: types.h:120
HMODULE module
Definition: main.cpp:47
static BOOL dwarf2_init_section(dwarf2_section_t *section, struct image_file_map *fmap, const char *sectname, const char *zsectname, struct image_section_map *ism)
Definition: dwarf.c:3476
Definition: compat.h:712
WCHAR ModuleName[32]
Definition: compat.h:725
const unsigned char * data
Definition: dwarf.c:182
const unsigned char * end_data
Definition: dwarf.c:183
Definition: parser.c:55
union module_format::@356 u
#define IMAGE_NO_MAP
Definition: image_private.h:59
struct image_file_map::@363::elf_file_map elf
static void dwarf2_module_remove(struct process *pcs, struct module_format *modfmt)
Definition: dwarf.c:3515
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void(* loc_compute)(struct process *pcs, const struct module_format *modfmt, const struct symt_function *func, struct location *loc)
static BOOL dwarf2_parse_compilation_unit(const dwarf2_section_t *sections, struct module *module, const struct elf_thunk_area *thunks, dwarf2_traverse_context_t *mod_ctx, unsigned long load_offset)
Definition: dwarf.c:2385
static void dwarf2_fini_section(dwarf2_section_t *section)
Definition: dwarf.c:3509
struct dwarf2_module_info_s * dwarf2_info
int ret
static void image_unmap_section(struct image_section_map *ism)
dwarf2_section_t eh_frame
Definition: dwarf.c:215
struct module * module
static void dwarf2_location_compute(struct process *pcs, const struct module_format *modfmt, const struct symt_function *func, struct location *loc)
Definition: dwarf.c:3330
unsigned char word_size
Definition: dwarf.c:184
IMAGEHLP_MODULEW64 module

Referenced by pe_load_dwarf().

◆ dwarf2_virtual_unwind()

BOOL dwarf2_virtual_unwind ( struct cpu_stack_walk csw,
DWORD_PTR  ip,
CONTEXT context,
ULONG_PTR cfa 
)

Definition at line 3265 of file dwarf.c.

3266 {
3267  struct module_pair pair;
3268  struct frame_info info;
3269  dwarf2_traverse_context_t cie_ctx, fde_ctx;
3270  struct module_format* modfmt;
3271  const unsigned char* end;
3272  DWORD_PTR delta;
3273 
3274  if (!(pair.pcs = process_find_by_handle(csw->hProcess)) ||
3275  !(pair.requested = module_find_by_addr(pair.pcs, ip, DMT_UNKNOWN)) ||
3277  return FALSE;
3278  modfmt = pair.effective->format_info[DFI_DWARF];
3279  if (!modfmt) return FALSE;
3280  memset(&info, 0, sizeof(info));
3281  fde_ctx.data = modfmt->u.dwarf2_info->eh_frame.address;
3282  fde_ctx.end_data = fde_ctx.data + modfmt->u.dwarf2_info->eh_frame.size;
3283  fde_ctx.word_size = modfmt->u.dwarf2_info->word_size;
3284  /* let offsets relative to the eh_frame sections be correctly computed, as we'll map
3285  * in this process the IMAGE section at a different address as the one expected by
3286  * the image
3287  */
3288  delta = pair.effective->module.BaseOfImage + modfmt->u.dwarf2_info->eh_frame.rva -
3289  (DWORD_PTR)modfmt->u.dwarf2_info->eh_frame.address;
3290  if (!dwarf2_get_cie(ip, pair.effective, delta, &fde_ctx, &cie_ctx, &info, TRUE))
3291  {
3292  fde_ctx.data = modfmt->u.dwarf2_info->debug_frame.address;
3293  fde_ctx.end_data = fde_ctx.data + modfmt->u.dwarf2_info->debug_frame.size;
3294  fde_ctx.word_size = modfmt->u.dwarf2_info->word_size;
3295  delta = pair.effective->reloc_delta;
3296  if (!dwarf2_get_cie(ip, pair.effective, delta, &fde_ctx, &cie_ctx, &info, FALSE))
3297  {
3298  TRACE("Couldn't find information for %lx\n", ip);
3299  return FALSE;
3300  }
3301  }
3302 
3303  TRACE("function %lx/%lx code_align %lu data_align %ld retaddr %s\n",
3304  ip, info.ip, info.code_align, info.data_align,
3305  dbghelp_current_cpu->fetch_regname(dbghelp_current_cpu->map_dwarf_register(info.retaddr_reg, TRUE)));
3306 
3307  /* if at very beginning of function, return and use default unwinder */
3308  if (ip == info.ip) return FALSE;
3309  execute_cfa_instructions(&cie_ctx, ip, &info);
3310 
3311  if (info.aug_z_format) /* get length of augmentation data */
3312  {
3314  end = fde_ctx.data + len;
3315  }
3316  else end = NULL;
3317  dwarf2_parse_augmentation_ptr(&fde_ctx, info.lsda_encoding); /* handler_data */
3318  if (end) fde_ctx.data = end;
3319 
3320  execute_cfa_instructions(&fde_ctx, ip, &info);
3321 
3322  /* if there is no information about retaddr, use default unwinder */
3323  if (info.state.rules[info.retaddr_reg] == RULE_UNSET) return FALSE;
3324 
3325  apply_frame_state(pair.effective, csw, context, &info.state, cfa);
3326 
3327  return TRUE;
3328 }
#define TRUE
Definition: types.h:120
struct process * process_find_by_handle(HANDLE hProcess)
Definition: dbghelp.c:80
#define DWORD_PTR
Definition: treelist.c:76
struct cpu * dbghelp_current_cpu
Definition: dbghelp.c:150
Definition: http.c:6587
static void apply_frame_state(const struct module *module, struct cpu_stack_walk *csw, CONTEXT *context, struct frame_state *state, ULONG_PTR *cfa)
Definition: dwarf.c:3208
static BOOL dwarf2_get_cie(unsigned long 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)
Definition: dwarf.c:2729
static unsigned long dwarf2_leb128_as_unsigned(dwarf2_traverse_context_t *ctx)
Definition: dwarf.c:290
GLuint GLuint end
Definition: gl.h:1545
union module_format::@356 u
static void execute_cfa_instructions(dwarf2_traverse_context_t *ctx, ULONG_PTR last_ip, struct frame_info *info)
Definition: dwarf.c:2806
static ULONG_PTR dwarf2_parse_augmentation_ptr(dwarf2_traverse_context_t *ctx, unsigned char encoding)
Definition: dwarf.c:2609
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL module_get_debug(struct module_pair *) DECLSPEC_HIDDEN
Definition: module.c:340
Definition: dhcpd.h:61
if(!(yy_init))
Definition: macro.lex.yy.c:714
struct dwarf2_module_info_s * dwarf2_info
struct module * module_find_by_addr(const struct process *pcs, DWORD64 addr, enum module_type type) DECLSPEC_HIDDEN
Definition: module.c:399
GLenum GLsizei len
Definition: glext.h:6722
uint32_t DWORD_PTR
Definition: typedefs.h:63
Definition: _pair.h:47
#define memset(x, y, z)
Definition: compat.h:39

◆ elf_enum_modules()

BOOL elf_enum_modules ( HANDLE  hProc,
enum_modules_cb  ,
void  
)

Definition at line 1825 of file elf_module.c.

1826 {
1827  return FALSE;
1828 }

Referenced by fetch_modules_info().

◆ elf_fetch_file_info()

BOOL elf_fetch_file_info ( const WCHAR name,
DWORD_PTR base,
DWORD size,
DWORD checksum 
)

Definition at line 1814 of file elf_module.c.

1816 {
1817  return FALSE;
1818 }

Referenced by fetch_elf_module_info_cb(), and module_find_cb().

◆ elf_is_in_thunk_area()

int elf_is_in_thunk_area ( unsigned long  addr,
const struct elf_thunk_area *  thunks 
)

Definition at line 1840 of file elf_module.c.

1842 {
1843  return -1;
1844 }

Referenced by dwarf2_parse_subprogram().

◆ elf_load_debug_info()

BOOL elf_load_debug_info ( struct module module)

Definition at line 1835 of file elf_module.c.

1836 {
1837  return FALSE;
1838 }

Referenced by module_get_debug().

◆ elf_load_module()

struct module* elf_load_module ( struct process pcs,
const WCHAR name,
unsigned long   
)

Definition at line 1830 of file elf_module.c.

1831 {
1832  return NULL;
1833 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by SymLoadModuleExW().

◆ elf_read_wine_loader_dbg_info()

BOOL elf_read_wine_loader_dbg_info ( struct process pcs)

Definition at line 1820 of file elf_module.c.

1821 {
1822  return FALSE;
1823 }

Referenced by check_live_target().

◆ elf_synchronize_module_list()

BOOL elf_synchronize_module_list ( struct process pcs)

Definition at line 1809 of file elf_module.c.

1810 {
1811  return FALSE;
1812 }

Referenced by refresh_module_list(), and SymInitializeW().

◆ fetch_buffer()

void* fetch_buffer ( struct process pcs,
unsigned  size 
)

Definition at line 109 of file dbghelp.c.

110 {
111  if (size > pcs->buffer_size)
112  {
113  if (pcs->buffer)
114  pcs->buffer = HeapReAlloc(GetProcessHeap(), 0, pcs->buffer, size);
115  else
116  pcs->buffer = HeapAlloc(GetProcessHeap(), 0, size);
117  pcs->buffer_size = (pcs->buffer) ? size : 0;
118  }
119  return pcs->buffer;
120 }
unsigned buffer_size
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void * buffer
#define HeapReAlloc
Definition: compat.h:393

Referenced by copy_line_W64_from_64().

◆ get_wine_loader_name()

const WCHAR* get_wine_loader_name ( void  )

Definition at line 110 of file module.c.

111 {
112  static const BOOL is_win64 = sizeof(void *) > sizeof(int); /* FIXME: should depend on target process */
113  static const WCHAR wineW[] = {'w','i','n','e',0};
114  static const WCHAR suffixW[] = {'6','4',0};
115  static const WCHAR *loader;
116 
117  if (!loader)
118  {
119  WCHAR *p, *buffer;
120  const char *ptr;
121 
122  /* All binaries are loaded with WINELOADER (if run from tree) or by the
123  * main executable
124  */
125  if ((ptr = getenv("WINELOADER")))
126  {
127  DWORD len = 2 + MultiByteToWideChar( CP_UNIXCP, 0, ptr, -1, NULL, 0 );
128  buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
130  }
131  else
132  {
133  buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(wineW) + 2 * sizeof(WCHAR) );
134  strcpyW( buffer, wineW );
135  }
136  p = buffer + strlenW( buffer ) - strlenW( suffixW );
137  if (p > buffer && !strcmpW( p, suffixW ))
138  {
139  if (!is_win64) *p = 0;
140  }
141  else if (is_win64) strcatW( buffer, suffixW );
142 
143  TRACE( "returning %s\n", debugstr_w(buffer) );
144  loader = buffer;
145  }
146  return loader;
147 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLuint buffer
Definition: glext.h:5915
static WCHAR wineW[]
Definition: localmon.c:116
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
static const BOOL is_win64
Definition: shellpath.c:54
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CP_UNIXCP
Definition: compat.h:69
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
#define MultiByteToWideChar
Definition: compat.h:100
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by module_fill_module(), and module_get_type_by_name().

◆ hash_table_add()

void hash_table_add ( struct hash_table ht,
struct hash_table_elt elt 
)

Definition at line 379 of file storage.c.

380 {
381  unsigned hash = hash_table_hash(elt->name, ht->num_buckets);
382 
383  if (!ht->buckets)
384  {
385  ht->buckets = pool_alloc(ht->pool, ht->num_buckets * sizeof(struct hash_table_bucket));
386  assert(ht->buckets);
387  memset(ht->buckets, 0, ht->num_buckets * sizeof(struct hash_table_bucket));
388  }
389 
390  /* in some cases, we need to get back the symbols of same name in the order
391  * in which they've been inserted. So insert new elements at the end of the list.
392  */
393  if (!ht->buckets[hash].first)
394  {
395  ht->buckets[hash].first = elt;
396  }
397  else
398  {
399  ht->buckets[hash].last->next = elt;
400  }
401  ht->buckets[hash].last = elt;
402  elt->next = NULL;
403  ht->num_elts++;
404 }
#define assert(x)
Definition: debug.h:53
int hash
Definition: main.c:58
static unsigned hash_table_hash(const char *name, unsigned num_buckets)
Definition: storage.c:320
const char * name
smooth NULL
Definition: ftsmooth.c:416
void * pool_alloc(struct pool *pool, size_t len)
Definition: storage.c:90
struct hash_table_elt * next
static const struct newhuff ht[]
Definition: huffman.h:296
Definition: _hash_fun.h:40
#define memset(x, y, z)
Definition: compat.h:39

Referenced by pev_set_value(), symt_add_module_ht(), symt_new_basic(), symt_new_typedef(), symt_new_udt(), and symt_ptr2index().

◆ hash_table_destroy()

void hash_table_destroy ( struct hash_table ht)

Definition at line 343 of file storage.c.

344 {
345 #if defined(USE_STATS)
346  int i;
347  unsigned len;
348  unsigned min = 0xffffffff, max = 0, sq = 0;
349  struct hash_table_elt* elt;
350  double mean, variance;
351 
352  for (i = 0; i < ht->num_buckets; i++)
353  {
354  for (len = 0, elt = ht->buckets[i]; elt; elt = elt->next) len++;
355  if (len < min) min = len;
356  if (len > max) max = len;
357  sq += len * len;
358  }
359  mean = (double)ht->num_elts / ht->num_buckets;
360  variance = (double)sq / ht->num_buckets - mean * mean;
361  FIXME("STATS: elts[num:%-4u size:%u mean:%f] buckets[min:%-4u variance:%+f max:%-4u]\n",
362  ht->num_elts, ht->num_buckets, mean, min, variance, max);
363 
364  for (i = 0; i < ht->num_buckets; i++)
365  {
366  for (len = 0, elt = ht->buckets[i]; elt; elt = elt->next) len++;
367  if (len == max)
368  {
369  FIXME("Longest bucket:\n");
370  for (elt = ht->buckets[i]; elt; elt = elt->next)
371  FIXME("\t%s\n", elt->name);
372  break;
373  }
374 
375  }
376 #endif
377 }
#define max(a, b)
Definition: svc.c:63
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:110
const char * name
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
GLenum GLsizei len
Definition: glext.h:6722
struct hash_table_elt * next
static const struct newhuff ht[]
Definition: huffman.h:296
#define min(a, b)
Definition: monoChain.cc:55

Referenced by module_remove(), and module_reset_debug_info().

◆ hash_table_init()

void hash_table_init ( struct pool pool,
struct hash_table ht,
unsigned  num_buckets 
)

Definition at line 335 of file storage.c.

336 {
337  ht->num_elts = 0;
338  ht->num_buckets = num_buckets;
339  ht->pool = pool;
340  ht->buckets = NULL;
341 }
smooth NULL
Definition: ftsmooth.c:416
static const struct newhuff ht[]
Definition: huffman.h:296

Referenced by module_new(), and pev_init().

◆ hash_table_iter_init()

void hash_table_iter_init ( const struct hash_table ht,
struct hash_table_iter hti,
const char name 
)

Definition at line 406 of file storage.c.

408 {
409  hti->ht = ht;
410  if (name)
411  {
412  hti->last = hash_table_hash(name, ht->num_buckets);
413  hti->index = hti->last - 1;
414  }
415  else
416  {
417  hti->last = ht->num_buckets - 1;
418  hti->index = -1;
419  }
420  hti->element = NULL;
421 }
static unsigned hash_table_hash(const char *name, unsigned num_buckets)
Definition: storage.c:320
smooth NULL
Definition: ftsmooth.c:416
struct hash_table_elt * element
static const struct newhuff ht[]
Definition: huffman.h:296
const struct hash_table * ht
Definition: name.c:36

Referenced by codeview_add_type_struct(), find_name(), pe_locate_with_coff_symbol_table(), pev_get_val(), pev_set_value(), SymEnumLines(), symt_enum_module(), symt_find_type_by_name(), and symt_ptr2index().

◆ hash_table_iter_up()

void* hash_table_iter_up ( struct hash_table_iter hti)

Definition at line 423 of file storage.c.

424 {
425  if (!hti->ht->buckets) return NULL;
426 
427  if (hti->element) hti->element = hti->element->next;
428  while (!hti->element && hti->index < hti->last)
429  hti->element = hti->ht->buckets[++hti->index].first;
430  return hti->element;
431 }
smooth NULL
Definition: ftsmooth.c:416
struct hash_table_elt * element
const struct hash_table * ht

Referenced by codeview_add_type_struct(), find_name(), pe_locate_with_coff_symbol_table(), pev_get_val(), pev_set_value(), SymEnumLines(), symt_enum_module(), symt_find_type_by_name(), and symt_ptr2index().

◆ macho_enum_modules()

BOOL macho_enum_modules ( HANDLE  hProc,
enum_modules_cb  ,
void  
)

Definition at line 1920 of file macho_module.c.

1921 {
1922  return FALSE;
1923 }

Referenced by fetch_modules_info().

◆ macho_fetch_file_info()

BOOL macho_fetch_file_info ( HANDLE  process,
const WCHAR name,
unsigned long  load_addr,
DWORD_PTR base,
DWORD size,
DWORD checksum 
)

Definition at line 1909 of file macho_module.c.

1911 {
1912  return FALSE;
1913 }

Referenced by fetch_macho_module_info_cb(), and module_find_cb().

◆ macho_load_debug_info()

BOOL macho_load_debug_info ( struct module module)

Definition at line 1930 of file macho_module.c.

1931 {
1932  return FALSE;
1933 }

Referenced by module_get_debug().

◆ macho_load_module()

struct module* macho_load_module ( struct process pcs,
const WCHAR name,
unsigned long   
)

Definition at line 1925 of file macho_module.c.

1926 {
1927  return NULL;
1928 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by SymLoadModuleExW().

◆ macho_read_wine_loader_dbg_info()

BOOL macho_read_wine_loader_dbg_info ( struct process pcs)

Definition at line 1915 of file macho_module.c.

1916 {
1917  return FALSE;
1918 }

Referenced by check_live_target().

◆ macho_synchronize_module_list()

BOOL macho_synchronize_module_list ( struct process pcs)

Definition at line 1904 of file macho_module.c.

1905 {
1906  return FALSE;
1907 }

Referenced by refresh_module_list(), and SymInitializeW().

◆ minidump_add_memory_block()

void minidump_add_memory_block ( struct dump_context dc,
ULONG64  base,
ULONG  size,
ULONG  rva 
)

Definition at line 338 of file minidump.c.

339 {
340  if (!dc->mem)
341  {
342  dc->alloc_mem = 32;
343  dc->mem = HeapAlloc(GetProcessHeap(), 0, dc->alloc_mem * sizeof(*dc->mem));
344  }
345  else if (dc->num_mem >= dc->alloc_mem)
346  {
347  dc->alloc_mem *= 2;
348  dc->mem = HeapReAlloc(GetProcessHeap(), 0, dc->mem,
349  dc->alloc_mem * sizeof(*dc->mem));
350  }
351  if (dc->mem)
352  {
353  dc->mem[dc->num_mem].base = base;
354  dc->mem[dc->num_mem].size = size;
355  dc->mem[dc->num_mem].rva = rva;
356  dc->num_mem++;
357  }
358  else dc->num_mem = dc->alloc_mem = 0;
359 }
HDC dc
Definition: cylfrac.c:34
GLuint base
Definition: 3dtext.c:35
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HeapReAlloc
Definition: compat.h:393

Referenced by arm64_fetch_minidump_thread(), arm_fetch_minidump_thread(), dump_threads(), i386_fetch_minidump_thread(), x86_64_fetch_minidump_module(), and x86_64_fetch_minidump_thread().

◆ module_find_by_addr()

struct module* module_find_by_addr ( const struct process pcs,
DWORD64  addr,
enum module_type  type 
)

Definition at line 399 of file module.c.

401 {
402  struct module* module;
403 
404  if (type == DMT_UNKNOWN)
405  {
406  if ((module = module_find_by_addr(pcs, addr, DMT_PE)) ||
407  (module = module_find_by_addr(pcs, addr, DMT_ELF)) ||
409  return module;
410  }
411  else
412  {
413  for (module = pcs->lmodules; module; module = module->next)
414  {
415  if (type == module->type && addr >= module->module.BaseOfImage &&
417  return module;
418  }
419  }
421  return module;
422 }
struct module * module_find_by_addr(const struct process *pcs, DWORD64 addr, enum module_type type)
Definition: module.c:399
DWORD64 BaseOfImage
Definition: compat.h:719
static HMODULE module
Definition: module.c:32
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
enum module_type type
struct module * lmodules
#define SetLastError(x)
Definition: compat.h:409
GLenum const GLvoid * addr
Definition: glext.h:9621
#define ERROR_MOD_NOT_FOUND
Definition: compat.h:94
IMAGEHLP_MODULEW64 module
struct module * next

Referenced by dwarf2_virtual_unwind(), pdb_virtual_unwind(), sym_enum(), SymAddSymbolW(), SymEnumLines(), SymEnumSourceFilesW(), SymEnumTypes(), SymFromAddr(), SymFunctionTableAccess64(), SymGetLineFromAddr64(), SymGetLineNext64(), SymGetLinePrev64(), SymGetModuleBase64(), SymGetModuleInfoW64(), SymGetTypeFromName(), SymGetTypeInfo(), symt_enum_locals(), SymUnloadModule(), SymUnloadModule64(), and x86_64_fetch_minidump_module().

◆ module_find_by_nameA()

struct module* module_find_by_nameA ( const struct process pcs,
const char name 
)

Definition at line 256 of file module.c.

257 {
258  WCHAR wname[MAX_PATH];
259 
260  MultiByteToWideChar(CP_ACP, 0, name, -1, wname, sizeof(wname) / sizeof(WCHAR));
261  return module_find_by_nameW(pcs, wname);
262 }
struct module * module_find_by_nameW(const struct process *pcs, const WCHAR *name)
Definition: module.c:244
#define CP_ACP
Definition: compat.h:99
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:36

Referenced by SymFromName().

◆ module_find_by_nameW()

struct module* module_find_by_nameW ( const struct process pcs,
const WCHAR name 
)

Definition at line 244 of file module.c.

245 {
246  struct module* module;
247 
248  for (module = pcs->lmodules; module; module = module->next)
249  {
250  if (!strcmpiW(name, module->module.ModuleName)) return module;
251  }
253  return NULL;
254 }
WCHAR ModuleName[32]
Definition: compat.h:725
static HMODULE module
Definition: module.c:32
struct module * lmodules
smooth NULL
Definition: ftsmooth.c:416
#define SetLastError(x)
Definition: compat.h:409
#define strcmpiW(s1, s2)
Definition: unicode.h:39
Definition: name.c:36
#define ERROR_INVALID_NAME
Definition: compat.h:93
IMAGEHLP_MODULEW64 module
struct module * next

Referenced by module_find_by_nameA(), and SymEnumSourceFilesW().

◆ module_get_containee()

struct module* module_get_containee ( const struct process pcs,
const struct module inner 
)

Definition at line 314 of file module.c.

316 {
317  struct module* module;
318 
319  for (module = pcs->lmodules; module; module = module->next)
320  {
321  if (module != outter &&
323  outter->module.BaseOfImage + outter->module.ImageSize >=
325  return module;
326  }
327  return NULL;
328 }
DWORD64 BaseOfImage
Definition: compat.h:719
static HMODULE module
Definition: module.c:32
struct module * lmodules
smooth NULL
Definition: ftsmooth.c:416
IMAGEHLP_MODULEW64 module
struct module * next

Referenced by sym_enum(), and SymFromName().

◆ module_get_debug()

BOOL module_get_debug ( struct module_pair )

Definition at line 340 of file module.c.

341 {
343 
344  if (!pair->requested) return FALSE;
345  /* for a PE builtin, always get info from container */
346  if (!(pair->effective = module_get_container(pair->pcs, pair->requested)))
347  pair->effective = pair->requested;
348  /* if deferred, force loading */
349  if (pair->effective->module.SymType == SymDeferred)
350  {
351  BOOL ret;
352 
353  if (pair->effective->is_virtual) ret = FALSE;
354  else switch (pair->effective->type)
355  {
356 #ifndef DBGHELP_STATIC_LIB
357  case DMT_ELF:
358  ret = elf_load_debug_info(pair->effective);
359  break;
360 #endif
361  case DMT_PE:
362  idslW64.SizeOfStruct = sizeof(idslW64);
363  idslW64.BaseOfImage = pair->effective->module.BaseOfImage;
364  idslW64.CheckSum = pair->effective->module.CheckSum;
365  idslW64.TimeDateStamp = pair->effective->module.TimeDateStamp;
366  memcpy(idslW64.FileName, pair->effective->module.ImageName,
367  sizeof(pair->effective->module.ImageName));
368  idslW64.Reparse = FALSE;
369  idslW64.hFile = INVALID_HANDLE_VALUE;
370 
372  ret = pe_load_debug_info(pair->pcs, pair->effective);
373  pcs_callback(pair->pcs,
375  &idslW64);
376  break;
377 #ifndef DBGHELP_STATIC_LIB
378  case DMT_MACHO:
379  ret = macho_load_debug_info(pair->effective);
380  break;
381 #endif
382  default:
383  ret = FALSE;
384  break;
385  }
386  if (!ret) pair->effective->module.SymType = SymNone;
387  assert(pair->effective->module.SymType != SymDeferred);
388  pair->effective->module.NumSyms = pair->effective->ht_symbols.num_elts;
389  }
390  return pair->effective->module.SymType != SymNone;
391 }
#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE
Definition: compat.h:626
static struct module * module_get_container(const struct process *pcs, const struct module *inner)
Definition: module.c:294
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define assert(x)
Definition: debug.h:53
WCHAR FileName[MAX_PATH+1]
Definition: compat.h:808
BOOL pcs_callback(const struct process *pcs, ULONG action, void *data)
Definition: dbghelp.c:551
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL pe_load_debug_info(const struct process *pcs, struct module *module) DECLSPEC_HIDDEN
Definition: pe_module.c:746
#define CBA_DEFERRED_SYMBOL_LOAD_FAILURE
Definition: compat.h:627
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CBA_DEFERRED_SYMBOL_LOAD_START
Definition: compat.h:625
Definition: _pair.h:47
BOOL elf_load_debug_info(struct module *module) DECLSPEC_HIDDEN
Definition: elf_module.c:1835
BOOL macho_load_debug_info(struct module *module) DECLSPEC_HIDDEN

Referenced by dwarf2_virtual_unwind(), find_name(), pdb_virtual_unwind(), sym_enum(), SymAddSymbolW(), SymEnumLines(), SymEnumSourceFilesW(), SymEnumTypes(), SymFromAddr(), SymGetLineFromAddr64(), SymGetLineNext64(), SymGetLinePrev64(), SymGetTypeFromName(), SymGetTypeInfo(), and symt_enum_locals().

◆ module_get_type_by_name()

enum module_type module_get_type_by_name ( const WCHAR name)

Definition at line 465 of file module.c.

466 {
467  int loader_len, len = strlenW(name);
468  const WCHAR *loader;
469 
470  /* Skip all version extensions (.[digits]) regex: "(\.\d+)*$" */
471  do
472  {
473  int i = len;
474 
475  while (i && name[i - 1] >= '0' && name[i - 1] <= '9') i--;
476 
477  if (i && name[i - 1] == '.')
478  len = i - 1;
479  else
480  break;
481  } while (len);
482 
483  /* check for terminating .so or .so.[digit] */
484  /* FIXME: Can't rely solely on extension; have to check magic or
485  * stop using .so on Mac OS X. For now, base on platform. */
486  if (len > 3 && !memcmp(name + len - 3, S_DotSoW, 3))
487 #ifdef __APPLE__
488  return DMT_MACHO;
489 #else
490  return DMT_ELF;
491 #endif
492 
493  if (len > 6 && !strncmpiW(name + len - 6, S_DotDylibW, 6))
494  return DMT_MACHO;
495 
496  if (len > 4 && !strncmpiW(name + len - 4, S_DotPdbW, 4))
497  return DMT_PDB;
498 
499  if (len > 4 && !strncmpiW(name + len - 4, S_DotDbgW, 4))
500  return DMT_DBG;
501 
502  /* wine is also a native module (Mach-O on Mac OS X, ELF elsewhere) */
503  loader = get_wine_loader_name();
504  loader_len = strlenW( loader );
505  if ((len == loader_len || (len > loader_len && name[len - loader_len - 1] == '/')) &&
506  !strcmpiW(name + len - loader_len, loader))
507  {
508 #ifdef __APPLE__
509  return DMT_MACHO;
510 #else
511  return DMT_ELF;
512 #endif
513  }
514  return DMT_PE;
515 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define strncmpiW(s1, s2, n)
Definition: unicode.h:40
static const WCHAR S_DotDbgW[]
Definition: module.c:42
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * get_wine_loader_name(void)
Definition: module.c:110
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR S_DotSoW[]
Definition: module.c:39
static const WCHAR S_DotPdbW[]
Definition: module.c:41
#define strcmpiW(s1, s2)
Definition: unicode.h:39
Definition: name.c:36
static const WCHAR S_DotDylibW[]
Definition: module.c:40

Referenced by path_find_symbol_file(), and SymLoadModuleExW().

◆ module_is_already_loaded()

struct module* module_is_already_loaded ( const struct process pcs,
const WCHAR imgname 
)

Definition at line 268 of file module.c.

269 {
270  struct module* module;
271  const WCHAR* filename;
272 
273  /* first compare the loaded image name... */
274  for (module = pcs->lmodules; module; module = module->next)
275  {
277  return module;
278  }
279  /* then compare the standard filenames (without the path) ... */
281  for (module = pcs->lmodules; module; module = module->next)
282  {
284  return module;
285  }
287  return NULL;
288 }
static HMODULE module
Definition: module.c:32
const char * filename
Definition: ioapi.h:135
WCHAR LoadedImageName[256]
Definition: compat.h:727
struct module * lmodules
static const WCHAR * get_filename(const WCHAR *name, const WCHAR *endptr)
Definition: module.c:68
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SetLastError(x)
Definition: compat.h:409
#define strcmpiW(s1, s2)
Definition: unicode.h:39
Definition: name.c:36
#define ERROR_INVALID_NAME
Definition: compat.h:93
IMAGEHLP_MODULEW64 module
struct module * next

Referenced by SymLoadModuleExW().

◆ module_new()

struct module* module_new ( struct process pcs,
const WCHAR name,
enum module_type  type,
BOOL  virtual,
DWORD64  addr,
DWORD64  size,
unsigned long  stamp,
unsigned long  checksum 
)

Definition at line 163 of file module.c.

167 {
168  struct module* module;
169  unsigned i;
170 
171  assert(type == DMT_ELF || type == DMT_PE || type == DMT_MACHO);
172  if (!(module = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*module))))
173  return NULL;
174 
175  module->next = pcs->lmodules;
176  pcs->lmodules = module;
177 
178  TRACE("=> %s %s-%s %s\n",
179  get_module_type(type, virtual),
180  wine_dbgstr_longlong(mod_addr), wine_dbgstr_longlong(mod_addr + size),
181  debugstr_w(name));
182 
183  pool_init(&module->pool, 65536);
184 
185  module->process = pcs;
186  module->module.SizeOfStruct = sizeof(module->module);
187  module->module.BaseOfImage = mod_addr;
190  module->module.ImageName[0] = '\0';
193  module->module.NumSyms = 0;
194  module->module.TimeDateStamp = stamp;
196 
198  module->module.CVSig = 0;
199  memset(module->module.CVData, 0, sizeof(module->module.CVData));
200  module->module.PdbSig = 0;
202  module->module.PdbAge = 0;
210 
211  module->reloc_delta = 0;
212  module->type = type;
213  module->is_virtual = virtual;
214  for (i = 0; i < DFI_LAST; i++) module->format_info[i] = NULL;
216  module->sorttab_size = 0;
218  module->num_sorttab = 0;
219  module->num_symbols = 0;
220 
221  vector_init(&module->vsymt, sizeof(struct symt*), 128);
222  /* FIXME: this seems a bit too high (on a per module basis)
223  * need some statistics about this
224  */
227 #ifdef __x86_64__
228  hash_table_init(&module->pool, &module->ht_symaddr, 4096);
229 #endif
230  vector_init(&module->vtypes, sizeof(struct symt*), 32);
231 
232  module->sources_used = 0;
233  module->sources_alloc = 0;
234  module->sources = 0;
236 
237  return module;
238 }
unsigned sources_alloc
DWORD64 BaseOfImage
Definition: compat.h:719
unsigned sources_used
struct hash_table ht_symbols
struct vector vsymt
static HMODULE module
Definition: module.c:32
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define assert(x)
Definition: debug.h:53
struct wine_rb_tree sources_offsets_tree
unsigned num_symbols
char * sources
#define lstrcpynW
Definition: compat.h:397
enum module_type type
WCHAR LoadedImageName[256]
Definition: compat.h:727
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
struct module * lmodules
int sortlist_valid
int source_rb_compare(const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN
Definition: source.c:41
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
void vector_init(struct vector *v, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN
Definition: storage.c:134
unsigned num_sorttab
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
DWORD64 reloc_delta
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct vector vtypes
WCHAR ImageName[256]
Definition: compat.h:726
void module_set_module(struct module *module, const WCHAR *name)
Definition: module.c:103
void pool_init(struct pool *a, size_t arena_size) DECLSPEC_HIDDEN
Definition: storage.c:44
static const char * get_module_type(enum module_type type, BOOL virtual)
Definition: module.c:149
DWORD SizeOfStruct
Definition: compat.h:718
SYM_TYPE SymType
Definition: compat.h:724
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
Definition: fdi.c:353
struct pool pool
struct process * process
unsigned short is_virtual
DWORD TimeDateStamp
Definition: compat.h:721
struct hash_table ht_types
WCHAR CVData[MAX_PATH *3]
Definition: compat.h:730
unsigned sorttab_size
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
WCHAR LoadedPdbName[256]
Definition: compat.h:728
void hash_table_init(struct pool *pool, struct hash_table *ht, unsigned num_buckets) DECLSPEC_HIDDEN
Definition: storage.c:335
Definition: name.c:36
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
struct symt_ht ** addr_sorttab
#define memset(x, y, z)
Definition: compat.h:39
struct module_format * format_info[DFI_LAST]
IMAGEHLP_MODULEW64 module
struct module * next

Referenced by pe_load_builtin_module(), pe_load_native_module(), and SymLoadModuleExW().

◆ module_remove()

BOOL module_remove ( struct process pcs,
struct module module 
)

Definition at line 684 of file module.c.

685 {
686  struct module_format*modfmt;
687  struct module** p;
688  unsigned i;
689 
690  TRACE("%s (%p)\n", debugstr_w(module->module.ModuleName), module);
691 
692  for (i = 0; i < DFI_LAST; i++)
693  {
694  if ((modfmt = module->format_info[i]) && modfmt->remove)
695  modfmt->remove(pcs, module->format_info[i]);
696  }
702  /* native dbghelp doesn't invoke registered callback(,CBA_SYMBOLS_UNLOADED,) here
703  * so do we
704  */
705  for (p = &pcs->lmodules; *p; p = &(*p)->next)
706  {
707  if (*p == module)
708  {
709  *p = module->next;
711  return TRUE;
712  }
713  }
714  FIXME("This shouldn't happen\n");
715  return FALSE;
716 }
void(* remove)(struct process *pcs, struct module_format *modfmt)
#define TRUE
Definition: types.h:120
WCHAR ModuleName[32]
Definition: compat.h:725
struct hash_table ht_symbols
char * sources
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
struct module * lmodules
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
struct pool pool
void hash_table_destroy(struct hash_table *ht) DECLSPEC_HIDDEN
Definition: storage.c:343
void pool_destroy(struct pool *a) DECLSPEC_HIDDEN
Definition: storage.c:51
struct hash_table ht_types
struct symt_ht ** addr_sorttab
GLfloat GLfloat p
Definition: glext.h:8902
struct module_format * format_info[DFI_LAST]
IMAGEHLP_MODULEW64 module
struct module * next
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SymCleanup(), SymUnloadModule(), and SymUnloadModule64().

◆ module_reset_debug_info()

void module_reset_debug_info ( struct module module)

Definition at line 1122 of file module.c.

1123 {
1125  module->sorttab_size = 0;
1129  module->ht_symbols.num_buckets = 0;
1130  module->ht_symbols.buckets = NULL;
1132  module->ht_types.num_buckets = 0;
1133  module->ht_types.buckets = NULL;
1134  module->vtypes.num_elts = 0;
1137  module->sources = NULL;
1138 }
#define TRUE
Definition: types.h:120
unsigned sources_alloc
unsigned sources_used
struct hash_table ht_symbols
unsigned num_symbols
char * sources
int sortlist_valid
smooth NULL
Definition: ftsmooth.c:416
unsigned num_sorttab
struct vector vtypes
void hash_table_destroy(struct hash_table *ht) DECLSPEC_HIDDEN
Definition: storage.c:343
struct hash_table ht_types
unsigned sorttab_size
struct symt_ht ** addr_sorttab

Referenced by stabs_parse().

◆ module_set_module()

void module_set_module ( struct module module,
const WCHAR name 
)

Definition at line 103 of file module.c.

104 {
106  sizeof(module->module.ModuleName) / sizeof(module->module.ModuleName[0]));
108 }
WCHAR ModuleName[32]
Definition: compat.h:725
WCHAR modulename[64]
static void module_fill_module(const WCHAR *in, WCHAR *out, size_t size)
Definition: module.c:80
Definition: name.c:36
IMAGEHLP_MODULEW64 module

Referenced by module_new(), and SymLoadModuleExW().

◆ path_find_symbol_file()

BOOL path_find_symbol_file ( const struct process pcs,
const struct module module,
PCSTR  full_path,
const GUID guid,
DWORD  dw1,
DWORD  dw2,
PSTR  buffer,
BOOL is_unmatched 
)

Definition at line 626 of file path.c.

629 {
630  struct module_find mf;
631  WCHAR full_pathW[MAX_PATH];
632  WCHAR tmp[MAX_PATH];
633  WCHAR* ptr;
634  const WCHAR* filename;
635  WCHAR* searchPath = pcs->search_path;
636 
637  TRACE("(pcs = %p, full_path = %s, guid = %s, dw1 = 0x%08x, dw2 = 0x%08x, buffer = %p)\n",
638  pcs, debugstr_a(full_path), debugstr_guid(guid), dw1, dw2, buffer);
639 
640  mf.guid = guid;
641  mf.dw1 = dw1;
642  mf.dw2 = dw2;
643  mf.matched = 0;
644 
645  MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH);
646  filename = file_nameW(full_pathW);
648  *is_unmatched = FALSE;
649 
650  /* first check full path to file */
651  if (module_find_cb(full_pathW, &mf))
652  {
653  WideCharToMultiByte(CP_ACP, 0, full_pathW, -1, buffer, MAX_PATH, NULL, NULL);
654  return TRUE;
655  }
656 
657  /* FIXME: Use Environment-Variables (see MS docs)
658  _NT_SYMBOL_PATH and _NT_ALT_SYMBOL_PATH
659  FIXME: Implement "Standard Path Elements" (Path) ... (see MS docs)
660  do a search for (every?) path-element like this ...
661  <path>
662  <path>\dll
663  <path>\symbols\dll
664  (dll may be exe, or sys depending on the file extension) */
665 
666  /* 2. check module-path */
668  if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf))
669  {
671  return TRUE;
672  }
673 
674  /* 3. check search-path */
675  while (searchPath)
676  {
677  ptr = strchrW(searchPath, ';');
678  if (ptr)
679  {
680  memcpy(tmp, searchPath, (ptr - searchPath) * sizeof(WCHAR));
681  tmp[ptr - searchPath] = '\0';
682  searchPath = ptr + 1;
683  }
684  else
685  {
686  strcpyW(tmp, searchPath);
687  searchPath = NULL;
688  }
689  if (do_searchW(filename, tmp, FALSE, module_find_cb, &mf))
690  {
691  /* return first fully matched file */
693  return TRUE;
694  }
695  }
696  /* if no fully matching file is found, return the best matching file if any */
697  if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched)
698  {
699  WideCharToMultiByte(CP_ACP, 0, mf.filename, -1, buffer, MAX_PATH, NULL, NULL);
700  *is_unmatched = TRUE;
701  return TRUE;
702  }
703  return FALSE;
704 }
WCHAR * search_path
#define TRUE
Definition: types.h:120
#define WideCharToMultiByte
Definition: compat.h:101
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
#define CP_ACP
Definition: compat.h:99
static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user)
Definition: path.c:473
enum module_type module_get_type_by_name(const WCHAR *name) DECLSPEC_HIDDEN
Definition: module.c:465
GLuint buffer
Definition: glext.h:5915
const char * filename
Definition: ioapi.h:135
static void file_pathW(const WCHAR *srcFileNameW, WCHAR *dstFilePathW)
Definition: path.c:52
static const WCHAR * file_nameW(const WCHAR *str)
Definition: path.c:44
WCHAR LoadedImageName[256]
Definition: compat.h:727
const GUID * guid
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
#define MAX_PATH
Definition: compat.h:26
unsigned dbghelp_options
Definition: dbghelp.c:72
static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse, PENUMDIRTREE_CALLBACKW cb, PVOID user)
Definition: path.c:222
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define SYMOPT_LOAD_ANYTHING
Definition: compat.h:640
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define MultiByteToWideChar
Definition: compat.h:100
DWORD dw1
Definition: path.c:462
IMAGEHLP_MODULEW64 module
DWORD dw2
Definition: path.c:463

Referenced by map_pdb_file(), and pe_load_dbg_file().

◆ pcs_callback()

BOOL pcs_callback ( const struct process pcs,
ULONG  action,
void data 
)

Definition at line 551 of file dbghelp.c.

552 {
554 
555  TRACE("%p %u %p\n", pcs, action, data);
556 
557  if (!pcs->reg_cb) return FALSE;
558  if (!pcs->reg_is_unicode)
559  {
561 
562  switch (action)
563  {
564  case CBA_DEBUG_INFO:
566  case CBA_SET_OPTIONS:
568  break;
573  idslW = data;
574  idsl.SizeOfStruct = sizeof(idsl);
575  idsl.BaseOfImage = idslW->BaseOfImage;
576  idsl.CheckSum = idslW->CheckSum;
577  idsl.TimeDateStamp = idslW->TimeDateStamp;
578  WideCharToMultiByte(CP_ACP, 0, idslW->FileName, -1,
579  idsl.FileName, sizeof(idsl.FileName), NULL, NULL);
580  idsl.Reparse = idslW->Reparse;
581  data = &idsl;
582  break;
584  case CBA_EVENT:
585  case CBA_READ_MEMORY:
586  default:
587  FIXME("No mapping for action %u\n", action);
588  return FALSE;
589  }
590  }
591  return pcs->reg_cb(pcs->handle, action, (ULONG64)(DWORD_PTR)data, pcs->reg_user);
592 }
#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE
Definition: compat.h:626
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define CBA_EVENT
Definition: compat.h:633
WCHAR FileName[MAX_PATH+1]
Definition: compat.h:808
#define CBA_READ_MEMORY
Definition: compat.h:630
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define CBA_DEFERRED_SYMBOL_LOAD_FAILURE
Definition: compat.h:627
#define CBA_SYMBOLS_UNLOADED
Definition: compat.h:628
DWORD64 reg_user
#define TRACE(s)
Definition: solgame.cpp:4
PSYMBOL_REGISTERED_CALLBACK64 reg_cb
#define CBA_DEBUG_INFO
Definition: compat.h:635
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned __int64 ULONG64
Definition: imports.h:198
#define CBA_DUPLICATE_SYMBOL
Definition: compat.h:629
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL
Definition: compat.h:634
const WCHAR * action
Definition: action.c:7783
#define CBA_DEFERRED_SYMBOL_LOAD_START
Definition: compat.h:625
#define CBA_SET_OPTIONS
Definition: compat.h:632
HANDLE handle
#define CBA_DEFERRED_SYMBOL_LOAD_CANCEL
Definition: compat.h:631
BOOL reg_is_unicode

Referenced by module_get_debug(), and SymSetOptions().

◆ pdb_fetch_file_info()

BOOL pdb_fetch_file_info ( const struct pdb_lookup pdb_lookup,
unsigned *  matched 
)

Definition at line 2915 of file msc.c.

2916 {
2917  HANDLE hFile, hMap = NULL;
2918  char* image = NULL;
2919  BOOL ret;
2920  struct pdb_file_info pdb_file;
2921 
2924  ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) ||
2925  ((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL))
2926  {
2927  WARN("Unable to open .PDB file: %s\n", pdb_lookup->filename);
2928  ret = FALSE;
2929  }
2930  else
2931  {
2932  ret = pdb_init(pdb_lookup, &pdb_file, image, matched);
2933  pdb_free_file(&pdb_file);
2934  }
2935 
2936  if (image) UnmapViewOfFile(image);
2937  if (hMap) CloseHandle(hMap);
2939 
2940  return ret;
2941 }
#define CloseHandle
Definition: compat.h:398
#define MapViewOfFile
Definition: compat.h:402
static BOOL pdb_init(const struct pdb_lookup *pdb_lookup, struct pdb_file_info *pdb_file, const char *image, unsigned *matched)
Definition: msc.c:2541
#define WARN(fmt,...)
Definition: debug.h:111
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define FILE_SHARE_READ
Definition: compat.h:125
static void pdb_free_file(struct pdb_file_info *pdb_file)
Definition: msc.c:2271
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:427
#define OPEN_EXISTING
Definition: compat.h:426
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:401
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define PAGE_READONLY
Definition: compat.h:127
HANDLE hMap
Definition: msc.c:71
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
#define UnmapViewOfFile
Definition: compat.h:403
const char * filename

Referenced by module_find_cb().

◆ pdb_virtual_unwind()

BOOL pdb_virtual_unwind ( struct cpu_stack_walk csw,
DWORD_PTR  ip,
CONTEXT context,
struct pdb_cmd_pair cpair 
)

Definition at line 3202 of file msc.c.

3204 {
3205  struct module_pair pair;
3206  struct pdb_module_info* pdb_info;
3207  PDB_FPO_DATA* fpoext;
3208  unsigned i, size, strsize;
3209  char* strbase;
3210  BOOL ret = TRUE;
3211 
3212  if (!(pair.pcs = process_find_by_handle(csw->hProcess)) ||
3213  !(pair.requested = module_find_by_addr(pair.pcs, ip, DMT_UNKNOWN)) ||
3215  return FALSE;
3216  if (!pair.effective->format_info[DFI_PDB]) return FALSE;
3217  pdb_info = pair.effective->format_info[DFI_PDB]->u.pdb_info;
3218  TRACE("searching %lx => %lx\n", ip, ip - (DWORD_PTR)pair.effective->module.BaseOfImage);
3219  ip -= (DWORD_PTR)pair.effective->module.BaseOfImage;
3220 
3221  strbase = pdb_read_strings(&pdb_info->pdb_files[0]);
3222  if (!strbase) return FALSE;
3223  strsize = *(const DWORD*)(strbase + 8);
3224  fpoext = pdb_read_file(&pdb_info->pdb_files[0], pdb_info->pdb_files[0].fpoext_stream);
3225  size = pdb_get_file_size(&pdb_info->pdb_files[0], pdb_info->pdb_files[0].fpoext_stream);
3226  if (fpoext && (size % sizeof(*fpoext)) == 0)
3227  {
3228  size /= sizeof(*fpoext);
3229  for (i = 0; i < size; i++)
3230  {
3231  if (fpoext[i].start <= ip && ip < fpoext[i].start + fpoext[i].func_size)
3232  {
3233  TRACE("\t%08x %08x %8x %8x %4x %4x %4x %08x %s\n",
3234  fpoext[i].start, fpoext[i].func_size, fpoext[i].locals_size,
3235  fpoext[i].params_size, fpoext[i].maxstack_size, fpoext[i].prolog_size,
3236  fpoext[i].savedregs_size, fpoext[i].flags,
3237  fpoext[i].str_offset < strsize ?
3238  wine_dbgstr_a(strbase + 12 + fpoext[i].str_offset) : "<out of bounds>");
3239  if (fpoext[i].str_offset < strsize)
3240  ret = pdb_parse_cmd_string(csw, &fpoext[i], strbase + 12 + fpoext[i].str_offset, cpair);
3241  else
3242  ret = FALSE;
3243  break;
3244  }
3245  }
3246  }
3247  else ret = FALSE;
3248  pdb_free(fpoext);
3249  pdb_free(strbase);
3250 
3251  return ret;
3252 }
#define TRUE
Definition: types.h:120
struct process * process_find_by_handle(HANDLE hProcess)
Definition: dbghelp.c:80
static unsigned pdb_get_file_size(const struct pdb_file_info *pdb_file, DWORD file_nr)
Definition: msc.c:2256
#define DWORD_PTR
Definition: treelist.c:76
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
Definition: debug.h:186
static void * pdb_read_file(const struct pdb_file_info *pdb_file, DWORD file_nr)
Definition: msc.c:2241
static void * pdb_read_strings(const struct pdb_file_info *pdb_file)
Definition: msc.c:2339
static void pdb_free(void *buffer)
Definition: msc.c:2266
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
unsigned int BOOL
Definition: ntddk_ex.h:94
struct pdb_file_info pdb_files[CV_MAX_MODULES]
Definition: msc.c:95
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
BOOL module_get_debug(struct module_pair *) DECLSPEC_HIDDEN
Definition: module.c:340
Definition: dhcpd.h:61
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
struct module * module_find_by_addr(const struct process *pcs, DWORD64 addr, enum module_type type) DECLSPEC_HIDDEN
Definition: module.c:399
static BOOL pdb_parse_cmd_string(struct cpu_stack_walk *csw, PDB_FPO_DATA *fpoext, const char *cmd, struct pdb_cmd_pair *cpair)
Definition: msc.c:3149
uint32_t DWORD_PTR
Definition: typedefs.h:63
GLuint start
Definition: gl.h:1545
Definition: _pair.h:47

◆ pe_load_builtin_module()

struct module* pe_load_builtin_module ( struct process pcs,
const WCHAR name,
DWORD64  base,
DWORD64  size 
)

Definition at line 852 of file pe_module.c.

854 {
855  struct module* module = NULL;
856 
857  if (base && pcs->dbg_hdr_addr)
858  {
859  IMAGE_NT_HEADERS nth;
860 
861  if (pe_load_nt_header(pcs->handle, base, &nth))
862  {
863  if (!size) size = nth.OptionalHeader.SizeOfImage;
867  }
868  }
869  return module;
870 }
struct module * 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
Definition: module.c:163
HMODULE module
Definition: main.cpp:47
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
smooth NULL
Definition: ftsmooth.c:416
IMAGE_FILE_HEADER FileHeader
Definition: ntddk_ex.h:183
BOOL pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS *nth)
Definition: pe_module.c:837
GLsizeiptr size
Definition: glext.h:5919
unsigned long dbg_hdr_addr
Definition: name.c:36
HANDLE handle

Referenced by SymLoadModuleExW().

◆ pe_load_debug_directory()

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 
)

Definition at line 3393 of file msc.c.

3397 {
3398  BOOL ret;
3399  int i;
3400  struct msc_debug_info msc_dbg;
3401 
3402  msc_dbg.module = module;
3403  msc_dbg.nsect = nsect;
3404  msc_dbg.sectp = sectp;
3405  msc_dbg.nomap = 0;
3406  msc_dbg.omapp = NULL;
3407 
3408  __TRY
3409  {
3410  ret = FALSE;
3411 
3412  /* First, watch out for OMAP data */
3413  for (i = 0; i < nDbg; i++)
3414  {
3416  {
3417  msc_dbg.nomap = dbg[i].SizeOfData / sizeof(OMAP_DATA);
3418  msc_dbg.omapp = (const OMAP_DATA*)(mapping + dbg[i].PointerToRawData);
3419  break;
3420  }
3421  }
3422 
3423  /* Now, try to parse CodeView debug info */
3424  for (i = 0; i < nDbg; i++)
3425  {
3426  if (dbg[i].Type == IMAGE_DEBUG_TYPE_CODEVIEW)
3427  {
3428  msc_dbg.root = mapping + dbg[i].PointerToRawData;
3429  if ((ret = codeview_process_info(pcs, &msc_dbg))) goto done;
3430  }
3431  }
3432 
3433  /* If not found, try to parse COFF debug info */
3434  for (i = 0; i < nDbg; i++)
3435  {
3436  if (dbg[i].Type == IMAGE_DEBUG_TYPE_COFF)
3437  {
3438  msc_dbg.root = mapping + dbg[i].PointerToRawData;
3439  if ((ret = coff_process_info(&msc_dbg))) goto done;
3440  }
3441  }
3442  done:
3443  /* FIXME: this should be supported... this is the debug information for
3444  * functions compiled without a frame pointer (FPO = frame pointer omission)
3445  * the associated data helps finding out the relevant information
3446  */
3447  for (i = 0; i < nDbg; i++)
3448  if (dbg[i].Type == IMAGE_DEBUG_TYPE_FPO)
3449  FIXME("This guy has FPO information\n");
3450 #if 0
3451 
3452 #define FRAME_FPO 0
3453 #define FRAME_TRAP 1
3454 #define FRAME_TSS 2
3455 
3456 typedef struct _FPO_DATA
3457 {
3458  DWORD ulOffStart; /* offset 1st byte of function code */
3459  DWORD cbProcSize; /* # bytes in function */
3460  DWORD cdwLocals; /* # bytes in locals/4 */
3461  WORD cdwParams; /* # bytes in params/4 */
3462 
3463  WORD cbProlog : 8; /* # bytes in prolog */
3464  WORD cbRegs : 3; /* # regs saved */
3465  WORD fHasSEH : 1; /* TRUE if SEH in func */
3466  WORD fUseBP : 1; /* TRUE if EBP has been allocated */
3467  WORD reserved : 1; /* reserved for future use */
3468  WORD cbFrame : 2; /* frame type */
3469 } FPO_DATA;
3470 #endif
3471 
3472  }
3474  {
3475  ERR("Got a page fault while loading symbols\n");
3476  ret = FALSE;
3477  }
3478  __ENDTRY
3479  return ret;
3480 }
WORD reserved
Definition: winnt_old.h:3382
WORD fHasSEH
Definition: winnt_old.h:3380
#define IMAGE_DEBUG_TYPE_COFF
Definition: compat.h:130
DECLSPEC_HIDDEN BOOL coff_process_info(const struct msc_debug_info *msc_dbg)
Definition: coff.c:155
HMODULE module
Definition: main.cpp:47
WORD cbFrame
Definition: winnt_old.h:3383
#define IMAGE_DEBUG_TYPE_CODEVIEW
Definition: compat.h:131
Type
Definition: Type.h:6
#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC
Definition: compat.h:137
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
unsigned int BOOL
Definition: ntddk_ex.h:94
WORD fUseBP
Definition: winnt_old.h:3381
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define __TRY
Definition: compat.h:70
DWORD ulOffStart
Definition: winnt_old.h:3374
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
static BOOL codeview_process_info(const struct process *pcs, const struct msc_debug_info *msc_dbg)
Definition: msc.c:3264
#define __ENDTRY
Definition: compat.h:72
int ret
#define ERR(fmt,...)
Definition: debug.h:109
#define IMAGE_DEBUG_TYPE_FPO
Definition: compat.h:132
struct module * module
Definition: mscvpdb.h:2124
WORD cbRegs
Definition: winnt_old.h:3379
struct _FPO_DATA FPO_DATA
DWORD cbProcSize
Definition: winnt_old.h:3375
DWORD cdwLocals
Definition: winnt_old.h:3376
const IMAGE_SECTION_HEADER * sectp
Definition: mscvpdb.h:2126
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:71
WORD cdwParams
Definition: winnt_old.h:3377
WORD cbProlog
Definition: winnt_old.h:3378

Referenced by pe_load_dbg_file(), and pe_load_msc_debug_info().

◆ pe_load_debug_info()

BOOL pe_load_debug_info ( const struct process pcs,
struct module module 
)

Definition at line 746 of file pe_module.c.

747 {
748  BOOL ret = FALSE;
749 
751  {
752  ret = pe_load_stabs(pcs, module);
753  ret = pe_load_dwarf(module) || ret;
754  #ifndef DBGHELP_STATIC_LIB
756  ret = pe_load_rsym(module) || ret;
757  #endif
758 
759  ret = ret || pe_load_coff_symbol_table(module); /* FIXME */
760  /* if we still have no debug info (we could only get SymExport at this
761  * point), then do the SymExport except if we have an ELF container,
762  * in which case we'll rely on the export's on the ELF side
763  */
764  }
765  /* FIXME shouldn't we check that? if (!module_get_debug(pcs, module)) */
766  if (pe_load_export_debug_info(pcs, module) && !ret)
767  ret = TRUE;
768 
769  return ret;
770 }
#define TRUE
Definition: types.h:120
static BOOL pe_load_dwarf(struct module *module)
Definition: pe_module.c:507
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL pe_load_export_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:661
unsigned dbghelp_options
Definition: dbghelp.c:72
int ret
static BOOL pe_load_rsym(struct module *module)
Definition: pe_module.c:527
static BOOL pe_load_msc_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:600
static BOOL pe_load_coff_symbol_table(struct module *module)
Definition: pe_module.c:402
#define SYMOPT_PUBLICS_ONLY
Definition: compat.h:641
static BOOL pe_load_stabs(const struct process *pcs, struct module *module)
Definition: pe_module.c:471

Referenced by module_get_debug(), and pe_load_native_module().

◆ pe_load_native_module()

struct module* pe_load_native_module ( struct process pcs,
const WCHAR name,
HANDLE  hFile,
DWORD64  base,
DWORD  size 
)

Definition at line 776 of file pe_module.c.

778 {
779  struct module* module = NULL;
780  BOOL opened = FALSE;
781  struct module_format* modfmt;
782  WCHAR loaded_name[MAX_PATH];
783 
784  loaded_name[0] = '\0';
785  if (!hFile)
786  {
787  assert(name);
788 
789  if ((hFile = FindExecutableImageExW(name, pcs->search_path, loaded_name, NULL, NULL)) == NULL)
790  return NULL;
791  opened = TRUE;
792  }
793  else if (name) strcpyW(loaded_name, name);
795  FIXME("Trouble ahead (no module name passed in deferred mode)\n");
796  if (!(modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct pe_module_info))))
797  return NULL;
798  modfmt->u.pe_info = (struct pe_module_info*)(modfmt + 1);
799  if (pe_map_file(hFile, &modfmt->u.pe_info->fmap, DMT_PE))
800  {
801  if (!base) base = modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.ImageBase;
802  if (!size) size = modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.SizeOfImage;
803 
804  module = module_new(pcs, loaded_name, DMT_PE, FALSE, base, size,
805  modfmt->u.pe_info->fmap.u.pe.ntheader.FileHeader.TimeDateStamp,
806  modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.CheckSum);
807  if (module)
808  {
809  modfmt->module = module;
810  modfmt->remove = pe_module_remove;
811  modfmt->loc_compute = NULL;
812 
813  module->format_info[DFI_PE] = modfmt;
816  else
818  module->reloc_delta = base - modfmt->u.pe_info->fmap.u.pe.ntheader.OptionalHeader.ImageBase;
819  }
820  else
821  {
822  ERR("could not load the module '%s'\n", debugstr_w(loaded_name));
823  pe_unmap_file(&modfmt->u.pe_info->fmap);
824  }
825  }
826  if (!module) HeapFree(GetProcessHeap(), 0, modfmt);
827 
828  if (opened) CloseHandle(hFile);
829 
830  return module;
831 }
void(* remove)(struct process *pcs, struct module_format *modfmt)
struct module * 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
Definition: module.c:163
WCHAR * search_path
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
HMODULE module
Definition: main.cpp:47
#define assert(x)
Definition: debug.h:53
static void pe_unmap_file(struct image_file_map *fmap)
Definition: pe_module.c:290
union module_format::@356 u
#define SYMOPT_DEFERRED_LOADS
Definition: compat.h:638
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
BOOL pe_load_debug_info(const struct process *pcs, struct module *module)
Definition: pe_module.c:746
GLsizeiptr size
Definition: glext.h:5919
DWORD64 reloc_delta
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void(* loc_compute)(struct process *pcs, const struct module_format *modfmt, const struct symt_function *func, struct location *loc)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static BOOL pe_map_file(HANDLE file, struct image_file_map *fmap, enum module_type mt)
Definition: pe_module.c:208
#define FindExecutableImageExW
Definition: compat.h:782
#define MAX_PATH
Definition: compat.h:26
unsigned dbghelp_options
Definition: dbghelp.c:72
static void pe_module_remove(struct process *pcs, struct module_format *modfmt)
Definition: pe_module.c:327
SYM_TYPE SymType
Definition: compat.h:724
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ERR(fmt,...)
Definition: debug.h:109
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
struct module * module
Definition: name.c:36
IMAGEHLP_MODULEW64 module
struct module_format * format_info[DFI_LAST]
#define HeapFree(x, y, z)
Definition: compat.h:394
struct pe_module_info * pe_info

Referenced by SymLoadModuleExW().

◆ pe_load_nt_header()

BOOL pe_load_nt_header ( HANDLE  hProc,
DWORD64  base,
IMAGE_NT_HEADERS nth 
)

Definition at line 837 of file pe_module.c.

838 {
840 
841  return ReadProcessMemory(hProc, (char*)(DWORD_PTR)base, &dos, sizeof(dos), NULL) &&
843  ReadProcessMemory(hProc, (char*)(DWORD_PTR)(base + dos.e_lfanew),
844  nth, sizeof(*nth), NULL) &&
846 }
#define ReadProcessMemory(a, b, c, d, e)
Definition: compat.h:415
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
smooth NULL
Definition: ftsmooth.c:416
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
IMAGE_DOS_HEADER dos
Definition: module.c:49
uint32_t DWORD_PTR
Definition: typedefs.h:63

Referenced by fetch_pe_module_info_cb(), and pe_load_builtin_module().

◆ pe_map_directory()

const char* pe_map_directory ( struct module module,
int  dirno,
DWORD size 
)

Definition at line 313 of file pe_module.c.

314 {
315  IMAGE_NT_HEADERS* nth;
316  void* mapping;
317 
318  if (module->type != DMT_PE || !module->format_info[DFI_PE]) return NULL;
319  if (dirno >= IMAGE_NUMBEROF_DIRECTORY_ENTRIES ||
320  !(mapping = pe_map_full(&module->format_info[DFI_PE]->u.pe_info->fmap, &nth)))
321  return NULL;
322  if (size) *size = nth->OptionalHeader.DataDirectory[dirno].Size;
323  return RtlImageRvaToVa(nth, mapping,
325 }
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES
Definition: ntddk_ex.h:135
#define RtlImageRvaToVa
Definition: compat.h:458
static void * pe_map_full(struct image_file_map *fmap, IMAGE_NT_HEADERS **nth)
Definition: pe_module.c:46
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
enum module_type type
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
struct module_format * format_info[DFI_LAST]

Referenced by x86_64_fetch_minidump_module(), and x86_64_find_runtime_function().

◆ pool_alloc()

void* pool_alloc ( struct pool a,
size_t  len 
)

Definition at line 90 of file storage.c.

91 {
92  struct pool_arena* arena;
93  void* ret;
94  size_t size;
95 
96  len = (len + 3) & ~3; /* round up size on DWORD boundary */
97 
99  {
100  if (arena->end - arena->current >= len)
101  {
102  ret = arena->current;
103  arena->current += len;
104  if (arena->current + 16 >= arena->end)
105  {
106  list_remove( &arena->entry );
107  list_add_tail( &pool->arena_full, &arena->entry );
108  }
109  return ret;
110  }
111  }
112 
113  size = max( pool->arena_size, len );
114  arena = HeapAlloc(GetProcessHeap(), 0, size + sizeof(struct pool_arena));
115  if (!arena) return NULL;
116 
117  ret = arena + 1;
118  arena->current = (char*)ret + len;
119  arena->end = (char*)ret + size;
120  if (arena->current + 16 >= arena->end)
121  list_add_tail( &pool->arena_full, &arena->entry );
122  else
123  list_add_head( &pool->arena_list, &arena->entry );
124  return ret;
125 }
struct list arena_list
#define max(a, b)
Definition: svc.c:63
uint8_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
char * current
Definition: storage.c:40
size_t arena_size
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
char * end
Definition: storage.c:41
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
GLsizeiptr size
Definition: glext.h:5919
struct list arena_full
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
GLenum GLsizei len
Definition: glext.h:6722
struct list entry
Definition: storage.c:39

Referenced by dwarf2_compute_location_attr(), dwarf2_get_cpp_name(), dwarf2_parse_abbrev_set(), dwarf2_parse_line_numbers(), dwarf2_parse_variable(), dwarf2_read_one_debug_info(), hash_table_add(), pev_set_value(), pool_strdup(), source_new(), symt_add_enum_element(), symt_add_func_local(), symt_add_function_point(), symt_add_function_signature_parameter(), symt_add_udt_element(), symt_new_array(), symt_new_basic(), symt_new_compiland(), symt_new_constant(), symt_new_enum(), symt_new_function(), symt_new_function_signature(), symt_new_global_variable(), symt_new_label(), symt_new_pointer(), symt_new_public(), symt_new_thunk(), symt_new_typedef(), symt_new_udt(), symt_open_func_block(), symt_ptr2index(), and vector_add().

◆ pool_destroy()

void pool_destroy ( struct pool a)

Definition at line 51 of file storage.c.

52 {
53  struct pool_arena* arena;
54  struct pool_arena* next;
55 
56 #ifdef USE_STATS
57  size_t alloc, used, num;
58 
59  alloc = used = num = 0;
61  {
62  alloc += arena->end - (char *)arena;
63  used += arena->current - (char*)arena;
64  num++;
65  }
67  {
68  alloc += arena->end - (char *)arena;
69  used += arena->current - (char*)arena;
70  num++;
71  }
72  if (alloc == 0) alloc = 1; /* avoid division by zero */
73  FIXME("STATS: pool %p has allocated %u kbytes, used %u kbytes in %u arenas, non-allocation ratio: %.2f%%\n",
74  pool, (unsigned)(alloc >> 10), (unsigned)(used >> 10), (unsigned)num,
75  100.0 - (float)used / (float)alloc * 100.0);
76 #endif
77 
79  {
80  list_remove( &arena->entry );
81  HeapFree(GetProcessHeap(), 0, arena);
82  }
84  {
85  list_remove( &arena->entry );
86  HeapFree(GetProcessHeap(), 0, arena);
87  }
88 }
struct list arena_list
uint8_t entry
Definition: isohybrid.c:63
char * current
Definition: storage.c:40
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define FIXME(fmt,...)
Definition: debug.h:110
char * end
Definition: storage.c:41
c used
Definition: write.c:2885
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
struct list arena_full
#define GetProcessHeap()
Definition: compat.h:395
GLuint GLuint num
Definition: glext.h:9618
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define alloc
Definition: rosglue.h:13
#define HeapFree(x, y, z)
Definition: compat.h:394
struct list entry
Definition: storage.c:39

Referenced by dwarf2_parse_compilation_unit(), module_remove(), pev_free(), and rsym_parse().

◆ pool_init()

void pool_init ( struct pool a,
size_t  arena_size 
)

Definition at line 44 of file storage.c.

45 {
46  list_init( &a->arena_list );
47  list_init( &a->arena_full );
48  a->arena_size = arena_size;
49 }
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by dwarf2_parse_compilation_unit(), module_new(), pev_init(), and rsym_parse().

◆ pool_strdup()

char* pool_strdup ( struct pool a,
const char str 
)

Definition at line 127 of file storage.c.

128 {
129  char* ret;
130  if ((ret = pool_alloc(pool, strlen(str) + 1))) strcpy(ret, str);
131  return ret;
132 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
const WCHAR * str
void * pool_alloc(struct pool *pool, size_t len)
Definition: storage.c:90
int ret
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by dwarf2_parse_variable(), pev_push(), pev_set_value(), symt_add_enum_element(), symt_add_func_local(), symt_add_function_point(), symt_add_udt_element(), symt_new_basic(), symt_new_constant(), symt_new_enum(), symt_new_function(), symt_new_global_variable(), symt_new_label(), symt_new_public(), symt_new_thunk(), symt_new_typedef(), symt_new_udt(), and symt_ptr2index().

◆ process_find_by_handle()

◆ rsym_parse()

BOOL rsym_parse ( struct module module,
unsigned long  load_offset,
const void rsym,
int  rsymlen 
)

Definition at line 79 of file rsym.c.

81 {
82  const ROSSYM_HEADER* RosSymHeader;
83  const ROSSYM_ENTRY* First, *Last, *Entry;
84  const CHAR* Strings;
85 
86  struct pool pool;
87  struct sparse_array file_table, func_table;
88  rsym_func_entry_t* first_func = NULL;
89 
90 
91  RosSymHeader = rsym_ptr;
92 
93  if (RosSymHeader->SymbolsOffset < sizeof(ROSSYM_HEADER)
94  || RosSymHeader->StringsOffset < RosSymHeader->SymbolsOffset + RosSymHeader->SymbolsLength
95  || rsymlen < RosSymHeader->StringsOffset + RosSymHeader->StringsLength
96  || 0 != (RosSymHeader->SymbolsLength % sizeof(ROSSYM_ENTRY)))
97  {
98  WARN("Invalid ROSSYM_HEADER\n");
99  return FALSE;
100  }
101 
102  First = (const ROSSYM_ENTRY *)((const char*)rsym_ptr + RosSymHeader->SymbolsOffset);
103  Last = First + RosSymHeader->SymbolsLength / sizeof(ROSSYM_ENTRY);
104  Strings = (const CHAR*)rsym_ptr + RosSymHeader->StringsOffset;
105 
106  pool_init(&pool, 65536);
107  sparse_array_init(&file_table, sizeof(rsym_file_entry_t), 64);
108  sparse_array_init(&func_table, sizeof(rsym_func_entry_t), 128);
109 
110  for (Entry = First; Entry != Last; Entry++)
111  {
112  ULONG Address = load_offset + Entry->Address;
113  if (!Entry->FileOffset)
114  {
115  rsym_func_entry_t* func = sparse_array_find(&func_table, Entry->FunctionOffset);
116 
117  /* We do not want to define a data point where there is already a function! */
118  if (!func || func->Address != Address)
119  {
120  const char* SymbolName = Strings + Entry->FunctionOffset;
121  if (!is_metadata_sym(SymbolName))
122  {
123  /* TODO: How should we determine the size? */
124  ULONG Size = sizeof(ULONG);
125  if (use_raw_address(SymbolName))
126  Address = Entry->Address;
127 
128  symt_new_public(module, NULL, SymbolName, FALSE, Address, Size);
129  }
130  else
131  {
132  /* Maybe use it to fill some metadata? */
133  }
134  }
135  }
136  else
137  {
138  rsym_file_entry_t* file = sparse_array_find(&file_table, Entry->FileOffset);
139  rsym_func_entry_t* func = sparse_array_find(&func_table, Entry->FunctionOffset);
140 
141  if (!file)
142  {
143  file = sparse_array_add(&file_table, Entry->FileOffset, &pool);
144  file->File = Strings + Entry->FileOffset;
145  file->Source = source_new(module, NULL, Strings + Entry->FileOffset);
146  }
147 
148  if (!func)
149  {
150  func = sparse_array_add(&func_table, Entry->FunctionOffset, &pool);
151  func->func = symt_new_function(module, NULL, Strings + Entry->FunctionOffset,
152  Address, 0, NULL);
153  func->Address = Address;
154  func->next = first_func;
155  first_func = func;
156  }
157 
158  /* TODO: What if we have multiple chunks scattered around? */
159  symt_add_func_line(module, func->func, file->Source, Entry->SourceLine, Address - func->Address);
160  }
161  }
162 
163  while (first_func)
164  {
165  /* TODO: Size of function? */
166  rsym_finalize_function(module, first_func->func);
167  first_func = first_func->next;
168  }
169 
171  module->module.CVSig = 'R' | ('S' << 8) | ('Y' << 16) | ('M' << 24);
177 
178  pool_destroy(&pool);
179 
180  return TRUE;
181 }
static void rsym_finalize_function(struct module *module, struct symt_function *func)
Definition: rsym.c:37
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
Definition: compat.h:712
struct _Entry Entry
Definition: kefuncs.h:640
char CHAR
Definition: xmlstorage.h:175
#define WARN(fmt,...)
Definition: debug.h:111
Definition: rsym.c:15
Definition: rossym.h:26
unsigned long StringsOffset
Definition: rossym.h:22
WCHAR First[]
Definition: FormatMessage.c:11
struct symt_public * symt_new_public(struct module *module, struct symt_compiland *parent, const char *typename, BOOL is_function, unsigned long address, unsigned size) DECLSPEC_HIDDEN
Definition: symbol.c:226
void symt_add_func_line(struct module *module, struct symt_function *func, unsigned source_idx, int line_num, unsigned long offset) DECLSPEC_HIDDEN
Definition: symbol.c:328
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
struct _ROSSYM_ENTRY ROSSYM_ENTRY
static int is_metadata_sym(const char *name)
Definition: rsym.c:58
void sparse_array_init(struct sparse_array *sa, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN
Definition: storage.c:214
static const WCHAR Strings[]
Definition: reg.c:35
void pool_init(struct pool *a, size_t arena_size) DECLSPEC_HIDDEN
Definition: storage.c:44
SYM_TYPE SymType
Definition: compat.h:724
static int use_raw_address(const char *name)
Definition: rsym.c:64
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
unsigned long StringsLength
Definition: rossym.h:23
void pool_destroy(struct pool *a) DECLSPEC_HIDDEN
Definition: storage.c:51
struct symt_function * symt_new_function(struct module *module, struct symt_compiland *parent, const char *name, unsigned long addr, unsigned long size, struct symt *type) DECLSPEC_HIDDEN
Definition: symbol.c:295
unsigned source_new(struct module *module, const char *basedir, const char *source) DECLSPEC_HIDDEN
Definition: source.c:67
unsigned long SymbolsLength
Definition: rossym.h:21
unsigned int ULONG
Definition: retypes.h:1
void * sparse_array_add(struct sparse_array *sa, unsigned long key, struct pool *pool) DECLSPEC_HIDDEN
Definition: storage.c:282
unsigned long SymbolsOffset
Definition: rossym.h:20
IMAGEHLP_MODULEW64 module
Definition: rsym.c:21
base of all file and directory entries
Definition: entries.h:82
void * sparse_array_find(const struct sparse_array *sa, unsigned long idx) DECLSPEC_HIDDEN
Definition: storage.c:272
Definition: fci.c:126

Referenced by pe_load_rsym().

◆ source_get()

const char* source_get ( const struct module module,
unsigned  idx 
)

Definition at line 131 of file source.c.

132 {
133  if (idx == -1) return "";
135  return module->sources + idx;
136 }
#define assert(x)
Definition: debug.h:53
char * sources
unsigned int idx
Definition: utils.c:41

Referenced by coff_process_info(), dwarf2_set_line_number(), SymEnumLines(), SymGetLinePrev64(), symt_add_func_line(), symt_fill_func_line_info(), symt_get_func_line_next(), and symt_new_compiland().

◆ source_new()

unsigned source_new ( struct module module,
const char basedir,
const char source 
)

Definition at line 67 of file source.c.

68 {
69  unsigned ret = -1;
70  const char* full;
71  char* tmp = NULL;
72 
73  if (!name) return ret;
74  if (!base || *name == '/')
75  full = name;
76  else
77  {
78  unsigned bsz = strlen(base);
79 
80  tmp = HeapAlloc(GetProcessHeap(), 0, bsz + 1 + strlen(name) + 1);
81  if (!tmp) return ret;
82  full = tmp;
83  strcpy(tmp, base);
84  if (tmp[bsz - 1] != '/') tmp[bsz++] = '/';
85  strcpy(&tmp[bsz], name);
86  }
87  rb_module = module;
88  if (!module->sources || (ret = source_find(full)) == (unsigned)-1)
89  {
90  char* new;
91  int len = strlen(full) + 1;
92  struct source_rb* rb;
93 
95  {
96  if (!module->sources)
97  {
98  module->sources_alloc = (module->sources_used + len + 1 + 255) & ~255;
100  }
101  else
102  {
104  (module->sources_used + len + 1 + 255) & ~255 );
107  }
108  if (!new) goto done;
109  module->sources = new;
110  }
113  module->sources_used += len;
114  module->sources[module->sources_used] = '\0';
115  if ((rb = pool_alloc(&module->pool, sizeof(*rb))))
116  {
117  rb->source = ret;
119  }
120  }
121 done:
122  HeapFree(GetProcessHeap(), 0, tmp);
123  return ret;
124 }
#define max(a, b)
Definition: svc.c:63
HMODULE module
Definition: main.cpp:47
unsigned sources_alloc
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
unsigned sources_used
struct wine_rb_entry entry
Definition: source.c:37
struct wine_rb_tree sources_offsets_tree
char * sources
void * pool_alloc(struct pool *a, size_t len) DECLSPEC_HIDDEN
Definition: storage.c:90
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned source
Definition: source.c:38
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
struct pool pool
static struct module * rb_module
Definition: source.c:34
static unsigned source_find(const char *name)
Definition: source.c:53
#define HeapReAlloc
Definition: compat.h:393
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
Definition: name.c:36
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define HeapFree(x, y, z)
Definition: compat.h:394
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by codeview_snarf(), codeview_snarf_linetab(), codeview_snarf_linetab2(), coff_add_file(), dwarf2_parse_compilation_unit(), dwarf2_parse_line_numbers(), pe_load_coff_symbol_table(), rsym_parse(), and stabs_parse().

◆ source_rb_compare()

int source_rb_compare ( const void key,
const struct wine_rb_entry entry 
)

Definition at line 41 of file source.c.

42 {
43  const struct source_rb *t = WINE_RB_ENTRY_VALUE(entry, const struct source_rb, entry);
44 
45  return strcmp((const char*)key, rb_module->sources + t->source);
46 }
uint8_t entry
Definition: isohybrid.c:63
GLdouble GLdouble t
Definition: gl.h:2047
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
static struct module * rb_module
Definition: source.c:34
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
Definition: path.c:42

Referenced by module_new().

◆ sparse_array_add()

void* sparse_array_add ( struct sparse_array sa,
unsigned long  key,
struct pool pool 
)

Definition at line 282 of file storage.c.

284 {
285  unsigned idx, i;
286  struct key2index* pk2i;
287  struct key2index* to;
288 
289  pk2i = sparse_array_lookup(sa, key, &idx);
290  if (pk2i && pk2i->key == key)
291  {
292  FIXME("re-adding an existing key\n");
293  return NULL;
294  }
295  to = vector_add(&sa->key2index, pool);
296  if (pk2i)
297  {
298  /* we need to shift vector's content... */
299  /* let's do it brute force... (FIXME) */
300  assert(sa->key2index.num_elts >= 2);
301  for (i = sa->key2index.num_elts - 1; i > idx; i--)
302  {
303  pk2i = vector_at(&sa->key2index, i - 1);
304  *to = *pk2i;
305  to = pk2i;
306  }
307  }
308 
309  to->key = key;
310  to->index = sa->elements.num_elts;
311 
312  return vector_add(&sa->elements, pool);
313 }
void * vector_add(struct vector *v, struct pool *pool)
Definition: storage.c:172
unsigned index
Definition: storage.c:211
#define assert(x)
Definition: debug.h:53
static struct key2index * sparse_array_lookup(const struct sparse_array *sa, unsigned long key, unsigned *idx)
Definition: storage.c:225
unsigned long key
Definition: storage.c:210
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
void * vector_at(const struct vector *v, unsigned pos)
Definition: storage.c:163
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
HKEY key
Definition: reg.c:42
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
Definition: path.c:42

Referenced by dwarf2_parse_abbrev_set(), dwarf2_read_one_debug_info(), and rsym_parse().

◆ sparse_array_find()

void* sparse_array_find ( const struct sparse_array sa,
unsigned long  idx 
)

Definition at line 272 of file storage.c.

273 {
274  unsigned idx;
275  struct key2index* pk2i;
276 
277  if ((pk2i = sparse_array_lookup(sa, key, &idx)) && pk2i->key == key)
278  return vector_at(&sa->elements, pk2i->index);
279  return NULL;
280 }
unsigned index
Definition: storage.c:211
static struct key2index * sparse_array_lookup(const struct sparse_array *sa, unsigned long key, unsigned *idx)
Definition: storage.c:225
unsigned long key
Definition: storage.c:210
void * vector_at(const struct vector *v, unsigned pos)
Definition: storage.c:163
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
Definition: path.c:42

Referenced by dwarf2_abbrev_table_find_entry(), dwarf2_find_attribute(), dwarf2_get_cpp_name(), dwarf2_get_di_children(), dwarf2_lookup_type(), and rsym_parse().

◆ sparse_array_init()

void sparse_array_init ( struct sparse_array sa,
unsigned  elt_sz,
unsigned  bucket_sz 
)

Definition at line 214 of file storage.c.

215 {
216  vector_init(&sa->key2index, sizeof(struct key2index), bucket_sz);
217  vector_init(&sa->elements, elt_sz, bucket_sz);
218 }
void vector_init(struct vector *v, unsigned esz, unsigned bucket_sz)
Definition: storage.c:134
static struct sockaddr_in sa
Definition: adnsresfilter.c:69

Referenced by dwarf2_parse_abbrev_set(), dwarf2_parse_compilation_unit(), and rsym_parse().

◆ sparse_array_length()

unsigned sparse_array_length ( const struct sparse_array sa)

Definition at line 315 of file storage.c.

316 {
317  return sa->elements.num_elts;
318 }
static struct sockaddr_in sa
Definition: adnsresfilter.c:69

Referenced by dwarf2_parse_abbrev_set().

◆ stabs_parse()

BOOL stabs_parse ( struct module module,