lldb-defines.h revision 6778c99d79ae1db2d3f40a9f07d9e8ffda161799
169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//===-- lldb-defines.h ------------------------------------------*- C++ -*-===//
269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//
369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//                     The LLVM Compiler Infrastructure
469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//
569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// This file is distributed under the University of Illinois Open Source
669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// License. See LICENSE.TXT for details.
769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//
869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//===----------------------------------------------------------------------===//
969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
1069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#ifndef LLDB_lldb_defines_h_
1169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_lldb_defines_h_
1269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
1369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#include "lldb/lldb-types.h"
1469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
1569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#if !defined(UINT32_MAX)
1669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal    #define UINT32_MAX 4294967295U
1769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#endif
1869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
1969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#if !defined(UINT64_MAX)
2069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal    #define UINT64_MAX 18446744073709551615ULL
2169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#endif
2269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
2369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
2469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// LLDB version
2569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//
2669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// A build script phase can modify this version number if needed.
2769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
2869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//#define LLDB_VERSION
2969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//#define LLDB_REVISION
3069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//#define LLDB_VERSION_STRING
3169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
3269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
3369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// LLDB defines
3469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
3569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_GENERIC_ERROR              UINT32_MAX
3669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
3769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
3869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// Breakpoints
3969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
4069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_BREAK_ID           0
4169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_DEFAULT_BREAK_SIZE         0
4269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_BREAK_ID_IS_VALID(bid)     ((bid) != (LLDB_INVALID_BREAK_ID))
4369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_BREAK_ID_IS_INTERNAL(bid)  ((bid) < 0)
4469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
4569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
4669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// Watchpoints
4769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
4869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_WATCH_ID           0
4969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_WATCH_ID_IS_VALID(uid)     ((uid) != (LLDB_INVALID_WATCH_ID))
5069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_WATCH_TYPE_READ            (1u << 0)
5169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_WATCH_TYPE_WRITE           (1u << 1)
5269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
5369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
5469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// Generic Register Numbers
5569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
5669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_PC          0   // Program Counter
5769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_SP          1   // Stack Pointer
5869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_FP          2   // Frame Pointer
5969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_RA          3   // Return Address
6069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_FLAGS       4   // Processor flags register
6169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG1        5   // The register that would contain pointer size or less argument 1 (if any)
6269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG2        6   // The register that would contain pointer size or less argument 2 (if any)
6369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG3        7   // The register that would contain pointer size or less argument 3 (if any)
6469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG4        8   // The register that would contain pointer size or less argument 4 (if any)
6569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG5        9   // The register that would contain pointer size or less argument 5 (if any)
6669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG6        10  // The register that would contain pointer size or less argument 6 (if any)
6769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG7        11  // The register that would contain pointer size or less argument 7 (if any)
6869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_REGNUM_GENERIC_ARG8        12  // The register that would contain pointer size or less argument 8 (if any)
6969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//---------------------------------------------------------------------
7069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal/// Invalid value definitions
7169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
7269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_ADDRESS            UINT64_MAX
7369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_INDEX32            UINT32_MAX
7469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_IVAR_OFFSET        UINT32_MAX
7569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_IMAGE_TOKEN        UINT32_MAX
7669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_REGNUM             UINT32_MAX
7769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_UID                UINT64_MAX
7869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_PROCESS_ID         0
7969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_THREAD_ID          0
8069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_FRAME_ID           UINT32_MAX
8169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_SIGNAL_NUMBER      INT32_MAX
8269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_OFFSET             UINT64_MAX // Must match max of lldb::offset_t
8369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
8469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
8569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal/// CPU Type defintions
8669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
8769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_ARCH_DEFAULT               "systemArch"
8869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_ARCH_DEFAULT_32BIT         "systemArch32"
8969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_ARCH_DEFAULT_64BIT         "systemArch64"
9069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_INVALID_CPUTYPE            (0xFFFFFFFEu)
9169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
9269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
9369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal/// Option Set defintions
9469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
9569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// FIXME: I'm sure there's some #define magic that can create all 32 sets on the
9669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal// fly.  That would have the added benefit of making this unreadable.
9769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_MAX_NUM_OPTION_SETS        32
9869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_ALL                0xFFFFFFFFU
9969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_1                  (1U << 0)
10069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_2                  (1U << 1)
10169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_3                  (1U << 2)
10269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_4                  (1U << 3)
10369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_5                  (1U << 4)
10469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_6                  (1U << 5)
10569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_7                  (1U << 6)
10669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_8                  (1U << 7)
10769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_9                  (1U << 8)
10869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_10                 (1U << 9)
10969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define LLDB_OPT_SET_FROM_TO(A, B)      (((1U << (B)) - 1) ^ (((1U << (A))-1) >> 1))
11069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
11169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#if defined(__cplusplus)
11269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
11369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
11469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal/// @def DISALLOW_COPY_AND_ASSIGN(TypeName)
11569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal///     Macro definition for easily disallowing copy constructor and
11669e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal///     assignment operators in C++ classes.
11769e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal//----------------------------------------------------------------------
11869e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
11969e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal    TypeName(const TypeName&); \
12069e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal    const TypeName& operator=(const TypeName&)
12169e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
12269e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#endif // #if defined(__cplusplus)
12369e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal
12469e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal#endif  // LLDB_lldb_defines_h_
12569e17611504376e4d4603925f8528dfc890fd2c6Luis Sigal