]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/lldb-private-types.h
MFV ntp-4.2.8p3 (r284990).
[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                                  // This is optional, and can be 0 if a particular RegisterContext does not need to
34                                  // address its registers by byte offset.
35         lldb::Encoding encoding; // Encoding of the register bits
36         lldb::Format format;     // Default display format
37         uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register numbers for all register kinds
38         uint32_t *value_regs;      // List of registers (terminated with LLDB_INVALID_REGNUM).  If this value is not
39                                    // null, all registers in this list will be read first, at which point the value 
40                                    // for this register will be valid.  For example, the value list for ah
41                                    // would be eax (x86) or rax (x64).
42         uint32_t *invalidate_regs; // List of registers (terminated with LLDB_INVALID_REGNUM).  If this value is not
43                                    // null, all registers in this list will be invalidateed when the value of this
44                                    // register changes.  For example, the invalidate list for eax would be rax
45                                    // ax, ah, and al.
46     } RegisterInfo;
47
48     //----------------------------------------------------------------------
49     // Registers are grouped into register sets
50     //----------------------------------------------------------------------
51     typedef struct
52     {
53         const char *name;           // Name of this register set
54         const char *short_name;     // A short name for this register set
55         size_t num_registers;       // The number of registers in REGISTERS array below
56         const uint32_t *registers;  // An array of register indices in this set.  The values in this array are
57                                     // *indices* (not register numbers) into a particular RegisterContext's
58                                     // register array.  For example, if eax is defined at index 4 for a
59                                     // particular RegisterContext, eax would be included in this RegisterSet
60                                     // by adding the value 4.  Not by adding the value lldb_eax_i386.
61     } RegisterSet;
62
63     typedef struct
64     {
65         int64_t value;
66         const char *string_value;
67         const char *usage;
68     } OptionEnumValueElement;
69
70     struct OptionValidator
71     {
72         virtual ~OptionValidator() { }
73         virtual bool IsValid(Platform &platform, const ExecutionContext &target) const = 0;
74         virtual const char * ShortConditionString() const = 0;
75         virtual const char * LongConditionString() const = 0;
76     };
77     
78     struct OptionDefinition
79     {
80         uint32_t usage_mask;                     // Used to mark options that can be used together.  If (1 << n & usage_mask) != 0
81                                                  // then this option belongs to option set n.
82         bool required;                           // This option is required (in the current usage level)
83         const char *long_option;                 // Full name for this option.
84         int short_option;                        // Single character for this option.
85         int option_has_arg;                      // no_argument, required_argument or optional_argument
86         OptionValidator* validator;              // If non-NULL, option is valid iff |validator->IsValid()|, otherwise always valid.
87         OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
88         uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
89         lldb::CommandArgumentType argument_type; // Type of argument this option takes
90         const char *usage_text;                  // Full text explaining what this options does and what (if any) argument to
91                                                  // pass it.
92     };
93
94 } // namespace lldb_private
95
96 #endif  // #if defined(__cplusplus)
97
98 #endif  // liblldb_lldb_private_types_h_