Home | History | Annotate | Download | only in proto
      1 // Copyright (c) 2010, Google Inc.
      2 // All rights reserved.
      3 //
      4 // Redistribution and use in source and binary forms, with or without
      5 // modification, are permitted provided that the following conditions are
      6 // met:
      7 //
      8 //     * Redistributions of source code must retain the above copyright
      9 // notice, this list of conditions and the following disclaimer.
     10 //     * Redistributions in binary form must reproduce the above
     11 // copyright notice, this list of conditions and the following disclaimer
     12 // in the documentation and/or other materials provided with the
     13 // distribution.
     14 //     * Neither the name of Google Inc. nor the names of its
     15 // contributors may be used to endorse or promote products derived from
     16 // this software without specific prior written permission.
     17 //
     18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29 
     30 // process_state_proto.proto: A client proto representation of a process,
     31 // in a fully-digested state.
     32 //
     33 // Derived from earlier struct and class based models of a client-side
     34 // processed minidump found under src/google_breakpad/processor.  The
     35 // file process_state.h  holds the top level representation of this model,
     36 // supported by additional classes.  We've added a proto representation
     37 // to ease serialization and parsing for server-side storage of crash
     38 // reports processed on the client.
     39 //
     40 // Author: Jess Gray
     41 
     42 syntax = "proto2";
     43 
     44 package google_breakpad;
     45 
     46 // A proto representation of a process, in a fully-digested state.
     47 // See src/google_breakpad/processor/process_state.h
     48 message ProcessStateProto {
     49   // Next value: 14
     50 
     51   // The time-date stamp of the original minidump (time_t format)
     52   optional int64 time_date_stamp = 1;
     53 
     54   // The time-date stamp when the process was created (time_t format)
     55   optional int64 process_create_time = 13;
     56 
     57   message Crash {
     58     // The type of crash.  OS- and possibly CPU- specific.  For example,
     59     // "EXCEPTION_ACCESS_VIOLATION" (Windows), "EXC_BAD_ACCESS /
     60     // KERN_INVALID_ADDRESS" (Mac OS X), "SIGSEGV" (other Unix).
     61     required string reason = 1;
     62 
     63     // If crash_reason implicates memory, the memory address that caused the
     64     // crash.  For data access errors, this will be the data address that
     65     // caused the fault.  For code errors, this will be the address of the
     66     // instruction that caused the fault.
     67     required int64 address = 2;
     68   }
     69   optional Crash crash = 2;
     70 
     71 
     72   // If there was an assertion that was hit, a textual representation
     73   // of that assertion, possibly including the file and line at which
     74   // it occurred.
     75   optional string assertion = 3;
     76 
     77   // The index of the thread that requested a dump be written in the
     78   // threads vector.  If a dump was produced as a result of a crash, this
     79   // will point to the thread that crashed.  If the dump was produced as
     80   // by user code without crashing, and the dump contains extended Breakpad
     81   // information, this will point to the thread that requested the dump.
     82   optional int32 requesting_thread = 4;
     83 
     84   message Thread {
     85     // Stack for the given thread
     86     repeated StackFrame frames = 1;
     87   }
     88 
     89   // Stacks for each thread (except possibly the exception handler
     90   // thread) at the time of the crash.
     91   repeated Thread threads = 5;
     92 
     93   // The modules that were loaded into the process represented by the
     94   // ProcessState.
     95   repeated CodeModule modules = 6;
     96 
     97   // System Info: OS and CPU
     98 
     99   // A string identifying the operating system, such as "Windows NT",
    100   // "Mac OS X", or "Linux".  If the information is present in the dump but
    101   // its value is unknown, this field will contain a numeric value.  If
    102   // the information is not present in the dump, this field will be empty.
    103   optional string os = 7;
    104 
    105    // A short form of the os string, using lowercase letters and no spaces,
    106   // suitable for use in a filesystem.  Possible values are "windows",
    107   // "mac", and "linux".  Empty if the information is not present in the dump
    108   // or if the OS given by the dump is unknown.  The values stored in this
    109   // field should match those used by MinidumpSystemInfo::GetOS.
    110   optional string os_short = 8;
    111 
    112   // A string identifying the version of the operating system, such as
    113   // "5.1.2600 Service Pack 2" or "10.4.8 8L2127".  If the dump does not
    114   // contain this information, this field will be empty.
    115   optional string os_version = 9;
    116 
    117   // A string identifying the basic CPU family, such as "x86" or "ppc".
    118   // If this information is present in the dump but its value is unknown,
    119   // this field will contain a numeric value.  If the information is not
    120   // present in the dump, this field will be empty.  The values stored in
    121   // this field should match those used by MinidumpSystemInfo::GetCPU.
    122   optional string cpu = 10;
    123 
    124   // A string further identifying the specific CPU, such as
    125   // "GenuineIntel level 6 model 13 stepping 8".  If the information is not
    126   // present in the dump, or additional identifying information is not
    127   // defined for the CPU family, this field will be empty.
    128   optional string cpu_info = 11;
    129 
    130   // The number of processors in the system.  Will be greater than one for
    131   // multi-core systems.
    132   optional int32 cpu_count = 12;
    133 
    134   // Leave the ability to add the raw minidump to this representation
    135 }
    136 
    137 
    138 // Represents a single frame in a stack  
    139 // See src/google_breakpad/processor/code_module.h
    140 message StackFrame {
    141   // Next value: 8
    142 
    143   // The program counter location as an absolute virtual address.  For the
    144   // innermost called frame in a stack, this will be an exact program counter
    145   // or instruction pointer value.  For all other frames, this will be within
    146   // the instruction that caused execution to branch to a called function,
    147   // but may not necessarily point to the exact beginning of that instruction.
    148   required int64 instruction = 1;
    149 
    150   // The module in which the instruction resides.
    151   optional CodeModule module = 2;
    152 
    153   // The function name, may be omitted if debug symbols are not available.
    154   optional string function_name = 3;
    155 
    156   // The start address of the function, may be omitted if debug symbols
    157   // are not available.
    158   optional int64 function_base = 4;
    159 
    160   // The source file name, may be omitted if debug symbols are not available.
    161   optional string source_file_name = 5;
    162 
    163   // The (1-based) source line number, may be omitted if debug symbols are
    164   // not available.
    165   optional int32 source_line = 6;
    166 
    167   // The start address of the source line, may be omitted if debug symbols
    168   // are not available.
    169   optional int64 source_line_base = 7;
    170 }
    171 
    172 
    173 // Carries information about code modules that are loaded into a process.
    174 // See src/google_breakpad/processor/code_module.h
    175 message CodeModule {
    176   // Next value: 8
    177 
    178   // The base address of this code module as it was loaded by the process.
    179   optional int64 base_address = 1;
    180 
    181   // The size of the code module.
    182   optional int64 size = 2;
    183 
    184   // The path or file name that the code module was loaded from.
    185   optional string code_file = 3;
    186 
    187   // An identifying string used to discriminate between multiple versions and
    188   // builds of the same code module.  This may contain a uuid, timestamp,
    189   // version number, or any combination of this or other information, in an
    190   // implementation-defined format.
    191   optional string code_identifier = 4;
    192 
    193   // The filename containing debugging information associated with the code
    194   // module.  If debugging information is stored in a file separate from the
    195   // code module itself (as is the case when .pdb or .dSYM files are used),
    196   // this will be different from code_file.  If debugging information is
    197   // stored in the code module itself (possibly prior to stripping), this
    198   // will be the same as code_file.
    199   optional string debug_file = 5;
    200 
    201   // An identifying string similar to code_identifier, but identifies a
    202   // specific version and build of the associated debug file.  This may be
    203   // the same as code_identifier when the debug_file and code_file are
    204   // identical or when the same identifier is used to identify distinct
    205   // debug and code files.
    206   optional string debug_identifier = 6;
    207 
    208   // A human-readable representation of the code module's version.
    209   optional string version = 7;
    210 }
    211