ReactOS  0.4.13-dev-990-g6d23816
dwarf.h
Go to the documentation of this file.
1 /*
2  * dwarf2 definitions
3  *
4  * Copyright (C) 2005, Raphael Junqueira
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 #pragma once
22 
23 typedef enum dwarf_tag_e
24 {
32  DW_TAG_label = 0x0a,
34  DW_TAG_member = 0x0d,
49  DW_TAG_module = 0x1e,
61  DW_TAG_friend = 0x2a,
91  DW_TAG_MIPS_loop = 0x4081,
95  DW_TAG_GNU_BINCL = 0x4104,
96  DW_TAG_GNU_EINCL = 0x4105,
102 } dwarf_tag_t;
103 
104 typedef enum dwarf_attribute_e
105 {
108  DW_AT_name = 0x03,
116  DW_AT_low_pc = 0x11,
119  DW_AT_member = 0x14,
120  DW_AT_discr = 0x15,
123  DW_AT_import = 0x18,
130  DW_AT_inline = 0x20,
145  DW_AT_count = 0x37,
155  DW_AT_friend = 0x41,
163  DW_AT_type = 0x49,
173  DW_AT_stride = 0x51,
177  DW_AT_ranges = 0x55,
186  DW_AT_small = 0x5d,
196  DW_AT_pure = 0x67,
205  /* extensions */
206  DW_AT_MIPS_fde = 0x2001,
217  DW_AT_sf_names = 0x2101,
218  DW_AT_src_info = 0x2102,
219  DW_AT_mac_info = 0x2103,
222  DW_AT_body_end = 0x2106,
241 
243 
244 typedef enum dwarf_form_e
245 {
246  DW_FORM_addr = 0x01,
256  DW_FORM_flag = 0x0c,
258  DW_FORM_strp = 0x0e,
261  DW_FORM_ref1 = 0x11,
262  DW_FORM_ref2 = 0x12,
263  DW_FORM_ref4 = 0x13,
264  DW_FORM_ref8 = 0x14,
272 } dwarf_form_t;
273 
275 typedef enum dwarf_type_e
276 {
277  DW_ATE_void = 0x0,
286  /* Dwarf3 new values */
294 } dwarf_type_t;
295 
296 typedef enum dwarf_operation_e
297 {
298  DW_OP_addr = 0x03,
299  DW_OP_deref = 0x06,
308  DW_OP_constu = 0x10,
309  DW_OP_consts = 0x11,
310  DW_OP_dup = 0x12,
311  DW_OP_drop = 0x13,
312  DW_OP_over = 0x14,
313  DW_OP_pick = 0x15,
314  DW_OP_swap = 0x16,
315  DW_OP_rot = 0x17,
316  DW_OP_xderef = 0x18,
317  DW_OP_abs = 0x19,
318  DW_OP_and = 0x1a,
319  DW_OP_div = 0x1b,
320  DW_OP_minus = 0x1c,
321  DW_OP_mod = 0x1d,
322  DW_OP_mul = 0x1e,
323  DW_OP_neg = 0x1f,
324  DW_OP_not = 0x20,
325  DW_OP_or = 0x21,
326  DW_OP_plus = 0x22,
328  DW_OP_shl = 0x24,
329  DW_OP_shr = 0x25,
330  DW_OP_shra = 0x26,
331  DW_OP_xor = 0x27,
332  DW_OP_bra = 0x28,
333  DW_OP_eq = 0x29,
334  DW_OP_ge = 0x2a,
335  DW_OP_gt = 0x2b,
336  DW_OP_le = 0x2c,
337  DW_OP_lt = 0x2d,
338  DW_OP_ne = 0x2e,
339  DW_OP_skip = 0x2f,
340  DW_OP_lit0 = 0x30,
341  DW_OP_lit1 = 0x31,
342  DW_OP_lit2 = 0x32,
343  DW_OP_lit3 = 0x33,
344  DW_OP_lit4 = 0x34,
345  DW_OP_lit5 = 0x35,
346  DW_OP_lit6 = 0x36,
347  DW_OP_lit7 = 0x37,
348  DW_OP_lit8 = 0x38,
349  DW_OP_lit9 = 0x39,
350  DW_OP_lit10 = 0x3a,
351  DW_OP_lit11 = 0x3b,
352  DW_OP_lit12 = 0x3c,
353  DW_OP_lit13 = 0x3d,
354  DW_OP_lit14 = 0x3e,
355  DW_OP_lit15 = 0x3f,
356  DW_OP_lit16 = 0x40,
357  DW_OP_lit17 = 0x41,
358  DW_OP_lit18 = 0x42,
359  DW_OP_lit19 = 0x43,
360  DW_OP_lit20 = 0x44,
361  DW_OP_lit21 = 0x45,
362  DW_OP_lit22 = 0x46,
363  DW_OP_lit23 = 0x47,
364  DW_OP_lit24 = 0x48,
365  DW_OP_lit25 = 0x49,
366  DW_OP_lit26 = 0x4a,
367  DW_OP_lit27 = 0x4b,
368  DW_OP_lit28 = 0x4c,
369  DW_OP_lit29 = 0x4d,
370  DW_OP_lit30 = 0x4e,
371  DW_OP_lit31 = 0x4f,
372  DW_OP_reg0 = 0x50,
373  DW_OP_reg1 = 0x51,
374  DW_OP_reg2 = 0x52,
375  DW_OP_reg3 = 0x53,
376  DW_OP_reg4 = 0x54,
377  DW_OP_reg5 = 0x55,
378  DW_OP_reg6 = 0x56,
379  DW_OP_reg7 = 0x57,
380  DW_OP_reg8 = 0x58,
381  DW_OP_reg9 = 0x59,
382  DW_OP_reg10 = 0x5a,
383  DW_OP_reg11 = 0x5b,
384  DW_OP_reg12 = 0x5c,
385  DW_OP_reg13 = 0x5d,
386  DW_OP_reg14 = 0x5e,
387  DW_OP_reg15 = 0x5f,
388  DW_OP_reg16 = 0x60,
389  DW_OP_reg17 = 0x61,
390  DW_OP_reg18 = 0x62,
391  DW_OP_reg19 = 0x63,
392  DW_OP_reg20 = 0x64,
393  DW_OP_reg21 = 0x65,
394  DW_OP_reg22 = 0x66,
395  DW_OP_reg23 = 0x67,
396  DW_OP_reg24 = 0x68,
397  DW_OP_reg25 = 0x69,
398  DW_OP_reg26 = 0x6a,
399  DW_OP_reg27 = 0x6b,
400  DW_OP_reg28 = 0x6c,
401  DW_OP_reg29 = 0x6d,
402  DW_OP_reg30 = 0x6e,
403  DW_OP_reg31 = 0x6f,
404  DW_OP_breg0 = 0x70,
405  DW_OP_breg1 = 0x71,
406  DW_OP_breg2 = 0x72,
407  DW_OP_breg3 = 0x73,
408  DW_OP_breg4 = 0x74,
409  DW_OP_breg5 = 0x75,
410  DW_OP_breg6 = 0x76,
411  DW_OP_breg7 = 0x77,
412  DW_OP_breg8 = 0x78,
413  DW_OP_breg9 = 0x79,
414  DW_OP_breg10 = 0x7a,
415  DW_OP_breg11 = 0x7b,
416  DW_OP_breg12 = 0x7c,
417  DW_OP_breg13 = 0x7d,
418  DW_OP_breg14 = 0x7e,
419  DW_OP_breg15 = 0x7f,
420  DW_OP_breg16 = 0x80,
421  DW_OP_breg17 = 0x81,
422  DW_OP_breg18 = 0x82,
423  DW_OP_breg19 = 0x83,
424  DW_OP_breg20 = 0x84,
425  DW_OP_breg21 = 0x85,
426  DW_OP_breg22 = 0x86,
427  DW_OP_breg23 = 0x87,
428  DW_OP_breg24 = 0x88,
429  DW_OP_breg25 = 0x89,
430  DW_OP_breg26 = 0x8a,
431  DW_OP_breg27 = 0x8b,
432  DW_OP_breg28 = 0x8c,
433  DW_OP_breg29 = 0x8d,
434  DW_OP_breg30 = 0x8e,
435  DW_OP_breg31 = 0x8f,
436  DW_OP_regx = 0x90,
437  DW_OP_fbreg = 0x91,
438  DW_OP_bregx = 0x92,
439  DW_OP_piece = 0x93,
442  DW_OP_nop = 0x96,
445  DW_OP_call2 = 0x98,
446  DW_OP_call4 = 0x99,
454 
455  /* Implementation defined extensions */
458 
459  /* GNU extensions */
471 
473 {
477 };
478 
479 #define DW_CC_lo_user 0x40
480 #define DW_CC_hi_user 0xff
481 
482 #define DW_LNS_extended_op 0x00
483 #define DW_LNS_copy 0x01
484 #define DW_LNS_advance_pc 0x02
485 #define DW_LNS_advance_line 0x03
486 #define DW_LNS_set_file 0x04
487 #define DW_LNS_set_column 0x05
488 #define DW_LNS_negate_stmt 0x06
489 #define DW_LNS_set_basic_block 0x07
490 #define DW_LNS_const_add_pc 0x08
491 #define DW_LNS_fixed_advance_pc 0x09
492 /* Dwarf3 new values */
493 #define DW_LNS_set_prologue_end 0x0a
494 #define DW_LNS_set_epilogue_begin 0x0b
495 #define DW_LNS_set_isa 0x0c
496 
497 #define DW_LNE_end_sequence 0x01
498 #define DW_LNE_set_address 0x02
499 #define DW_LNE_define_file 0x03
500 /* Dwarf4 new values */
501 #define DW_LNE_set_discriminator 0x04
502 
503 #define DW_CIE_ID ~(0x0)
504 
506 {
510  DW_CFA_nop = 0x00,
533  /* GNU extensions */
537 
538 };
539 
540 #define DW_EH_PE_native 0x00
541 #define DW_EH_PE_leb128 0x01
542 #define DW_EH_PE_data2 0x02
543 #define DW_EH_PE_data4 0x03
544 #define DW_EH_PE_data8 0x04
545 #define DW_EH_PE_signed 0x08
546 #define DW_EH_PE_abs 0x00
547 #define DW_EH_PE_pcrel 0x10
548 #define DW_EH_PE_textrel 0x20
549 #define DW_EH_PE_datarel 0x30
550 #define DW_EH_PE_funcrel 0x40
551 #define DW_EH_PE_aligned 0x50
552 #define DW_EH_PE_indirect 0x80
553 #define DW_EH_PE_omit 0xff
554 
555 #define DW_INL_not_inlined 0x00
556 #define DW_INL_inlined 0x01
557 #define DW_INL_declared_not_inlined 0x02
558 #define DW_INL_declared_inlined 0x03
559 
560 #ifdef DBGHELP_STATIC_LIB
561 /* from stack.c */
562 static BOOL sw_read_mem(struct cpu_stack_walk* csw, DWORD64 addr, void* ptr, DWORD sz)
563 {
564  DWORD bytes_read = 0;
565  if (csw->is32)
566  return csw->u.s32.f_read_mem(csw->hProcess, addr, ptr, sz, &bytes_read);
567  else
568  return csw->u.s64.f_read_mem(csw->hProcess, addr, ptr, sz, &bytes_read);
569 }
570 #endif
dwarf_form_e
Definition: dwarf.h:244
dwarf_call_frame_info
Definition: dwarf.h:505
dwarf_type_e
Definition: dwarf.h:275
enum dwarf_tag_e dwarf_tag_t
enum dwarf_operation_e dwarf_operation_t
union cpu_stack_walk::@358 u
unsigned int BOOL
Definition: ntddk_ex.h:94
static PVOID ptr
Definition: dispmode.c:27
enum dwarf_type_e dwarf_type_t
enum dwarf_form_e dwarf_form_t
struct cpu_stack_walk::@358::@359 s32
unsigned long DWORD
Definition: ntddk_ex.h:95
dwarf_calling_convention
Definition: dwarf.h:472
GLenum const GLvoid * addr
Definition: glext.h:9621
struct cpu_stack_walk::@358::@360 s64
dwarf_tag_e
Definition: dwarf.h:23
BOOL sw_read_mem(struct cpu_stack_walk *csw, DWORD64 addr, void *ptr, DWORD sz) DECLSPEC_HIDDEN
Definition: stack.c:96
uint64_t DWORD64
Definition: typedefs.h:65
dwarf_attribute_e
Definition: dwarf.h:104
dwarf_operation_e
Definition: dwarf.h:296
enum dwarf_attribute_e dwarf_attribute_t