~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/programs/winedbg/debugger.h

Version: ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~ [ wine-1.0-rc5 ] ~ [ wine-1.0-rc4 ] ~ [ wine-1.0-rc3 ] ~ [ wine-1.0-rc2 ] ~ [ wine-1.0-rc1 ] ~ [ wine-0.9.61 ] ~ [ wine-0.9.60 ] ~ [ wine-0.9.59 ] ~ [ wine-0.9.58 ] ~ [ wine-0.9.57 ] ~ [ wine-0.9.56 ] ~ [ wine-0.9.55 ] ~ [ wine-0.9.54 ] ~ [ wine-0.9.53 ] ~ [ wine-0.9.52 ] ~ [ wine-0.9.51 ] ~ [ wine-0.9.50 ] ~ [ wine-0.9.49 ] ~ [ wine-0.9.48 ] ~ [ wine-0.9.47 ] ~ [ wine-0.9.46 ] ~ [ wine-0.9.45 ] ~ [ wine-0.9.44 ] ~ [ wine-0.9.43 ] ~ [ wine-0.9.42 ] ~ [ wine-0.9.41 ] ~ [ wine-0.9.40 ] ~ [ wine-0.9.39 ] ~ [ wine-0.9.38 ] ~ [ wine-0.9.37 ] ~ [ wine-0.9.36 ] ~ [ wine-0.9.35 ] ~ [ wine-0.9.34 ] ~ [ wine-0.9.33 ] ~ [ wine-0.9.32 ] ~ [ wine-0.9.31 ] ~ [ wine-0.9.30 ] ~ [ wine-0.9.29 ] ~ [ wine-0.9.28 ] ~ [ wine-0.9.27 ] ~ [ wine-0.9.26 ] ~ [ wine-0.9.25 ] ~ [ wine-0.9.24 ] ~ [ wine-0.9.23 ] ~ [ wine-0.9.22 ] ~ [ wine-0.9.21 ] ~ [ wine-0.9.20 ] ~ [ wine-0.9.19 ] ~ [ wine-0.9.18 ] ~ [ wine-0.9.17 ] ~ [ wine-0.9.16 ] ~ [ wine-0.9.15 ] ~ [ wine-0.9.14 ] ~ [ wine-0.9.13 ] ~ [ wine-0.9.12 ] ~ [ wine-0.9.11 ] ~ [ wine-0.9.10 ] ~ [ wine-0.9.9 ] ~ [ wine-0.9.8 ] ~ [ wine-0.9.7 ] ~ [ wine-0.9.6 ] ~ [ wine-0.9.5 ] ~ [ wine-0.9.4 ] ~ [ wine-0.9.3 ] ~ [ wine-0.9.2 ] ~ [ wine-0.9.1 ] ~ [ wine-0.9 ] ~ [ wine20050930 ] ~ [ wine20050830 ] ~ [ wine20050725 ] ~ [ wine20050628 ] ~ [ wine20050524 ] ~ [ wine20050419 ] ~ [ wine20050310 ] ~ [ wine20050211 ] ~ [ wine20050111 ] ~ [ wine20041201 ] ~ [ wine20041019 ] ~ [ wine20040914 ] ~ [ wine20040813 ] ~ [ wine20040716 ] ~ [ wine20040615 ] ~ [ wine20040505 ] ~ [ wine20040408 ] ~ [ wine20040309 ] ~ [ wine20040213 ] ~ [ wine20040121 ] ~ [ wine20031212 ] ~ [ wine20031118 ] ~ [ wine20031016 ] ~ [ wine20030911 ] ~ [ wine20030813 ] ~ [ wine20030709 ] ~ [ wine20030618 ] ~ [ wine20030508 ] ~ [ wine20030408 ] ~ [ wine20030318 ] ~ [ wine20030219 ] ~ [ wine20030115 ] ~ [ wine20021219 ] ~ [ wine20021125 ] ~ [ wine20021031 ] ~ [ wine20021007 ] ~ [ wine20020904 ] ~ [ wine20020804 ] ~ [ wine20020710 ] ~ [ wine20020605 ] ~ [ wine20020509 ] ~ [ wine20020411 ] ~ [ wine20020310 ] ~ [ wine20020228 ] ~ [ wine20011226 ] ~ [ wine20011108 ] ~ [ wine20011004 ] ~ [ wine20010824 ] ~ [ wine20010731 ] ~ [ wine20010629 ] ~ [ wine20010510 ] ~ [ wine20010418 ] ~ [ wine20010326 ] ~ [ wine20010305 ] ~ [ wine20010216 ] ~ [ wine20010112 ] ~ [ wine20001222 ] ~ [ wine20001202 ] ~ [ wine20001026 ] ~ [ wine20001002 ] ~ [ wine20000909 ] ~ [ wine20000821 ] ~ [ wine20000801 ] ~ [ wine20000716 ] ~ [ wine20000326 ] ~ [ wine20000227 ] ~ [ wine20000130 ] ~ [ wine20000109 ] ~

  1 /*
  2  * Debugger definitions
  3  *
  4  * Copyright 1995 Alexandre Julliard
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #ifndef __WINE_DEBUGGER_H
 22 #define __WINE_DEBUGGER_H
 23 
 24 #include <assert.h>
 25 #include <stdarg.h>
 26 
 27 #define NONAMELESSUNION
 28 #define NONAMELESSSTRUCT
 29 #include "ntstatus.h"
 30 #define WIN32_NO_STATUS
 31 #define WIN32_LEAN_AND_MEAN
 32 #include "windef.h"
 33 #include "winbase.h"
 34 #include "winver.h"
 35 #include "winternl.h"
 36 #include "dbghelp.h"
 37 #include "cvconst.h"
 38 #include "objbase.h"
 39 #include "oaidl.h"
 40 
 41 /* the debugger uses these exceptions for it's internal use */
 42 #define DEBUG_STATUS_OFFSET             0x80003000
 43 #define DEBUG_STATUS_INTERNAL_ERROR     (DEBUG_STATUS_OFFSET+0) /* something went wrong */
 44 #define DEBUG_STATUS_NO_SYMBOL          (DEBUG_STATUS_OFFSET+1) /* no symbol found in lookup */
 45 #define DEBUG_STATUS_DIV_BY_ZERO        (DEBUG_STATUS_OFFSET+2)
 46 #define DEBUG_STATUS_BAD_TYPE           (DEBUG_STATUS_OFFSET+3) /* no type found, when type was expected */
 47 #define DEBUG_STATUS_NO_FIELD           (DEBUG_STATUS_OFFSET+4) /* when dereferencing a struct, the field was not found */
 48 #define DEBUG_STATUS_ABORT              (DEBUG_STATUS_OFFSET+5) /* user aborted on going action */
 49 #define DEBUG_STATUS_CANT_DEREF         (DEBUG_STATUS_OFFSET+6) /* either not deref:able, or index out of bounds */
 50 #define DEBUG_STATUS_NOT_AN_INTEGER     (DEBUG_STATUS_OFFSET+7) /* requiring an integral value */
 51 
 52 /*
 53  * Return values for symbol_get_function_line_status.  Used to determine
 54  * what to do when the 'step' command is given.
 55  */
 56 enum dbg_line_status
 57 {
 58     dbg_no_line_info,
 59     dbg_not_on_a_line_number,
 60     dbg_on_a_line_number,
 61     dbg_in_a_thunk,
 62 };
 63 
 64 enum dbg_internal_types
 65 {
 66     dbg_itype_first             = 0xffffff00,
 67     dbg_itype_unsigned_int,
 68     dbg_itype_signed_int,
 69     dbg_itype_signed_char_int,
 70     dbg_itype_unsigned_char_int,
 71     dbg_itype_unsigned_short_int,
 72     dbg_itype_signed_short_int,
 73     dbg_itype_unsigned_long_int,
 74     dbg_itype_signed_long_int,
 75     dbg_itype_unsigned_longlong_int,
 76     dbg_itype_signed_longlong_int,
 77     dbg_itype_char,
 78     dbg_itype_wchar,
 79     dbg_itype_short_real, /* aka float */
 80     dbg_itype_real,       /* aka double */
 81     dbg_itype_long_real,  /* aka long double */
 82     dbg_itype_astring,
 83     dbg_itype_ustring,
 84     dbg_itype_segptr,     /* hack for segmented pointers */
 85     dbg_itype_none              = 0xffffffff
 86 };
 87 
 88 /* type description (in the following order):
 89  * - if 'id' is dbg_itype_none (whatever 'module' value), the type isn't known
 90  * - if 'module' is 0, it's an internal type (id is one of dbg_itype...)
 91  * - if 'module' is non 0, then 'id' is a type ID referring to module (loaded in
 92  *   dbghelp) which (linear) contains address 'module'.
 93  */
 94 struct dbg_type
 95 {
 96     unsigned long       id;
 97     DWORD               module;
 98 };
 99 
