tools/profiler/LulDwarfInt.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/LulDwarfInt.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,127 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +
     1.7 +// Copyright (c) 2008, 2010 Google Inc. All Rights Reserved.
     1.8 +//
     1.9 +// Redistribution and use in source and binary forms, with or without
    1.10 +// modification, are permitted provided that the following conditions are
    1.11 +// met:
    1.12 +//
    1.13 +//     * Redistributions of source code must retain the above copyright
    1.14 +// notice, this list of conditions and the following disclaimer.
    1.15 +//     * Redistributions in binary form must reproduce the above
    1.16 +// copyright notice, this list of conditions and the following disclaimer
    1.17 +// in the documentation and/or other materials provided with the
    1.18 +// distribution.
    1.19 +//     * Neither the name of Google Inc. nor the names of its
    1.20 +// contributors may be used to endorse or promote products derived from
    1.21 +// this software without specific prior written permission.
    1.22 +//
    1.23 +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.24 +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.25 +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.26 +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    1.27 +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.28 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.29 +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    1.30 +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    1.31 +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    1.32 +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.33 +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.34 +
    1.35 +// CFI reader author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
    1.36 +
    1.37 +// This file is derived from the following file in
    1.38 +// toolkit/crashreporter/google-breakpad:
    1.39 +//   src/common/dwarf/dwarf2enums.h
    1.40 +
    1.41 +#ifndef LulDwarfInt_h
    1.42 +#define LulDwarfInt_h
    1.43 +
    1.44 +#include "LulCommonExt.h"
    1.45 +#include "LulDwarfExt.h"
    1.46 +
    1.47 +namespace lul {
    1.48 +
    1.49 +// These enums do not follow the google3 style only because they are
    1.50 +// known universally (specs, other implementations) by the names in
    1.51 +// exactly this capitalization.
    1.52 +// Tag names and codes.
    1.53 +
    1.54 +// Call Frame Info instructions.
    1.55 +enum DwarfCFI
    1.56 +  {
    1.57 +    DW_CFA_advance_loc        = 0x40,
    1.58 +    DW_CFA_offset             = 0x80,
    1.59 +    DW_CFA_restore            = 0xc0,
    1.60 +    DW_CFA_nop                = 0x00,
    1.61 +    DW_CFA_set_loc            = 0x01,
    1.62 +    DW_CFA_advance_loc1       = 0x02,
    1.63 +    DW_CFA_advance_loc2       = 0x03,
    1.64 +    DW_CFA_advance_loc4       = 0x04,
    1.65 +    DW_CFA_offset_extended    = 0x05,
    1.66 +    DW_CFA_restore_extended   = 0x06,
    1.67 +    DW_CFA_undefined          = 0x07,
    1.68 +    DW_CFA_same_value         = 0x08,
    1.69 +    DW_CFA_register           = 0x09,
    1.70 +    DW_CFA_remember_state     = 0x0a,
    1.71 +    DW_CFA_restore_state      = 0x0b,
    1.72 +    DW_CFA_def_cfa            = 0x0c,
    1.73 +    DW_CFA_def_cfa_register   = 0x0d,
    1.74 +    DW_CFA_def_cfa_offset     = 0x0e,
    1.75 +    DW_CFA_def_cfa_expression = 0x0f,
    1.76 +    DW_CFA_expression         = 0x10,
    1.77 +    DW_CFA_offset_extended_sf = 0x11,
    1.78 +    DW_CFA_def_cfa_sf         = 0x12,
    1.79 +    DW_CFA_def_cfa_offset_sf  = 0x13,
    1.80 +    DW_CFA_val_offset         = 0x14,
    1.81 +    DW_CFA_val_offset_sf      = 0x15,
    1.82 +    DW_CFA_val_expression     = 0x16,
    1.83 +
    1.84 +    // Opcodes in this range are reserved for user extensions.
    1.85 +    DW_CFA_lo_user = 0x1c,
    1.86 +    DW_CFA_hi_user = 0x3f,
    1.87 +
    1.88 +    // SGI/MIPS specific.
    1.89 +    DW_CFA_MIPS_advance_loc8 = 0x1d,
    1.90 +
    1.91 +    // GNU extensions.
    1.92 +    DW_CFA_GNU_window_save = 0x2d,
    1.93 +    DW_CFA_GNU_args_size = 0x2e,
    1.94 +    DW_CFA_GNU_negative_offset_extended = 0x2f
    1.95 +  };
    1.96 +
    1.97 +// Exception handling 'z' augmentation letters.
    1.98 +enum DwarfZAugmentationCodes {
    1.99 +  // If the CFI augmentation string begins with 'z', then the CIE and FDE
   1.100 +  // have an augmentation data area just before the instructions, whose
   1.101 +  // contents are determined by the subsequent augmentation letters.
   1.102 +  DW_Z_augmentation_start = 'z',
   1.103 +
   1.104 +  // If this letter is present in a 'z' augmentation string, the CIE
   1.105 +  // augmentation data includes a pointer encoding, and the FDE
   1.106 +  // augmentation data includes a language-specific data area pointer,
   1.107 +  // represented using that encoding.
   1.108 +  DW_Z_has_LSDA = 'L',
   1.109 +
   1.110 +  // If this letter is present in a 'z' augmentation string, the CIE
   1.111 +  // augmentation data includes a pointer encoding, followed by a pointer
   1.112 +  // to a personality routine, represented using that encoding.
   1.113 +  DW_Z_has_personality_routine = 'P',
   1.114 +
   1.115 +  // If this letter is present in a 'z' augmentation string, the CIE
   1.116 +  // augmentation data includes a pointer encoding describing how the FDE's
   1.117 +  // initial location, address range, and DW_CFA_set_loc operands are
   1.118 +  // encoded.
   1.119 +  DW_Z_has_FDE_address_encoding = 'R',
   1.120 +
   1.121 +  // If this letter is present in a 'z' augmentation string, then code
   1.122 +  // addresses covered by FDEs that cite this CIE are signal delivery
   1.123 +  // trampolines. Return addresses of frames in trampolines should not be
   1.124 +  // adjusted as described in section 6.4.4 of the DWARF 3 spec.
   1.125 +  DW_Z_is_signal_trampoline = 'S'
   1.126 +};
   1.127 +
   1.128 +} // namespace lul
   1.129 +
   1.130 +#endif // LulDwarfInt_h

mercurial