]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/lldb-private-types.h
Update LLDB snapshot to upstream r216948 (git 50f7fe44)
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / lldb-private-types.h
1 //===-- lldb-private-types.h ------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_lldb_private_types_h_
11 #define liblldb_lldb_private_types_h_
12
13 #if defined(__cplusplus)
14
15 #include "lldb/lldb-private.h"
16
17 namespace lldb_private
18 {
19     class Platform;
20     class ExecutionContext;
21
22     //----------------------------------------------------------------------
23     // Every register is described in detail including its name, alternate
24     // name (optional), encoding, size in bytes and the default display
25     // format.
26     //----------------------------------------------------------------------
27     typedef struct
28     {
29         const char *name;        // Name of this register, can't be NULL
30         const char *alt_name;    // Alternate name of this register, can be NULL
31         uint32_t byte_size;      // Size in bytes of the register
32         uint32_t byte_offset;    // The byte offset in the register context data where this register's value is found
33         lldb::Encoding encoding; // Encoding of the register bits
34         lldb::Format format;     // Default display format
35         uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register numbers for all register kinds
36         uint32_t *value_regs;    // List of registers that must be terminated with LLDB_INVALID_REGNUM
37         uint32_t *invalidate_regs; // List of registers that must be invalidated when this register is modified, list must be terminated with LLDB_INVALID_REGNUM
38     } RegisterInfo;
39
40     //----------------------------------------------------------------------
41     // Registers are grouped into register sets
42     //----------------------------------------------------------------------
43     typedef struct
44     {
45         const char *name;           // Name of this register set
46         const char *short_name;     // A short name for this register set
47         size_t num_registers;       // The number of registers in REGISTERS array below
48         const uint32_t *registers;  // An array of register numbers in this set
49     } RegisterSet;
50
51     typedef struct
52     {
53         int64_t value;
54         const char *string_value;
55         const char *usage;
56     } OptionEnumValueElement;
57
58     struct OptionValidator
59     {
60         virtual ~OptionValidator() { }
61         virtual bool IsValid(Platform &platform, const ExecutionContext &target) const = 0;
62         virtual const char * ShortConditionString() const = 0;
63         virtual const char * LongConditionString() const = 0;
64     };
65     
66     struct OptionDefinition
67     {
68         uint32_t usage_mask;                     // Used to mark options that can be used together.  If (1 << n & usage_mask) != 0
69                                                  // then this option belongs to option set n.
70         bool required;                           // This option is required (in the current usage level)
71         const char *long_option;                 // Full name for this option.
72         int short_option;                        // Single character for this option.
73         int option_has_arg;                      // no_argument, required_argument or optional_argument
74         OptionValidator* validator;              // If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
75         OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
76         uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
77         lldb::CommandArgumentType argument_type; // Type of argument this option takes
78         const char *usage_text;                  // Full text explaining what this options does and what (if any) argument to
79                                                  // pass it.
80     };
81
82 } // namespace lldb_private
83
84 #endif  // #if defined(__cplusplus)
85
86 #endif  // liblldb_lldb_private_types_h_