dbgtypedef.h 5.71 KB
Newer Older
ussrhero's avatar
ussrhero committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#pragma once

#include <string>

namespace kdlib {

///////////////////////////////////////////////////////////////////////////////

typedef unsigned long           PROCESS_ID;
typedef unsigned long           PROCESS_DEBUG_ID;
typedef unsigned long           THREAD_ID;
typedef unsigned long           THREAD_DEBUG_ID;
typedef unsigned long           SYSTEM_DEBUG_ID;
typedef unsigned long           BREAKPOINT_ID;
typedef unsigned long long      MEMOFFSET_64;
typedef unsigned long           MEMOFFSET_32;
typedef long                    MEMOFFSET_REL;
typedef long                    MEMDISPLACEMENT;
typedef unsigned long           BITOFFSET;
typedef unsigned long           ACCESS_TYPE;
typedef unsigned long long      EXTENSION_ID;
typedef unsigned long           RELREG_ID;
typedef unsigned long long      SYMBOL_ID;

enum DebugCallbackResult {
    DebugCallbackProceed = 0,
    DebugCallbackNoChange = 1,
    DebugCallbackBreak = 2,
    DebugCallbackMax = 3
};

enum ExecutionStatus {
    DebugStatusNoChange,
    DebugStatusGo,
    DebugStatusBreak,
    DebugStatusNoDebuggee
};


enum BreakpointType {

    SoftwareBreakpoint,
    DataAccessBreakpoint
};

enum CPUType {
    CPU_I386 = 0,
    CPU_AMD64 = 1,
Aleksey R.'s avatar
Aleksey R. committed
49
    CPU_ARM64 = 2,
Aleksey R.'s avatar
Aleksey R. committed
50 51
    CPU_ARM = 3,
    CPU_MAX = 4
ussrhero's avatar
ussrhero committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
};

enum CPURegType {
    RegInt8,
    RegInt16,
    RegInt32,
    RegInt64,
    RegFloat32,
    RegFloat64,
    RegFloat80,
    RegFloat128,
    RegVector64,
    RegVector128
};


enum EventType {
    EventTypeNoEvent,
    EventTypeBreakpoint,
    EventTypeException,
    EventTypeCreateThread,
    EventTypeExitThread,
    EventTypeCreateProcess,
    EventTypeExitProcess,
    EventTypeLoadModule,
    EventTypeUnloadModule,
    EventTypeSystemError,
    EventTypeSessionStatus,
    EventTypeChangeDebuggeeState,
    EventTypeChangeEngineState,
    EventTypeChangeSymbolState
};

struct SystemInfo {
    unsigned long  majorVersion;
    unsigned long  minorVersion;
    unsigned long  servicePackNumber;
    unsigned long  buildNumber;
    std::wstring  buildDescription;
};

struct SystemCrashInfo {
    unsigned long long  code;
    unsigned long paramterCount;
    unsigned long long parameters[0x10];
};

struct ExceptionInfo {
    bool  firstChance;
    unsigned long  exceptionCode;
    unsigned long  exceptionFlags;
    MEMOFFSET_64  exceptionRecord;
    MEMOFFSET_64  exceptionAddress;
    PROCESS_DEBUG_ID  process;
    THREAD_DEBUG_ID  thread;
    unsigned long parameterCount;
    unsigned long long parameters[0x10];
};

struct FixedFileInfo {
    unsigned long Signature;
    unsigned long StrucVersion;
    unsigned long FileVersionMS;
    unsigned long FileVersionLS;
    unsigned long ProductVersionMS;
    unsigned long ProductVersionLS;
    unsigned long FileFlagsMask;
    unsigned long FileFlags;
    unsigned long FileOS;
    unsigned long FileType;
    unsigned long FileSubtype;
    unsigned long FileDateMS;
    unsigned long FileDateLS;
};

enum FileFlag {
    FileFlagDebug           = 0x00000001,
    FileFlagPreRelease      = 0x00000002,
    FileFlagPatched         = 0x00000004,
    FileFlagPrivateBuild    = 0x00000008,
    FileFlagInfoInferred    = 0x00000010,
    FileFlagSpecialBuild    = 0x00000020,
};

enum MemoryProtect {
    PageNoAccess            = 0x00000001,
    PageReadOnly            = 0x00000002,
    PageReadWrite           = 0x00000004,
    PageWriteCopy           = 0x00000008,
    PageExecute             = 0x00000010,
    PageExecuteRead         = 0x00000020,
    PageExecuteReadWrite    = 0x00000040,
    PageExecuteWriteCopy    = 0x00000080
};

ussrhero's avatar
ussrhero committed
147 148 149 150 151 152 153 154 155 156 157
enum MemoryState {
    MemCommit               = 0x1000,
    MemReserve              = 0x2000,
    MemFree                 = 0x10000
};

enum MemoryType {
    MemPrivate              = 0x20000,
    MemMapped               = 0x40000,
    MemImage                = 0x1000000    
};
ussrhero's avatar
ussrhero committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204

enum ProcessExitReason {
    ProcessExit,
    ProcessTerminate,
    ProcessDetach
};

enum ProcessDebugOptions {
    ProcessBreakOnStart    = 0x00000001,
    ProcessBreakOnStop     = 0x00000002,
    ProcessDebugChildren   = 0x00000004,
    ProcessNoDebugHeap     = 0x00000008,

