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
17namespace lldb_private
18{
19    //----------------------------------------------------------------------
20    // Every register is described in detail including its name, alternate
21    // name (optional), encoding, size in bytes and the default display
22    // format.
23    //----------------------------------------------------------------------
24    typedef struct
25    {
26        const char *name;        // Name of this register, can't be NULL
27        const char *alt_name;    // Alternate name of this register, can be NULL
28        uint32_t byte_size;      // Size in bytes of the register
29        uint32_t byte_offset;    // The byte offset in the register context data where this register's value is found
30        lldb::Encoding encoding; // Encoding of the register bits
31        lldb::Format format;     // Default display format
32        uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register numbers for all register kinds
33        uint32_t *value_regs;    // List of registers that must be terminated with LLDB_INVALID_REGNUM
34        uint32_t *invalidate_regs; // List of registers that must be invalidated when this register is modified, list must be terminated with LLDB_INVALID_REGNUM
35    } RegisterInfo;
36
37    //----------------------------------------------------------------------
38    // Registers are grouped into register sets
39    //----------------------------------------------------------------------
40    typedef struct
41    {
42        const char *name;           // Name of this register set
43        const char *short_name;     // A short name for this register set
44        size_t num_registers;       // The number of registers in REGISTERS array below
45        const uint32_t *registers;  // An array of register numbers in this set
46    } RegisterSet;
47
48    typedef struct
49    {
50        int64_t value;
51        const char *string_value;
52        const char *usage;
53    } OptionEnumValueElement;
54
55    typedef struct
56    {
57        uint32_t usage_mask;                     // Used to mark options that can be used together.  If (1 << n & usage_mask) != 0
58                                                 // then this option belongs to option set n.
59        bool required;                           // This option is required (in the current usage level)
60        const char *long_option;                 // Full name for this option.
61        int short_option;                        // Single character for this option.
62        int option_has_arg;                      // no_argument, required_argument or optional_argument
63        OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
64        uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
65        lldb::CommandArgumentType argument_type; // Type of argument this option takes
66        const char *usage_text;                  // Full text explaining what this options does and what (if any) argument to
67                                                 // pass it.
68    } OptionDefinition;
69
70} // namespace lldb_private
71
72#endif  // #if defined(__cplusplus)
73
74#endif  // liblldb_lldb_private_types_h_
75