1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
4 // Copyright (c) 2008, 2010 Google Inc. All Rights Reserved.
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following disclaimer
14 // in the documentation and/or other materials provided with the
16 // * Neither the name of Google Inc. nor the names of its
17 // contributors may be used to endorse or promote products derived from
18 // this software without specific prior written permission.
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 // CFI reader author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
34 // This file is derived from the following file in
35 // toolkit/crashreporter/google-breakpad:
36 // src/common/dwarf/dwarf2enums.h
41 #include "LulCommonExt.h"
42 #include "LulDwarfExt.h"
46 // These enums do not follow the google3 style only because they are
47 // known universally (specs, other implementations) by the names in
48 // exactly this capitalization.
49 // Tag names and codes.
51 // Call Frame Info instructions.
53 DW_CFA_advance_loc
= 0x40,
55 DW_CFA_restore
= 0xc0,
57 DW_CFA_set_loc
= 0x01,
58 DW_CFA_advance_loc1
= 0x02,
59 DW_CFA_advance_loc2
= 0x03,
60 DW_CFA_advance_loc4
= 0x04,
61 DW_CFA_offset_extended
= 0x05,
62 DW_CFA_restore_extended
= 0x06,
63 DW_CFA_undefined
= 0x07,
64 DW_CFA_same_value
= 0x08,
65 DW_CFA_register
= 0x09,
66 DW_CFA_remember_state
= 0x0a,
67 DW_CFA_restore_state
= 0x0b,
68 DW_CFA_def_cfa
= 0x0c,
69 DW_CFA_def_cfa_register
= 0x0d,
70 DW_CFA_def_cfa_offset
= 0x0e,
71 DW_CFA_def_cfa_expression
= 0x0f,
72 DW_CFA_expression
= 0x10,
73 DW_CFA_offset_extended_sf
= 0x11,
74 DW_CFA_def_cfa_sf
= 0x12,
75 DW_CFA_def_cfa_offset_sf
= 0x13,
76 DW_CFA_val_offset
= 0x14,
77 DW_CFA_val_offset_sf
= 0x15,
78 DW_CFA_val_expression
= 0x16,
80 // Opcodes in this range are reserved for user extensions.
81 DW_CFA_lo_user
= 0x1c,
82 DW_CFA_hi_user
= 0x3f,
85 DW_CFA_MIPS_advance_loc8
= 0x1d,
88 DW_CFA_GNU_window_save
= 0x2d,
89 DW_CFA_GNU_args_size
= 0x2e,
90 DW_CFA_GNU_negative_offset_extended
= 0x2f
93 // Exception handling 'z' augmentation letters.
94 enum DwarfZAugmentationCodes
{
95 // If the CFI augmentation string begins with 'z', then the CIE and FDE
96 // have an augmentation data area just before the instructions, whose
97 // contents are determined by the subsequent augmentation letters.
98 DW_Z_augmentation_start
= 'z',
100 // If this letter is present in a 'z' augmentation string, the CIE
101 // augmentation data includes a pointer encoding, and the FDE
102 // augmentation data includes a language-specific data area pointer,
103 // represented using that encoding.
106 // If this letter is present in a 'z' augmentation string, the CIE
107 // augmentation data includes a pointer encoding, followed by a pointer
108 // to a personality routine, represented using that encoding.
109 DW_Z_has_personality_routine
= 'P',
111 // If this letter is present in a 'z' augmentation string, the CIE
112 // augmentation data includes a pointer encoding describing how the FDE's
113 // initial location, address range, and DW_CFA_set_loc operands are
115 DW_Z_has_FDE_address_encoding
= 'R',
117 // If this letter is present in a 'z' augmentation string, then code
118 // addresses covered by FDEs that cite this CIE are signal delivery
119 // trampolines. Return addresses of frames in trampolines should not be
120 // adjusted as described in section 6.4.4 of the DWARF 3 spec.
121 DW_Z_is_signal_trampoline
= 'S'
124 // Expression opcodes
125 enum DwarfExpressionOpcodes
{
128 DW_OP_const1s
= 0x09,
129 DW_OP_const2u
= 0x0a,
130 DW_OP_const2s
= 0x0b,
131 DW_OP_const4u
= 0x0c,
132 DW_OP_const4s
= 0x0d,
133 DW_OP_const8u
= 0x0e,
134 DW_OP_const8s
= 0x0f,
154 DW_OP_plus_uconst
= 0x23,
177 DW_OP_deref_size
= 0x94,
178 DW_OP_xderef_size
= 0x95,
180 DW_OP_push_object_address
= 0x97,
183 DW_OP_call_ref
= 0x9a,
184 DW_OP_form_tls_address
= 0x9b,
185 DW_OP_call_frame_cfa
= 0x9c,
186 DW_OP_bit_piece
= 0x9d,
187 DW_OP_lo_user
= 0xe0,
193 #endif // LulDwarfInt_h