LLDB mainline
SBExpressionOptions.h
Go to the documentation of this file.
1//===-- SBExpressionOptions.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_API_SBEXPRESSIONOPTIONS_H
10#define LLDB_API_SBEXPRESSIONOPTIONS_H
11
12#include "lldb/API/SBDefines.h"
13#include "lldb/API/SBLanguages.h"
14
15#include <vector>
16
17namespace lldb {
18
20public:
22
24
26
28
29 bool GetCoerceResultToId() const;
30
31 void SetCoerceResultToId(bool coerce = true);
32
33 bool GetUnwindOnError() const;
34
35 void SetUnwindOnError(bool unwind = true);
36
37 bool GetIgnoreBreakpoints() const;
38
39 void SetIgnoreBreakpoints(bool ignore = true);
40
42
45
46 uint32_t GetTimeoutInMicroSeconds() const;
47
48 // Set the timeout for the expression, 0 means wait forever.
49 void SetTimeoutInMicroSeconds(uint32_t timeout = 0);
50
51 uint32_t GetOneThreadTimeoutInMicroSeconds() const;
52
53 // Set the timeout for running on one thread, 0 means use the default
54 // behavior. If you set this higher than the overall timeout, you'll get an
55 // error when you try to run the expression.
56 void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
57
58 bool GetTryAllThreads() const;
59
60 void SetTryAllThreads(bool run_others = true);
61
62 bool GetStopOthers() const;
63
64 void SetStopOthers(bool stop_others = true);
65
66 bool GetTrapExceptions() const;
67
68 void SetTrapExceptions(bool trap_exceptions = true);
69
70 bool GetStopOnFork() const;
71
72 void SetStopOnFork(bool stop_on_fork = false);
73
74 void SetLanguage(lldb::LanguageType language);
75 /// Set the language using a pair of language code and version as
76 /// defined by the DWARF 6 specification.
77 /// WARNING: These codes may change until DWARF 6 is finalized.
78 void SetLanguage(lldb::SBSourceLanguageName name, uint32_t version);
79
80#ifndef SWIG
81 void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton);
82#endif
83
85
86 void SetGenerateDebugInfo(bool b = true);
87
89
90 void SetSuppressPersistentResult(bool b = false);
91
92 const char *GetPrefix() const;
93
94 void SetPrefix(const char *prefix);
95
96 void SetAutoApplyFixIts(bool b = true);
97
98 bool GetAutoApplyFixIts();
99
100 void SetRetriesWithFixIts(uint64_t retries);
101
102 uint64_t GetRetriesWithFixIts();
103
104 bool GetTopLevel();
105
106 void SetTopLevel(bool b = true);
107
108 // Gets whether we will JIT an expression if it cannot be interpreted
109 bool GetAllowJIT();
110
111 // Sets whether we will JIT an expression if it cannot be interpreted
112 void SetAllowJIT(bool allow);
113
114 bool GetBooleanLanguageOption(const char *option_name, SBError &error) const;
115
116 SBError SetBooleanLanguageOption(const char *option_name, bool value);
117
118protected:
120
122
123 friend class SBFrame;
124 friend class SBValue;
125 friend class SBTarget;
126
127private:
128 // This auto_pointer is made in the constructor and is always valid.
129 mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up;
130};
131
132} // namespace lldb
133
134#endif // LLDB_API_SBEXPRESSIONOPTIONS_H
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_API
Definition SBDefines.h:28
void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton)
bool GetBooleanLanguageOption(const char *option_name, SBError &error) const
void SetFetchDynamicValue(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
void SetStopOnFork(bool stop_on_fork=false)
void SetLanguage(lldb::LanguageType language)
lldb_private::EvaluateExpressionOptions & ref() const
void SetSuppressPersistentResult(bool b=false)
void SetTryAllThreads(bool run_others=true)
void SetRetriesWithFixIts(uint64_t retries)
std::unique_ptr< lldb_private::EvaluateExpressionOptions > m_opaque_up
void SetTrapExceptions(bool trap_exceptions=true)
void SetTimeoutInMicroSeconds(uint32_t timeout=0)
void SetStopOthers(bool stop_others=true)
void SetIgnoreBreakpoints(bool ignore=true)
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout=0)
uint32_t GetTimeoutInMicroSeconds() const
void SetCoerceResultToId(bool coerce=true)
SBError SetBooleanLanguageOption(const char *option_name, bool value)
const SBExpressionOptions & operator=(const lldb::SBExpressionOptions &rhs)
lldb_private::EvaluateExpressionOptions * get() const
void SetUnwindOnError(bool unwind=true)
lldb::DynamicValueType GetFetchDynamicValue() const
void SetPrefix(const char *prefix)
uint32_t GetOneThreadTimeoutInMicroSeconds() const
LanguageType
Programming language type.
@ eDynamicCanRunTarget
bool(* ExpressionCancelCallback)(lldb::ExpressionEvaluationPhase phase, void *baton)
Definition lldb-types.h:75