    ProcessDebugDefault = ProcessBreakOnStart
};

typedef unsigned long  ProcessDebugFlags;


struct FrameDesc {
    MEMOFFSET_64            instructionOffset;
    MEMOFFSET_64            returnOffset;
    MEMOFFSET_64            frameOffset;
    MEMOFFSET_64            stackOffset; 
};

struct SyntheticSymbol {
    MEMOFFSET_64    moduleBase;
    SYMBOL_ID       symbolId;
};

enum VarStorage {
    UnknownVar,
    MemoryVar,
    RegisterVar
};


struct LiveProcessInfo {
    PROCESS_ID  pid;
    PROCESS_ID  parentPid;
    std::wstring  name;
    std::wstring  user;
    std::wstring  commandLine;
};

enum DebugOptions {
Aleksey R.'s avatar
Aleksey R. committed
205 206
    AllowNetworkPaths = 0x00000004,
    DisallowNetworkPaths = 0x00000008,
ussrhero's avatar
ussrhero committed
207 208
    InitialBreak = 0x00000020,
    FinalBreak = 0x00000040,
Aleksey R.'s avatar
Aleksey R. committed
209 210 211
    FailIncompleteInformation = 0x00000200,
    DisableModuleSymbolLoad = 0x00008000,
    DisallowImageFileMapping = 0x00020000,
ussrhero's avatar
ussrhero committed
212 213 214 215 216 217 218 219
    PreferDml =  0x00040000
};

typedef unsigned long  DebugOptionsSet;

enum BreakpointAccess {
    Read = 0x00000001,
    Write = 0x00000002,
220
    Execute =  0x00000004
ussrhero's avatar
ussrhero committed
221 222 223
};


ussrhero's avatar
ussrhero committed
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
enum OutputFlag
{
    Normal = 0x00000001,
    Error = 0x00000002,
    Warning = 0x00000004,
    Verbose = 0x00000008,
    Prompt = 0x00000010,
    PromptRegister = 0x00000020,
    ExtensionWarning = 0x00000040,
    Debuggee = 0x00000080,
    DebuggeePrompt = 0x00000100,
    Symbols = 0x00000200,
    Status = 0x00000400,
    All = 0x000007FF
};

ussrhero's avatar
ussrhero committed
240 241
typedef unsigned long  OutputFlagsSet;

242 243 244 245 246 247 248 249 250 251 252
enum DumpType
{
    Small = 1024,
    Default = 1025,
    Full = 1026,
    Image = 1027,
    KernelSmall = Small,
    Kernel = Default,
    KernelFull = Full
};

ussrhero's avatar
ussrhero committed
253 254 255 256 257
///////////////////////////////////////////////////////////////////////////////

} // kdlib namespace end