100 struct dbg_lvalue       /* structure to hold left-values... */
101 {
102     int                 cookie; /* DLV_??? */
103 /* DLV_TARGET references an address in debuggee's address space, whereas DLV_HOST
104  * references the winedbg's address space
105  */
106 #       define  DLV_TARGET      0xF00D
107 #       define  DLV_HOST        0x50DA
108     ADDRESS64           addr;
109     struct dbg_type     type;
110 };
111 
112 enum dbg_exec_mode
113 {
114     dbg_exec_cont,                      /* Continue execution */
115     dbg_exec_step_over_line,            /* Stepping over a call to next source line */
116     dbg_exec_step_into_line,            /* Step to next source line, stepping in if needed */
117     dbg_exec_step_over_insn,            /* Stepping over a call */
118     dbg_exec_step_into_insn,            /* Single-stepping an instruction */
119     dbg_exec_finish,                    /* Single-step until we exit current frame */
120 #if 0
121     EXEC_STEP_OVER_TRAMPOLINE,  /* Step over trampoline.  Requires that we dig the real
122                                  * return value off the stack and set breakpoint there - 
123                                  * not at the instr just after the call.
124                                  */
125 #endif
126 };
127 
128 struct dbg_breakpoint
129 {
130     ADDRESS64           addr;
131     unsigned long       enabled : 1,
132                         xpoint_type : 2,
133                         refcount : 13,
134                         skipcount : 16;
135     unsigned long       info;
136     struct              /* only used for watchpoints */
137     {
138         BYTE            len : 2;
139         DWORD           oldval;
140     } w;
141     struct expr*        condition;
142 };
143 
144 /* used for C++ exceptions in msvcrt
145  * parameters:
146  * [0] CXX_FRAME_MAGIC
147  * [1] pointer to exception object
148  * [2] pointer to type
149  */
150 #define CXX_EXCEPTION                       0xe06d7363
151 #define CXX_FRAME_MAGIC                     0x19930520
152 
153 /* Wine extension; Windows doesn't have a name for this code.  This is an
154    undocumented exception understood by MS VC debugger, allowing the program
155    to name a particular thread.  Search google.com or deja.com for "0x406d1388"
156    for more info. */
157 #define EXCEPTION_NAME_THREAD               0x406D1388
158 
159 /* Helper structure */
160 typedef struct tagTHREADNAME_INFO
161 {
162    DWORD   dwType;     /* Must be 0x1000 */
163    LPCTSTR szName;     /* Pointer to name - limited to 9 bytes (8 characters + terminator) */
164    DWORD   dwThreadID; /* Thread ID (-1 = caller thread) */
165    DWORD   dwFlags;    /* Reserved for future use.  Must be zero. */
166 } THREADNAME_INFO;
167 
168 struct dbg_thread
169 {
170     struct dbg_process*         process;
171     HANDLE                      handle;
172     DWORD                       tid;
173     void*                       teb;
174     enum dbg_exec_mode          exec_mode;      /* mode the thread is run (step/run...) */
175     int                         exec_count;     /* count of mode operations */
176     ADDRESS_MODE                addr_mode;      /* mode */
177     int                         stopped_xpoint; /* xpoint on which the thread has stopped (-1 if none) */
178     struct dbg_breakpoint       step_over_bp;
179     char                        name[9];
180     struct dbg_thread*          next;
181     struct dbg_thread*          prev;
182     BOOL                        in_exception;   /* TRUE if thread stopped with an exception */
183     EXCEPTION_RECORD            excpt_record;   /* only valid when in_exception is TRUE */
184     struct
185     {
186         ADDRESS64               addr_pc;
187         ADDRESS64               addr_frame;
188         ADDRESS64               addr_stack;
189         DWORD                   linear_pc;
190         DWORD                   linear_frame;
191         DWORD                   linear_stack;
192     }*                          frames;
193     int                         num_frames;
194     int                         curr_frame;
195 };
196 
197 struct dbg_delayed_bp
198 {
199     BOOL                        is_symbol;
200     BOOL                        software_bp;
201     union
202     {
203         struct
204         {
205             int                         lineno;
206             char*                       name;
207         } symbol;
208         ADDRESS64               addr;
209     } u;
210 };
211 
212 #define MAX_BREAKPOINTS 100
213 struct dbg_process
214 {
215     HANDLE                      handle;
216     DWORD                       pid;
217     const struct be_process_io* process_io;
218     void*                       pio_data;
219     const char*                 imageName;
220     struct dbg_thread*          threads;
221     unsigned                    continue_on_first_exception : 1,
222                                 active_debuggee : 1;
223     struct dbg_breakpoint       bp[MAX_BREAKPOINTS];
224     unsigned                    next_bp;
225     struct dbg_delayed_bp*      delayed_bp;
226     int                         num_delayed_bp;
227     struct open_file_list*      source_ofiles;
228     char*                       search_path;
229     char                        source_current_file[MAX_PATH];
230     int                         source_start_line;
231     int                         source_end_line;
232     struct dbg_process*         next;
233     struct dbg_process*         prev;
234 };
235 
236 /* describes the way the debugger interacts with a given process */
237 struct be_process_io
238 {
239     BOOL        (*close_process)(struct dbg_process*, BOOL);
240     BOOL        (WINAPI *read)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
241     BOOL        (WINAPI *write)(HANDLE, void*, const void*, SIZE_T, SIZE_T*);
242     BOOL        (WINAPI *get_selector)(HANDLE, DWORD, LDT_ENTRY*);
243 };
244 
245 extern  struct dbg_process*     dbg_curr_process;
246 extern  DWORD                   dbg_curr_pid;
247 extern  struct dbg_thread*      dbg_curr_thread;
248 extern  DWORD                   dbg_curr_tid;
249 extern  CONTEXT                 dbg_context;
250 extern  BOOL                    dbg_interactiveP;
251 
252 struct dbg_internal_var
253 {
254     DWORD                       val;
255     const char*                 name;
256     LPDWORD                     pval;
257     unsigned long               typeid; /* always internal type */
258 };
259 
260 enum sym_get_lval {sglv_found, sglv_unknown, sglv_aborted};
261 
262 enum type_expr_e
263 {
264     type_expr_type_id,
265     type_expr_udt_class,
266     type_expr_udt_struct,
267     type_expr_udt_union,
268     type_expr_enumeration
269 };
270 
271 struct type_expr_t
272 { 
273     enum type_expr_e    type;
274     unsigned            deref_count;
275     union
276     {
277         struct dbg_type type;
278         const char*     name;
279     } u;
280 };
281 
282 enum dbg_start {start_ok, start_error_parse, start_error_init};
283 
284   /* break.c */
285 extern void             break_set_xpoints(BOOL set);
286 extern BOOL             break_add_break(const ADDRESS64* addr, BOOL verbose, BOOL swbp);
287 extern BOOL             break_add_break_from_lvalue(const struct dbg_lvalue* value, BOOL swbp);
288 extern void             break_add_break_from_id(const char* name, int lineno, BOOL swbp);
289 extern void             break_add_break_from_lineno(int lineno, BOOL swbp);
290 extern void             break_add_watch_from_lvalue(const struct dbg_lvalue* lvalue);
291 extern void             break_add_watch_from_id(const char* name);
292 extern void             break_check_delayed_bp(void);
293 extern void             break_delete_xpoint(int num);
294 extern void             break_delete_xpoints_from_module(unsigned long base);
295 extern void             break_enable_xpoint(int num, BOOL enable);
296 extern void             break_info(void);
297 extern void             break_adjust_pc(ADDRESS64* addr, DWORD code, BOOL first_chance, BOOL* is_break);
298 extern BOOL             break_should_continue(ADDRESS64* addr, DWORD code);
299 extern void             break_suspend_execution(void);
300 extern void             break_restart_execution(int count);
301 extern int              break_add_condition(int bpnum, struct expr* exp);
302 
303   /* dbg.y */
304 extern void             parser(const char*);
305 extern void             parser_handle(HANDLE);
306 extern int              input_read_line(const char* pfx, char* buffer, int size);
307 extern int              input_fetch_entire_line(const char* pfx, char** line);
308 extern HANDLE           parser_generate_command_file(const char*, ...);
309 
310   /* debug.l */
311 extern void             lexeme_flush(void);
312 extern char*            lexeme_alloc(const char*);
313 extern char*            lexeme_alloc_size(int);
314 
315   /* display.c */
316 extern int              display_print(void);
317 extern int              display_add(struct expr* exp, int count, char format);
318 extern int              display_delete(int displaynum);
319 extern int              display_info(void);
320 extern int              display_enable(int displaynum, int enable);
321 
322   /* expr.c */
323 extern void             expr_free_all(void);
324 extern struct expr*     expr_alloc_internal_var(const char* name);
325 extern struct expr*     expr_alloc_symbol(const char* name);
326 extern struct expr*     expr_alloc_sconstant(int val);
327 extern struct expr*     expr_alloc_uconstant(unsigned val);
328 extern struct expr*     expr_alloc_string(const char* str);
329 extern struct expr*     expr_alloc_binary_op(int oper, struct expr*, struct expr*);
330 extern struct expr*     expr_alloc_unary_op(int oper, struct expr*);
331 extern struct expr*     expr_alloc_pstruct(struct expr*, const char* element);
332 extern struct expr*     expr_alloc_struct(struct expr*, const char* element);
333 extern struct expr*     expr_alloc_func_call(const char*, int nargs, ...);
334 extern struct expr*     expr_alloc_typecast(struct type_expr_t*, struct expr*);
335 extern struct dbg_lvalue expr_eval(struct expr*);
336 extern struct expr*     expr_clone(const struct expr* exp, BOOL *local_binding);
337 extern int              expr_free(struct expr* exp);
338 extern int              expr_print(const struct expr* exp);
339 
340   /* info.c */
341 extern void             print_help(void);
342 extern void             info_help(void);
343 extern void             info_win32_module(DWORD64 mod);
344 extern void             info_win32_class(HWND hWnd, const char* clsName);
345 extern void             info_win32_window(HWND hWnd, BOOL detailed);
346 extern void             info_win32_processes(void);
347 extern void             info_win32_threads(void);
348 extern void             info_win32_exceptions(DWORD tid);
349 extern void             info_win32_virtual(DWORD pid);
350 extern void             info_win32_segments(DWORD start, int length);
351 extern void             info_wine_dbg_channel(BOOL add, const char* chnl, const char* name);
352 
353   /* memory.c */
354 extern BOOL             memory_read_value(const struct dbg_lvalue* lvalue, DWORD size, void* result);
355 extern BOOL             memory_write_value(const struct dbg_lvalue* val, DWORD size, void* value);
356 extern void             memory_examine(const struct dbg_lvalue *lvalue, int count, char format);
357 extern void*            memory_to_linear_addr(const ADDRESS64* address);
358 extern BOOL             memory_get_current_pc(ADDRESS64* address);
359 extern BOOL             memory_get_current_stack(ADDRESS64* address);
360 extern BOOL             memory_get_current_frame(ADDRESS64* address);
361 extern BOOL             memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee, BOOL unicode, char* buffer, int size);
362 extern BOOL             memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, char* buffer, int size);
363 extern BOOL             memory_get_register(DWORD regno, DWORD** value, char* buffer, int len);
364 extern void             memory_disassemble(const struct dbg_lvalue*, const struct dbg_lvalue*, int instruction_count);
365 extern BOOL             memory_disasm_one_insn(ADDRESS64* addr);
366 #define MAX_OFFSET_TO_STR_LEN 19
367 extern char*            memory_offset_to_string(char *str, DWORD64 offset, unsigned mode);
368 extern void             print_bare_address(const ADDRESS64* addr);
369 extern void             print_address(const ADDRESS64* addr, BOOLEAN with_line);
370 extern void             print_basic(const struct dbg_lvalue* value, char format);
371 
372   /* source.c */
373 extern void             source_list(IMAGEHLP_LINE* src1, IMAGEHLP_LINE* src2, int delta);
374 extern void             source_list_from_addr(const ADDRESS64* addr, int nlines);
375 extern void             source_show_path(void);
376 extern void             source_add_path(const char* path);
377 extern void             source_nuke_path(struct dbg_process* p);
378 extern void             source_free_files(struct dbg_process* p);
379 
380   /* stack.c */
381 extern void             stack_info(void);
382 extern void             stack_backtrace(DWORD threadID);
383 extern BOOL             stack_set_frame(int newframe);
384 extern BOOL             stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf);
385 extern BOOL             stack_get_register_current_frame(unsigned regno, DWORD** pval);
386 extern unsigned         stack_fetch_frames(void);
387 extern BOOL             stack_get_current_symbol(SYMBOL_INFO* sym);
388 
389   /* symbol.c */
390 extern enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno, struct dbg_lvalue* addr, BOOL bp_disp);
391 extern void             symbol_read_symtable(const char* filename, unsigned long offset);
392 extern enum dbg_line_status symbol_get_function_line_status(const ADDRESS64* addr);
393 extern BOOL             symbol_get_line(const char* filename, const char* func, IMAGEHLP_LINE* ret);
394 extern void             symbol_info(const char* str);
395 extern void             symbol_print_local(const SYMBOL_INFO* sym, ULONG base, BOOL detailed);
396 extern int              symbol_info_locals(void);
397 extern BOOL             symbol_is_local(const char* name);
398 
399   /* tgt_active.c */
400 extern void             dbg_run_debuggee(const char* args);
401 extern void             dbg_wait_next_exception(DWORD cont, int count, int mode);
402 extern enum dbg_start   dbg_active_attach(int argc, char* argv[]);
403 extern enum dbg_start   dbg_active_launch(int argc, char* argv[]);
404 extern enum dbg_start   dbg_active_auto(int argc, char* argv[]);
405 extern void             dbg_active_wait_for_first_exception(void);
406 extern BOOL             dbg_attach_debuggee(DWORD pid, BOOL cofe);
407 
408   /* tgt_minidump.c */
409 extern void             minidump_write(const char*, const EXCEPTION_RECORD*);
410 extern enum dbg_start   minidump_reload(int argc, char* argv[]);
411 
412   /* tgt_module.c */
413 extern enum dbg_start   tgt_module_load(const char* name, BOOL keep);
414 
415   /* types.c */
416 extern void             print_value(const struct dbg_lvalue* addr, char format, int level);
417 extern int              types_print_type(const struct dbg_type*, BOOL details);
418 extern int              print_types(void);
419 extern long int         types_extract_as_integer(const struct dbg_lvalue*);
420 extern LONGLONG         types_extract_as_longlong(const struct dbg_lvalue*, unsigned* psize);
421 extern void             types_extract_as_address(const struct dbg_lvalue*, ADDRESS64*);
422 extern BOOL             types_deref(const struct dbg_lvalue* value, struct dbg_lvalue* result);
423 extern BOOL             types_udt_find_element(struct dbg_lvalue* value, const char* name, long int* tmpbuf);
424 extern BOOL             types_array_index(const struct dbg_lvalue* value, int index, struct dbg_lvalue* result);
425 extern BOOL             types_get_info(const struct dbg_type*, IMAGEHLP_SYMBOL_TYPE_INFO, void*);
426 extern BOOL             types_get_real_type(struct dbg_type* type, DWORD* tag);
427 extern struct dbg_type  types_find_pointer(const struct dbg_type* type);
428 extern struct dbg_type  types_find_type(unsigned long linear, const char* name, enum SymTagEnum tag);
429 
430   /* winedbg.c */
431 extern void             dbg_outputA(const char* buffer, int len);
432 extern void             dbg_outputW(const WCHAR* buffer, int len);
433 #ifdef __GNUC__
434 extern int              dbg_printf(const char* format, ...) __attribute__((format (printf,1,2)));
435 #else
436 extern int              dbg_printf(const char* format, ...);
437 #endif
438 extern const struct dbg_internal_var* dbg_get_internal_var(const char*);
439 extern BOOL             dbg_interrupt_debuggee(void);
440 extern unsigned         dbg_num_processes(void);
441 extern struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid, HANDLE h);
442 extern void             dbg_set_process_name(struct dbg_process* p, const char* name);
443 extern struct dbg_process* dbg_get_process(DWORD pid);
444 extern struct dbg_process* dbg_get_process_h(HANDLE handle);
445 extern void             dbg_del_process(struct dbg_process* p);
446 struct dbg_thread*      dbg_add_thread(struct dbg_process* p, DWORD tid, HANDLE h, void* teb);
447 extern struct dbg_thread* dbg_get_thread(struct dbg_process* p, DWORD tid);
448 extern void             dbg_del_thread(struct dbg_thread* t);
449 extern BOOL             dbg_get_debuggee_info(HANDLE hProcess, IMAGEHLP_MODULE* imh_mod);
450 
451   /* gdbproxy.c */
452 extern int              gdb_main(int argc, char* argv[]);
453 
454 static inline BOOL dbg_read_memory(const void* addr, void* buffer, size_t len)
455 {
456     SIZE_T rlen;
457     return dbg_curr_process->process_io->read(dbg_curr_process->handle, addr, buffer, len, &rlen) && len == rlen;
458 }
459 
460 static inline BOOL dbg_write_memory(void* addr, const void* buffer, size_t len)
461 {
462     SIZE_T wlen;
463     return dbg_curr_process->process_io->write(dbg_curr_process->handle, addr, buffer, len, &wlen) && len == wlen;
464 }
465 
466 static inline void* dbg_heap_realloc(void* buffer, size_t size)
467 {
468     return (buffer) ? HeapReAlloc(GetProcessHeap(), 0, buffer, size) :
469         HeapAlloc(GetProcessHeap(), 0, size);
470 }
471 
472 extern struct dbg_internal_var          dbg_internal_vars[];
473 extern const struct dbg_internal_var*   dbg_context_vars;
474 
475 #define  DBG_IVARNAME(_var)     dbg_internal_var_##_var
476 #define  DBG_IVARSTRUCT(_var)   dbg_internal_vars[DBG_IVARNAME(_var)]
477 #define  DBG_IVAR(_var)         (*(DBG_IVARSTRUCT(_var).pval))
478 #define  INTERNAL_VAR(_var,_val,_ref,itype) DBG_IVARNAME(_var),
479 enum debug_int_var
480 {
481 #include "intvar.h"
482    DBG_IV_LAST
483 };
484 #undef   INTERNAL_VAR
485 
486 /* include CPU dependent bits */
487 #include "be_cpu.h"
488 
489 #endif  /* __WINE_DEBUGGER_H */
490 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.