ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

dbghelp_private.h
Go to the documentation of this file.
00001 /*
00002  * File dbghelp_private.h - dbghelp internal definitions
00003  *
00004  * Copyright (C) 1995, Alexandre Julliard
00005  * Copyright (C) 1996, Eric Youngdale.
00006  * Copyright (C) 1999-2000, Ulrich Weigand.
00007  * Copyright (C) 2004-2007, Eric Pouech.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00022  */
00023 
00024 #include <stdarg.h>
00025 #include "windef.h"
00026 #include "winbase.h"
00027 #include "winver.h"
00028 #include "dbghelp.h"
00029 #include "objbase.h"
00030 #include "oaidl.h"
00031 #include "winnls.h"
00032 #include "wine/list.h"
00033 #include "wine/unicode.h"
00034 #include "wine/rbtree.h"
00035 
00036 #include "cvconst.h"
00037 
00038 /* #define USE_STATS */
00039 
00040 struct pool /* poor's man */
00041 {
00042     struct list arena_list;
00043     struct list arena_full;
00044     size_t      arena_size;
00045 };
00046 
00047 void     pool_init(struct pool* a, size_t arena_size) DECLSPEC_HIDDEN;
00048 void     pool_destroy(struct pool* a) DECLSPEC_HIDDEN;
00049 void*    pool_alloc(struct pool* a, size_t len) DECLSPEC_HIDDEN;
00050 char*    pool_strdup(struct pool* a, const char* str) DECLSPEC_HIDDEN;
00051 
00052 struct vector
00053 {
00054     void**      buckets;
00055     unsigned    elt_size;
00056     unsigned    shift;
00057     unsigned    num_elts;
00058     unsigned    num_buckets;
00059     unsigned    buckets_allocated;
00060 };
00061 
00062 void     vector_init(struct vector* v, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN;
00063 unsigned vector_length(const struct vector* v) DECLSPEC_HIDDEN;
00064 void*    vector_at(const struct vector* v, unsigned pos) DECLSPEC_HIDDEN;
00065 void*    vector_add(struct vector* v, struct pool* pool) DECLSPEC_HIDDEN;
00066 
00067 struct sparse_array
00068 {
00069     struct vector               key2index;
00070     struct vector               elements;
00071 };
00072 
00073 void     sparse_array_init(struct sparse_array* sa, unsigned elt_sz, unsigned bucket_sz) DECLSPEC_HIDDEN;
00074 void*    sparse_array_find(const struct sparse_array* sa, unsigned long idx) DECLSPEC_HIDDEN;
00075 void*    sparse_array_add(struct sparse_array* sa, unsigned long key, struct pool* pool) DECLSPEC_HIDDEN;
00076 unsigned sparse_array_length(const struct sparse_array* sa) DECLSPEC_HIDDEN;
00077 
00078 struct hash_table_elt
00079 {
00080     const char*                 name;
00081     struct hash_table_elt*      next;
00082 };
00083 
00084 struct hash_table_bucket
00085 {
00086     struct hash_table_elt*      first;
00087     struct hash_table_elt*      last;
00088 };
00089 
00090 struct hash_table
00091 {
00092     unsigned                    num_elts;
00093     unsigned                    num_buckets;
00094     struct hash_table_bucket*   buckets;
00095     struct pool*                pool;
00096 };
00097 
00098 void     hash_table_init(struct pool* pool, struct hash_table* ht,
00099                          unsigned num_buckets) DECLSPEC_HIDDEN;
00100 void     hash_table_destroy(struct hash_table* ht) DECLSPEC_HIDDEN;
00101 void     hash_table_add(struct hash_table* ht, struct hash_table_elt* elt) DECLSPEC_HIDDEN;
00102 
00103 struct hash_table_iter
00104 {
00105     const struct hash_table*    ht;
00106     struct hash_table_elt*      element;
00107     int                         index;
00108     int                         last;
00109 };
00110 
00111 void     hash_table_iter_init(const struct hash_table* ht,
00112                               struct hash_table_iter* hti, const char* name) DECLSPEC_HIDDEN;
00113 void*    hash_table_iter_up(struct hash_table_iter* hti) DECLSPEC_HIDDEN;
00114 
00115 #define GET_ENTRY(__i, __t, __f) \
00116     ((__t*)((char*)(__i) - FIELD_OFFSET(__t,__f)))
00117 
00118 
00119 extern unsigned dbghelp_options DECLSPEC_HIDDEN;
00120 /* some more Wine extensions */
00121 #define SYMOPT_WINE_WITH_NATIVE_MODULES 0x40000000
00122 
00123 enum location_kind {loc_error,          /* reg is the error code */
00124                     loc_unavailable,    /* location is not available */
00125                     loc_absolute,       /* offset is the location */
00126                     loc_register,       /* reg is the location */
00127                     loc_regrel,         /* [reg+offset] is the location */
00128                     loc_tlsrel,         /* offset is the address of the TLS index */
00129                     loc_user,           /* value is debug information dependent,
00130                                            reg & offset can be used ad libidem */
00131 };
00132 
00133 enum location_error {loc_err_internal = -1,     /* internal while computing */
00134                      loc_err_too_complex = -2,  /* couldn't compute location (even at runtime) */
00135                      loc_err_out_of_scope = -3, /* variable isn't available at current address */
00136                      loc_err_cant_read = -4,    /* couldn't read memory at given address */
00137                      loc_err_no_location = -5,  /* likely optimized away (by compiler) */
00138 };
00139 
00140 struct location
00141 {
00142     unsigned            kind : 8,
00143                         reg;
00144     unsigned long       offset;
00145 };
00146 
00147 struct symt
00148 {
00149     enum SymTagEnum             tag;
00150 };
00151 
00152 struct symt_ht
00153 {
00154     struct symt                 symt;
00155     struct hash_table_elt       hash_elt;        /* if global symbol or type */
00156 };
00157 
00158 /* lexical tree */
00159 struct symt_block
00160 {
00161     struct symt                 symt;
00162     unsigned long               address;
00163     unsigned long               size;
00164     struct symt*                container;      /* block, or func */
00165     struct vector               vchildren;      /* sub-blocks & local variables */
00166 };
00167 
00168 struct symt_compiland
00169 {
00170     struct symt                 symt;
00171     unsigned long               address;
00172     unsigned                    source;
00173     struct vector               vchildren;      /* global variables & functions */
00174 };
00175 
00176 struct symt_data
00177 {
00178     struct symt                 symt;
00179     struct hash_table_elt       hash_elt;       /* if global symbol */
00180     enum DataKind               kind;
00181     struct symt*                container;
00182     struct symt*                type;
00183     union                                       /* depends on kind */
00184     {
00185         /* DataIs{Global, FileStatic}:
00186          *      with loc.kind
00187          *              loc_absolute    loc.offset is address
00188          *              loc_tlsrel      loc.offset is TLS index address
00189          * DataIs{Local,Param}:
00190          *      with loc.kind
00191          *              loc_absolute    not supported
00192          *              loc_register    location is in register loc.reg
00193          *              loc_regrel      location is at address loc.reg + loc.offset
00194          *              >= loc_user     ask debug info provider for resolution
00195          */
00196         struct location         var;
00197         /* DataIs{Member} (all values are in bits, not bytes) */
00198         struct
00199         {
00200             long                        offset;
00201             unsigned long               length;
00202         } member;
00203         /* DataIsConstant */
00204         VARIANT                 value;
00205     } u;
00206 };
00207 
00208 struct symt_function
00209 {
00210     struct symt                 symt;
00211     struct hash_table_elt       hash_elt;       /* if global symbol */
00212     unsigned long               address;
00213     struct symt*                container;      /* compiland */
00214     struct symt*                type;           /* points to function_signature */
00215     unsigned long               size;
00216     struct vector               vlines;
00217     struct vector               vchildren;      /* locals, params, blocks, start/end, labels */
00218 };
00219 
00220 struct symt_hierarchy_point
00221 {
00222     struct symt                 symt;           /* either SymTagFunctionDebugStart, SymTagFunctionDebugEnd, SymTagLabel */
00223     struct hash_table_elt       hash_elt;       /* if label (and in compiland's hash table if global) */
00224     struct symt*                parent;         /* symt_function or symt_compiland */
00225     struct location             loc;
00226 };
00227 
00228 struct symt_public
00229 {
00230     struct symt                 symt;
00231     struct hash_table_elt       hash_elt;
00232     struct symt*                container;      /* compiland */
00233     unsigned long               address;
00234     unsigned long               size;
00235 };
00236 
00237 struct symt_thunk
00238 {
00239     struct symt                 symt;
00240     struct hash_table_elt       hash_elt;
00241     struct symt*                container;      /* compiland */
00242     unsigned long               address;
00243     unsigned long               size;
00244     THUNK_ORDINAL               ordinal;        /* FIXME: doesn't seem to be accessible */
00245 };
00246 
00247 /* class tree */
00248 struct symt_array
00249 {
00250     struct symt                 symt;
00251     int                     start;
00252     int                     end;            /* end index if > 0, or -array_len (in bytes) if < 0 */
00253     struct symt*                base_type;
00254     struct symt*                index_type;
00255 };
00256 
00257 struct symt_basic
00258 {
00259     struct symt                 symt;
00260     struct hash_table_elt       hash_elt;
00261     enum BasicType              bt;
00262     unsigned long               size;
00263 };
00264 
00265 struct symt_enum
00266 {
00267     struct symt                 symt;
00268     struct symt*                base_type;
00269     const char*                 name;
00270     struct vector               vchildren;
00271 };
00272 
00273 struct symt_function_signature
00274 {
00275     struct symt                 symt;
00276     struct symt*                rettype;
00277     struct vector               vchildren;
00278     enum CV_call_e              call_conv;
00279 };
00280 
00281 struct symt_function_arg_type
00282 {
00283     struct symt                 symt;
00284     struct symt*                arg_type;
00285     struct symt*                container;
00286 };
00287 
00288 struct symt_pointer
00289 {
00290     struct symt                 symt;
00291     struct symt*                pointsto;
00292     unsigned long               size;
00293 };
00294 
00295 struct symt_typedef
00296 {
00297     struct symt                 symt;
00298     struct hash_table_elt       hash_elt;
00299     struct symt*                type;
00300 };
00301 
00302 struct symt_udt
00303 {
00304     struct symt                 symt;
00305     struct hash_table_elt       hash_elt;
00306     enum UdtKind                kind;
00307     int                     size;
00308     struct vector               vchildren;
00309 };
00310 
00311 enum module_type
00312 {
00313     DMT_UNKNOWN,        /* for lookup, not actually used for a module */
00314     DMT_ELF,            /* a real ELF shared module */
00315     DMT_PE,             /* a native or builtin PE module */
00316     DMT_MACHO,          /* a real Mach-O shared module */
00317     DMT_PDB,            /* .PDB file */
00318     DMT_DBG,            /* .DBG file */
00319 };
00320 
00321 struct process;
00322 struct module;
00323 
00324 /* a module can be made of several debug information formats, so we have to
00325  * support them all
00326  */
00327 enum format_info
00328 {
00329     DFI_ELF,
00330     DFI_PE,
00331     DFI_MACHO,
00332     DFI_DWARF,
00333     DFI_PDB,
00334     DFI_LAST
00335 };
00336 
00337 struct module_format
00338 {
00339     struct module*              module;
00340     void                        (*remove)(struct process* pcs, struct module_format* modfmt);
00341     void                        (*loc_compute)(struct process* pcs,
00342                                                const struct module_format* modfmt,
00343                                                const struct symt_function* func,
00344                                                struct location* loc);
00345     union
00346     {
00347         struct elf_module_info*         elf_info;
00348         struct dwarf2_module_info_s*    dwarf2_info;
00349         struct pe_module_info*          pe_info;
00350         struct macho_module_info*   macho_info;
00351         struct pdb_module_info*         pdb_info;
00352     } u;
00353 };
00354 
00355 extern const struct wine_rb_functions source_rb_functions DECLSPEC_HIDDEN;
00356 struct module
00357 {
00358     struct process*             process;
00359     IMAGEHLP_MODULEW64          module;
00360     /* ANSI copy of module.ModuleName for efficiency */
00361     char                        module_name[MAX_PATH];
00362     struct module*              next;
00363     enum module_type        type : 16;
00364     unsigned short              is_virtual : 1;
00365     DWORD64                     reloc_delta;
00366 
00367     /* specific information for debug types */
00368     struct module_format*       format_info[DFI_LAST];
00369 
00370     /* memory allocation pool */
00371     struct pool                 pool;
00372 
00373     /* symbols & symbol tables */
00374     struct vector               vsymt;
00375     int                         sortlist_valid;
00376     unsigned                    num_sorttab;    /* number of symbols with addresses */
00377     unsigned                    num_symbols;
00378     unsigned                    sorttab_size;
00379     struct symt_ht**            addr_sorttab;
00380     struct hash_table           ht_symbols;
00381 
00382     /* types */
00383     struct hash_table           ht_types;
00384     struct vector               vtypes;
00385 
00386     /* source files */
00387     unsigned                    sources_used;
00388     unsigned                    sources_alloc;
00389     char*                       sources;
00390     struct wine_rb_tree         sources_offsets_tree;
00391 };
00392 
00393 struct process 
00394 {
00395     struct process*             next;
00396     HANDLE                      handle;
00397     WCHAR*                      search_path;
00398 
00399     PSYMBOL_REGISTERED_CALLBACK64       reg_cb;
00400     PSYMBOL_REGISTERED_CALLBACK reg_cb32;
00401     BOOL                        reg_is_unicode;
00402     DWORD64                     reg_user;
00403 
00404     struct module*              lmodules;
00405     unsigned long               dbg_hdr_addr;
00406 
00407     IMAGEHLP_STACK_FRAME        ctx_frame;
00408 
00409     unsigned                    buffer_size;
00410     void*                       buffer;
00411 };
00412 
00413 struct line_info
00414 {
00415     unsigned long               is_first : 1,
00416                                 is_last : 1,
00417                                 is_source_file : 1,
00418                                 line_number;
00419     union
00420     {
00421         unsigned long               pc_offset;   /* if is_source_file isn't set */
00422         unsigned                    source_file; /* if is_source_file is set */
00423     } u;
00424 };
00425 
00426 struct module_pair
00427 {
00428     struct process*             pcs;
00429     struct module*              requested; /* in:  to module_get_debug() */
00430     struct module*              effective; /* out: module with debug info */
00431 };
00432 
00433 enum pdb_kind {PDB_JG, PDB_DS};
00434 
00435 struct pdb_lookup
00436 {
00437     const char*                 filename;
00438     enum pdb_kind               kind;
00439     DWORD                       age;
00440     DWORD                       timestamp;
00441     GUID                        guid;
00442 };
00443 
00444 struct cpu_stack_walk
00445 {
00446     HANDLE                      hProcess;
00447     HANDLE                      hThread;
00448     BOOL                        is32;
00449     union
00450     {
00451         struct
00452         {
00453             PREAD_PROCESS_MEMORY_ROUTINE        f_read_mem;
00454             PTRANSLATE_ADDRESS_ROUTINE          f_xlat_adr;
00455             PFUNCTION_TABLE_ACCESS_ROUTINE      f_tabl_acs;
00456             PGET_MODULE_BASE_ROUTINE            f_modl_bas;
00457         } s32;
00458         struct
00459         {
00460             PREAD_PROCESS_MEMORY_ROUTINE64      f_read_mem;
00461             PTRANSLATE_ADDRESS_ROUTINE64        f_xlat_adr;
00462             PFUNCTION_TABLE_ACCESS_ROUTINE64    f_tabl_acs;
00463             PGET_MODULE_BASE_ROUTINE64          f_modl_bas;
00464         } s64;
00465     } u;
00466 };
00467 
00468 enum cpu_addr {cpu_addr_pc, cpu_addr_stack, cpu_addr_frame};
00469 struct cpu
00470 {
00471     DWORD       machine;
00472     DWORD       word_size;
00473     DWORD       frame_regno;
00474 
00475     /* address manipulation */
00476     unsigned    (*get_addr)(HANDLE hThread, const CONTEXT* ctx,
00477                             enum cpu_addr, ADDRESS64* addr);
00478 
00479     /* stack manipulation */
00480     BOOL        (*stack_walk)(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context);
00481 
00482     /* module manipulation */
00483     void*       (*find_runtime_function)(struct module*, DWORD64 addr);
00484 
00485     /* dwarf dedicated information */
00486     unsigned    (*map_dwarf_register)(unsigned regno);
00487 
00488     /* context related manipulation */
00489     void*       (*fetch_context_reg)(CONTEXT* context, unsigned regno, unsigned* size);
00490     const char* (*fetch_regname)(unsigned regno);
00491 };
00492 
00493 extern struct cpu*      dbghelp_current_cpu DECLSPEC_HIDDEN;
00494 
00495 /* dbghelp.c */
00496 extern struct process* process_find_by_handle(HANDLE hProcess) DECLSPEC_HIDDEN;
00497 extern HANDLE hMsvcrt DECLSPEC_HIDDEN;
00498 extern BOOL         validate_addr64(DWORD64 addr) DECLSPEC_HIDDEN;
00499 extern BOOL         pcs_callback(const struct process* pcs, ULONG action, void* data) DECLSPEC_HIDDEN;
00500 extern void*        fetch_buffer(struct process* pcs, unsigned size) DECLSPEC_HIDDEN;
00501 extern const char*  wine_dbgstr_addr(const ADDRESS64* addr) DECLSPEC_HIDDEN;
00502 extern struct cpu*  cpu_find(DWORD) DECLSPEC_HIDDEN;
00503 
00504 /* crc32.c */
00505 extern DWORD calc_crc32(int fd) DECLSPEC_HIDDEN;
00506 
00507 typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
00508 
00509 /* elf_module.c */
00510 extern BOOL         elf_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN;
00511 extern BOOL         elf_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN;
00512 struct image_file_map;
00513 extern BOOL         elf_load_debug_info(struct module* module) DECLSPEC_HIDDEN;
00514 extern struct module*
00515                     elf_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN;
00516 extern BOOL         elf_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN;
00517 extern BOOL         elf_synchronize_module_list(struct process* pcs) DECLSPEC_HIDDEN;
00518 struct elf_thunk_area;
00519 extern int          elf_is_in_thunk_area(unsigned long addr, const struct elf_thunk_area* thunks) DECLSPEC_HIDDEN;
00520 
00521 /* macho_module.c */
00522 #define MACHO_NO_MAP    ((const void*)-1)
00523 extern BOOL         macho_enum_modules(HANDLE hProc, enum_modules_cb, void*) DECLSPEC_HIDDEN;
00524 extern BOOL         macho_fetch_file_info(const WCHAR* name, DWORD_PTR* base, DWORD* size, DWORD* checksum) DECLSPEC_HIDDEN;
00525 struct macho_file_map;
00526 extern BOOL         macho_load_debug_info(struct module* module, struct macho_file_map* fmap) DECLSPEC_HIDDEN;
00527 extern struct module*
00528                     macho_load_module(struct process* pcs, const WCHAR* name, unsigned long) DECLSPEC_HIDDEN;
00529 extern BOOL         macho_read_wine_loader_dbg_info(struct process* pcs) DECLSPEC_HIDDEN;
00530 extern BOOL         macho_synchronize_module_list(struct process* pcs) DECLSPEC_HIDDEN;
00531 
00532 /* module.c */
00533 extern const WCHAR      S_ElfW[] DECLSPEC_HIDDEN;
00534 extern const WCHAR      S_WineLoaderW[] DECLSPEC_HIDDEN;
00535 extern const WCHAR      S_SlashW[] DECLSPEC_HIDDEN;
00536 
00537 extern struct module*
00538                     module_find_by_addr(const struct process* pcs, unsigned long addr,
00539                                         enum module_type type) DECLSPEC_HIDDEN;
00540 extern struct module*
00541                     module_find_by_nameW(const struct process* pcs,
00542                                          const WCHAR* name) DECLSPEC_HIDDEN;
00543 extern struct module*
00544                     module_find_by_nameA(const struct process* pcs,
00545                                          const char* name) DECLSPEC_HIDDEN;
00546 extern struct module*
00547                     module_is_already_loaded(const struct process* pcs,
00548                                              const WCHAR* imgname) DECLSPEC_HIDDEN;
00549 extern BOOL         module_get_debug(struct module_pair*) DECLSPEC_HIDDEN;
00550 extern struct module*
00551                     module_new(struct process* pcs, const WCHAR* name,
00552                                enum module_type type, BOOL virtual,
00553                                DWORD64 addr, DWORD64 size,
00554                                unsigned long stamp, unsigned long checksum) DECLSPEC_HIDDEN;
00555 extern struct module*
00556                     module_get_containee(const struct process* pcs,
00557                                          const struct module* inner) DECLSPEC_HIDDEN;
00558 extern enum module_type
00559                     module_get_type_by_name(const WCHAR* name) DECLSPEC_HIDDEN;
00560 extern void         module_reset_debug_info(struct module* module) DECLSPEC_HIDDEN;
00561 extern BOOL         module_remove(struct process* pcs,
00562                                   struct module* module) DECLSPEC_HIDDEN;
00563 extern void         module_set_module(struct module* module, const WCHAR* name) DECLSPEC_HIDDEN;
00564 extern const WCHAR *get_wine_loader_name(void) DECLSPEC_HIDDEN;
00565 
00566 /* msc.c */
00567 extern BOOL         pe_load_debug_directory(const struct process* pcs,
00568                                             struct module* module, 
00569                                             const BYTE* mapping,
00570                                             const IMAGE_SECTION_HEADER* sectp, DWORD nsect,
00571                                             const IMAGE_DEBUG_DIRECTORY* dbg, int nDbg) DECLSPEC_HIDDEN;
00572 extern BOOL         pdb_fetch_file_info(const struct pdb_lookup* pdb_lookup, unsigned* matched) DECLSPEC_HIDDEN;
00573 struct pdb_cmd_pair {
00574     const char*         name;
00575     DWORD*              pvalue;
00576 };
00577 extern BOOL         pdb_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip,
00578                                        CONTEXT* context, struct pdb_cmd_pair* cpair) DECLSPEC_HIDDEN;
00579 
00580 /* path.c */
00581 extern BOOL         path_find_symbol_file(const struct process* pcs, PCSTR full_path,
00582                                           const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer,
00583                                           BOOL* is_unmatched) DECLSPEC_HIDDEN;
00584 
00585 /* pe_module.c */
00586 extern BOOL         pe_load_nt_header(HANDLE hProc, DWORD64 base, IMAGE_NT_HEADERS* nth) DECLSPEC_HIDDEN;
00587 extern struct module*
00588                     pe_load_native_module(struct process* pcs, const WCHAR* name,
00589                                           HANDLE hFile, DWORD64 base, DWORD size) DECLSPEC_HIDDEN;
00590 extern struct module*
00591                     pe_load_builtin_module(struct process* pcs, const WCHAR* name,
00592                                            DWORD64 base, DWORD64 size) DECLSPEC_HIDDEN;
00593 extern BOOL         pe_load_debug_info(const struct process* pcs,
00594                                        struct module* module) DECLSPEC_HIDDEN;
00595 extern const char*  pe_map_directory(struct module* module, int dirno, DWORD* size) DECLSPEC_HIDDEN;
00596 extern void         pe_unmap_directoy(struct module* module, int dirno) DECLSPEC_HIDDEN;
00597 
00598 /* source.c */
00599 extern unsigned     source_new(struct module* module, const char* basedir, const char* source) DECLSPEC_HIDDEN;
00600 extern const char*  source_get(const struct module* module, unsigned idx) DECLSPEC_HIDDEN;
00601 
00602 /* stabs.c */
00603 typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset,
00604                                 const char* name, unsigned long offset,
00605                                 BOOL is_public, BOOL is_global, unsigned char other,
00606                                 struct symt_compiland* compiland, void* user);
00607 extern BOOL         stabs_parse(struct module* module, unsigned long load_offset,
00608                                 const void* stabs, int stablen,
00609                                 const char* strs, int strtablen,
00610                                 stabs_def_cb callback, void* user) DECLSPEC_HIDDEN;
00611 
00612 /* dwarf.c */
00613 extern BOOL         dwarf2_parse(struct module* module, unsigned long load_offset,
00614                                  const struct elf_thunk_area* thunks,
00615                                  struct image_file_map* fmap) DECLSPEC_HIDDEN;
00616 extern BOOL         dwarf2_virtual_unwind(struct cpu_stack_walk* csw, DWORD_PTR ip,
00617                                           CONTEXT* context, ULONG_PTR* cfa) DECLSPEC_HIDDEN;
00618 
00619 /* stack.c */
00620 extern BOOL         sw_read_mem(struct cpu_stack_walk* csw, DWORD64 addr, void* ptr, DWORD sz) DECLSPEC_HIDDEN;
00621 extern DWORD64      sw_xlat_addr(struct cpu_stack_walk* csw, ADDRESS64* addr) DECLSPEC_HIDDEN;
00622 extern void*        sw_table_access(struct cpu_stack_walk* csw, DWORD64 addr) DECLSPEC_HIDDEN;
00623 extern DWORD64      sw_module_base(struct cpu_stack_walk* csw, DWORD64 addr) DECLSPEC_HIDDEN;
00624 
00625 /* symbol.c */
00626 extern const char*  symt_get_name(const struct symt* sym) DECLSPEC_HIDDEN;
00627 extern BOOL         symt_get_address(const struct symt* type, ULONG64* addr) DECLSPEC_HIDDEN;
00628 extern int          symt_cmp_addr(const void* p1, const void* p2) DECLSPEC_HIDDEN;
00629 extern void         copy_symbolW(SYMBOL_INFOW* siw, const SYMBOL_INFO* si) DECLSPEC_HIDDEN;
00630 extern struct symt_ht*
00631                     symt_find_nearest(struct module* module, DWORD_PTR addr) DECLSPEC_HIDDEN;
00632 extern struct symt_compiland*
00633                     symt_new_compiland(struct module* module, unsigned long address,
00634                                        unsigned src_idx) DECLSPEC_HIDDEN;
00635 extern struct symt_public*
00636                     symt_new_public(struct module* module, 
00637                                     struct symt_compiland* parent, 
00638                                     const char* typename,
00639                                     unsigned long address, unsigned size) DECLSPEC_HIDDEN;
00640 extern struct symt_data*
00641                     symt_new_global_variable(struct module* module, 
00642                                              struct symt_compiland* parent,
00643                                              const char* name, unsigned is_static,
00644                                              struct location loc, unsigned long size,
00645                                              struct symt* type) DECLSPEC_HIDDEN;
00646 extern struct symt_function*
00647                     symt_new_function(struct module* module,
00648                                       struct symt_compiland* parent,
00649                                       const char* name,
00650                                       unsigned long addr, unsigned long size,
00651                                       struct symt* type) DECLSPEC_HIDDEN;
00652 extern BOOL         symt_normalize_function(struct module* module, 
00653                                             const struct symt_function* func) DECLSPEC_HIDDEN;
00654 extern void         symt_add_func_line(struct module* module,
00655                                        struct symt_function* func, 
00656                                        unsigned source_idx, int line_num, 
00657                                        unsigned long offset) DECLSPEC_HIDDEN;
00658 extern struct symt_data*
00659                     symt_add_func_local(struct module* module, 
00660                                         struct symt_function* func, 
00661                                         enum DataKind dt, const struct location* loc,
00662                                         struct symt_block* block,
00663                                         struct symt* type, const char* name) DECLSPEC_HIDDEN;
00664 extern struct symt_block*
00665                     symt_open_func_block(struct module* module, 
00666                                          struct symt_function* func,
00667                                          struct symt_block* block, 
00668                                          unsigned pc, unsigned len) DECLSPEC_HIDDEN;
00669 extern struct symt_block*
00670                     symt_close_func_block(struct module* module, 
00671                                           const struct symt_function* func,
00672                                           struct symt_block* block, unsigned pc) DECLSPEC_HIDDEN;
00673 extern struct symt_hierarchy_point*
00674                     symt_add_function_point(struct module* module, 
00675                                             struct symt_function* func,
00676                                             enum SymTagEnum point, 
00677                                             const struct location* loc,
00678                                             const char* name) DECLSPEC_HIDDEN;
00679 extern BOOL         symt_fill_func_line_info(const struct module* module,
00680                                              const struct symt_function* func,
00681                                              DWORD64 addr, IMAGEHLP_LINE64* line) DECLSPEC_HIDDEN;
00682 extern BOOL         symt_get_func_line_next(const struct module* module, PIMAGEHLP_LINE64 line) DECLSPEC_HIDDEN;
00683 extern struct symt_thunk*
00684                     symt_new_thunk(struct module* module, 
00685                                    struct symt_compiland* parent,
00686                                    const char* name, THUNK_ORDINAL ord,
00687                                    unsigned long addr, unsigned long size) DECLSPEC_HIDDEN;
00688 extern struct symt_data*
00689                     symt_new_constant(struct module* module,
00690                                       struct symt_compiland* parent,
00691                                       const char* name, struct symt* type,
00692                                       const VARIANT* v) DECLSPEC_HIDDEN;
00693 extern struct symt_hierarchy_point*
00694                     symt_new_label(struct module* module,
00695                                    struct symt_compiland* compiland,
00696                                    const char* name, unsigned long address) DECLSPEC_HIDDEN;
00697 extern struct symt* symt_index2ptr(struct module* module, DWORD id) DECLSPEC_HIDDEN;
00698 extern DWORD        symt_ptr2index(struct module* module, const struct symt* sym) DECLSPEC_HIDDEN;
00699 
00700 /* type.c */
00701 extern void         symt_init_basic(struct module* module) DECLSPEC_HIDDEN;
00702 extern BOOL         symt_get_info(struct module* module, const struct symt* type,
00703                                   IMAGEHLP_SYMBOL_TYPE_INFO req, void* pInfo) DECLSPEC_HIDDEN;
00704 extern struct symt_basic*
00705                     symt_new_basic(struct module* module, enum BasicType, 
00706                                    const char* typename, unsigned size) DECLSPEC_HIDDEN;
00707 extern struct symt_udt*
00708                     symt_new_udt(struct module* module, const char* typename,
00709                                  unsigned size, enum UdtKind kind) DECLSPEC_HIDDEN;
00710 extern BOOL         symt_set_udt_size(struct module* module,
00711                                       struct symt_udt* type, unsigned size) DECLSPEC_HIDDEN;
00712 extern BOOL         symt_add_udt_element(struct module* module, 
00713                                          struct symt_udt* udt_type, 
00714                                          const char* name,
00715                                          struct symt* elt_type, unsigned offset, 
00716                                          unsigned size) DECLSPEC_HIDDEN;
00717 extern struct symt_enum*
00718                     symt_new_enum(struct module* module, const char* typename,
00719                                   struct symt* basetype) DECLSPEC_HIDDEN;
00720 extern BOOL         symt_add_enum_element(struct module* module, 
00721                                           struct symt_enum* enum_type, 
00722                                           const char* name, int value) DECLSPEC_HIDDEN;
00723 extern struct symt_array*
00724                     symt_new_array(struct module* module, int min, int max, 
00725                                    struct symt* base, struct symt* index) DECLSPEC_HIDDEN;
00726 extern struct symt_function_signature*
00727                     symt_new_function_signature(struct module* module, 
00728                                                 struct symt* ret_type,
00729                                                 enum CV_call_e call_conv) DECLSPEC_HIDDEN;
00730 extern BOOL         symt_add_function_signature_parameter(struct module* module,
00731                                                           struct symt_function_signature* sig,
00732                                                           struct symt* param) DECLSPEC_HIDDEN;
00733 extern struct symt_pointer*
00734                     symt_new_pointer(struct module* module, 
00735                                      struct symt* ref_type,
00736                                      unsigned long size) DECLSPEC_HIDDEN;
00737 extern struct symt_typedef*
00738                     symt_new_typedef(struct module* module, struct symt* ref, 
00739                                      const char* name) DECLSPEC_HIDDEN;

Generated on Thu May 24 2012 04:23:42 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.