LLDB mainline
lldb-private-types.h
Go to the documentation of this file.
1//===-- lldb-private-types.h ------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_LLDB_PRIVATE_TYPES_H
10#define LLDB_LLDB_PRIVATE_TYPES_H
11
12#include "lldb/lldb-types.h"
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/SmallString.h"
15#include <type_traits>
16
17namespace llvm {
18namespace sys {
19class DynamicLibrary;
20}
21}
22
23namespace lldb_private {
24class Platform;
25class ExecutionContext;
26
27typedef llvm::SmallString<256> PathSmallString;
28
29typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)(
30 const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error);
31
32/// A type-erased pair of llvm::dwarf::SourceLanguageName and version.
34 SourceLanguage() = default;
35 explicit SourceLanguage(lldb::LanguageType language_type);
36
37 SourceLanguage(uint16_t name, uint32_t version)
38 : name(name), version(version) {}
39
41 std::optional<std::pair<uint16_t, uint32_t>> name_vers)
42 : name(name_vers ? name_vers->first : 0),
43 version(name_vers ? name_vers->second : 0) {}
44
45 explicit operator bool() const { return name > 0; }
46
48 llvm::StringRef GetDescription() const;
49 bool IsC() const;
50 bool IsObjC() const;
51 bool IsCPlusPlus() const;
52 uint16_t name = 0;
53 uint32_t version = 0;
54};
55
57 int64_t value;
58 const char *string_value;
59 const char *usage;
60};
61
62using OptionEnumValues = llvm::ArrayRef<OptionEnumValueElement>;
63
65 virtual ~OptionValidator() = default;
66 virtual bool IsValid(Platform &platform,
67 const ExecutionContext &target) const = 0;
68 virtual const char *ShortConditionString() const = 0;
69 virtual const char *LongConditionString() const = 0;
70};
71
72typedef struct type128 { uint64_t x[2]; } type128;
73typedef struct type256 { uint64_t x[4]; } type256;
74
75/// Functor that returns a ValueObjectSP for a variable given its name
76/// and the StackFrame of interest. Used primarily in the Materializer
77/// to refetch a ValueObject when the ExecutionContextScope changes.
80
81typedef void (*DebuggerDestroyCallback)(lldb::user_id_t debugger_id,
82 void *baton);
84 void *baton, const char **argv, lldb_private::CommandReturnObject &result);
85} // namespace lldb_private
86
87#endif // LLDB_LLDB_PRIVATE_TYPES_H
static llvm::raw_ostream & error(Stream &strm)
A uniqued constant string class.
Definition ConstString.h:40
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:57
A plug-in interface definition class for debug platform that includes many platform abilities such as...
Definition Platform.h:79
This base class provides an interface to stack frames.
Definition StackFrame.h:44
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
std::function< lldb::ValueObjectSP(ConstString, StackFrame *)> ValueObjectProviderTy
Functor that returns a ValueObjectSP for a variable given its name and the StackFrame of interest.
llvm::SmallString< 256 > PathSmallString
void(* DebuggerDestroyCallback)(lldb::user_id_t debugger_id, void *baton)
bool(* CommandOverrideCallbackWithResult)(void *baton, const char **argv, lldb_private::CommandReturnObject &result)
llvm::sys::DynamicLibrary(* LoadPluginCallbackType)(const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error)
llvm::ArrayRef< OptionEnumValueElement > OptionEnumValues
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Debugger > DebuggerSP
uint64_t user_id_t
Definition lldb-types.h:82
virtual ~OptionValidator()=default
virtual const char * LongConditionString() const =0
virtual const char * ShortConditionString() const =0
virtual bool IsValid(Platform &platform, const ExecutionContext &target) const =0
lldb::LanguageType AsLanguageType() const
Definition Language.cpp:614
SourceLanguage(std::optional< std::pair< uint16_t, uint32_t > > name_vers)
SourceLanguage(uint16_t name, uint32_t version)
llvm::StringRef GetDescription() const
Definition Language.cpp:621