xref: /openbsd-src/gnu/llvm/lldb/source/API/SBCommandInterpreterRunOptions.cpp (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1dda28197Spatrick //===-- SBCommandInterpreterRunOptions.cpp --------------------------------===//
2dda28197Spatrick //
3dda28197Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4dda28197Spatrick // See https://llvm.org/LICENSE.txt for license information.
5dda28197Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6dda28197Spatrick //
7dda28197Spatrick //===----------------------------------------------------------------------===//
8dda28197Spatrick 
9dda28197Spatrick #include "lldb/lldb-types.h"
10dda28197Spatrick 
11*f6aab3d8Srobert #include "lldb/Utility/Instrumentation.h"
12dda28197Spatrick 
13dda28197Spatrick #include "lldb/API/SBCommandInterpreterRunOptions.h"
14dda28197Spatrick #include "lldb/Interpreter/CommandInterpreter.h"
15dda28197Spatrick 
16dda28197Spatrick #include <memory>
17dda28197Spatrick 
18dda28197Spatrick using namespace lldb;
19dda28197Spatrick using namespace lldb_private;
20dda28197Spatrick 
SBCommandInterpreterRunOptions()21dda28197Spatrick SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {
22*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
23dda28197Spatrick 
24dda28197Spatrick   m_opaque_up = std::make_unique<CommandInterpreterRunOptions>();
25dda28197Spatrick }
26dda28197Spatrick 
SBCommandInterpreterRunOptions(const SBCommandInterpreterRunOptions & rhs)27be691f3bSpatrick SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions(
28*f6aab3d8Srobert     const SBCommandInterpreterRunOptions &rhs) {
29*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, rhs);
30be691f3bSpatrick 
31be691f3bSpatrick   m_opaque_up = std::make_unique<CommandInterpreterRunOptions>(rhs.ref());
32be691f3bSpatrick }
33be691f3bSpatrick 
34dda28197Spatrick SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;
35dda28197Spatrick 
operator =(const SBCommandInterpreterRunOptions & rhs)36be691f3bSpatrick SBCommandInterpreterRunOptions &SBCommandInterpreterRunOptions::operator=(
37be691f3bSpatrick     const SBCommandInterpreterRunOptions &rhs) {
38*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, rhs);
39be691f3bSpatrick 
40be691f3bSpatrick   if (this == &rhs)
41*f6aab3d8Srobert     return *this;
42be691f3bSpatrick   *m_opaque_up = *rhs.m_opaque_up;
43*f6aab3d8Srobert   return *this;
44be691f3bSpatrick }
45be691f3bSpatrick 
GetStopOnContinue() const46dda28197Spatrick bool SBCommandInterpreterRunOptions::GetStopOnContinue() const {
47*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
48dda28197Spatrick 
49dda28197Spatrick   return m_opaque_up->GetStopOnContinue();
50dda28197Spatrick }
51dda28197Spatrick 
SetStopOnContinue(bool stop_on_continue)52dda28197Spatrick void SBCommandInterpreterRunOptions::SetStopOnContinue(bool stop_on_continue) {
53*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, stop_on_continue);
54dda28197Spatrick 
55dda28197Spatrick   m_opaque_up->SetStopOnContinue(stop_on_continue);
56dda28197Spatrick }
57dda28197Spatrick 
GetStopOnError() const58dda28197Spatrick bool SBCommandInterpreterRunOptions::GetStopOnError() const {
59*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
60dda28197Spatrick 
61dda28197Spatrick   return m_opaque_up->GetStopOnError();
62dda28197Spatrick }
63dda28197Spatrick 
SetStopOnError(bool stop_on_error)64dda28197Spatrick void SBCommandInterpreterRunOptions::SetStopOnError(bool stop_on_error) {
65*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, stop_on_error);
66dda28197Spatrick 
67dda28197Spatrick   m_opaque_up->SetStopOnError(stop_on_error);
68dda28197Spatrick }
69dda28197Spatrick 
GetStopOnCrash() const70dda28197Spatrick bool SBCommandInterpreterRunOptions::GetStopOnCrash() const {
71*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
72dda28197Spatrick 
73dda28197Spatrick   return m_opaque_up->GetStopOnCrash();
74dda28197Spatrick }
75dda28197Spatrick 
SetStopOnCrash(bool stop_on_crash)76dda28197Spatrick void SBCommandInterpreterRunOptions::SetStopOnCrash(bool stop_on_crash) {
77*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, stop_on_crash);
78dda28197Spatrick 
79dda28197Spatrick   m_opaque_up->SetStopOnCrash(stop_on_crash);
80dda28197Spatrick }
81dda28197Spatrick 
GetEchoCommands() const82dda28197Spatrick bool SBCommandInterpreterRunOptions::GetEchoCommands() const {
83*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
84dda28197Spatrick 
85dda28197Spatrick   return m_opaque_up->GetEchoCommands();
86dda28197Spatrick }
87dda28197Spatrick 
SetEchoCommands(bool echo_commands)88dda28197Spatrick void SBCommandInterpreterRunOptions::SetEchoCommands(bool echo_commands) {
89*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, echo_commands);
90dda28197Spatrick 
91dda28197Spatrick   m_opaque_up->SetEchoCommands(echo_commands);
92dda28197Spatrick }
93dda28197Spatrick 
GetEchoCommentCommands() const94dda28197Spatrick bool SBCommandInterpreterRunOptions::GetEchoCommentCommands() const {
95*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
96dda28197Spatrick 
97dda28197Spatrick   return m_opaque_up->GetEchoCommentCommands();
98dda28197Spatrick }
99dda28197Spatrick 
SetEchoCommentCommands(bool echo)100dda28197Spatrick void SBCommandInterpreterRunOptions::SetEchoCommentCommands(bool echo) {
101*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, echo);
102dda28197Spatrick 
103dda28197Spatrick   m_opaque_up->SetEchoCommentCommands(echo);
104dda28197Spatrick }
105dda28197Spatrick 
GetPrintResults() const106dda28197Spatrick bool SBCommandInterpreterRunOptions::GetPrintResults() const {
107*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
108dda28197Spatrick 
109dda28197Spatrick   return m_opaque_up->GetPrintResults();
110dda28197Spatrick }
111dda28197Spatrick 
SetPrintResults(bool print_results)112dda28197Spatrick void SBCommandInterpreterRunOptions::SetPrintResults(bool print_results) {
113*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, print_results);
114dda28197Spatrick 
115dda28197Spatrick   m_opaque_up->SetPrintResults(print_results);
116dda28197Spatrick }
117dda28197Spatrick 
GetPrintErrors() const118be691f3bSpatrick bool SBCommandInterpreterRunOptions::GetPrintErrors() const {
119*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
120be691f3bSpatrick 
121be691f3bSpatrick   return m_opaque_up->GetPrintErrors();
122be691f3bSpatrick }
123be691f3bSpatrick 
SetPrintErrors(bool print_errors)124be691f3bSpatrick void SBCommandInterpreterRunOptions::SetPrintErrors(bool print_errors) {
125*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, print_errors);
126be691f3bSpatrick 
127be691f3bSpatrick   m_opaque_up->SetPrintErrors(print_errors);
128be691f3bSpatrick }
129be691f3bSpatrick 
GetAddToHistory() const130dda28197Spatrick bool SBCommandInterpreterRunOptions::GetAddToHistory() const {
131*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
132dda28197Spatrick 
133dda28197Spatrick   return m_opaque_up->GetAddToHistory();
134dda28197Spatrick }
135dda28197Spatrick 
SetAddToHistory(bool add_to_history)136dda28197Spatrick void SBCommandInterpreterRunOptions::SetAddToHistory(bool add_to_history) {
137*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, add_to_history);
138dda28197Spatrick 
139dda28197Spatrick   m_opaque_up->SetAddToHistory(add_to_history);
140dda28197Spatrick }
141dda28197Spatrick 
GetAutoHandleEvents() const142dda28197Spatrick bool SBCommandInterpreterRunOptions::GetAutoHandleEvents() const {
143*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
144dda28197Spatrick 
145dda28197Spatrick   return m_opaque_up->GetAutoHandleEvents();
146dda28197Spatrick }
147dda28197Spatrick 
SetAutoHandleEvents(bool auto_handle_events)148dda28197Spatrick void SBCommandInterpreterRunOptions::SetAutoHandleEvents(
149dda28197Spatrick     bool auto_handle_events) {
150*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, auto_handle_events);
151dda28197Spatrick 
152dda28197Spatrick   m_opaque_up->SetAutoHandleEvents(auto_handle_events);
153dda28197Spatrick }
154dda28197Spatrick 
GetSpawnThread() const155dda28197Spatrick bool SBCommandInterpreterRunOptions::GetSpawnThread() const {
156*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
157dda28197Spatrick 
158dda28197Spatrick   return m_opaque_up->GetSpawnThread();
159dda28197Spatrick }
160dda28197Spatrick 
SetSpawnThread(bool spawn_thread)161dda28197Spatrick void SBCommandInterpreterRunOptions::SetSpawnThread(bool spawn_thread) {
162*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, spawn_thread);
163dda28197Spatrick 
164dda28197Spatrick   m_opaque_up->SetSpawnThread(spawn_thread);
165dda28197Spatrick }
166dda28197Spatrick 
167dda28197Spatrick lldb_private::CommandInterpreterRunOptions *
get() const168dda28197Spatrick SBCommandInterpreterRunOptions::get() const {
169dda28197Spatrick   return m_opaque_up.get();
170dda28197Spatrick }
171dda28197Spatrick 
172dda28197Spatrick lldb_private::CommandInterpreterRunOptions &
ref() const173dda28197Spatrick SBCommandInterpreterRunOptions::ref() const {
174dda28197Spatrick   return *m_opaque_up;
175dda28197Spatrick }
176dda28197Spatrick 
SBCommandInterpreterRunResult()177dda28197Spatrick SBCommandInterpreterRunResult::SBCommandInterpreterRunResult()
178dda28197Spatrick     : m_opaque_up(new CommandInterpreterRunResult())
179dda28197Spatrick 
180dda28197Spatrick {
181*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
182dda28197Spatrick }
183dda28197Spatrick 
SBCommandInterpreterRunResult(const SBCommandInterpreterRunResult & rhs)184dda28197Spatrick SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(
185dda28197Spatrick     const SBCommandInterpreterRunResult &rhs)
186dda28197Spatrick     : m_opaque_up(new CommandInterpreterRunResult()) {
187*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, rhs);
188dda28197Spatrick 
189dda28197Spatrick   *m_opaque_up = *rhs.m_opaque_up;
190dda28197Spatrick }
191dda28197Spatrick 
SBCommandInterpreterRunResult(const CommandInterpreterRunResult & rhs)192dda28197Spatrick SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(
193*f6aab3d8Srobert     const CommandInterpreterRunResult &rhs) {
194dda28197Spatrick   m_opaque_up = std::make_unique<CommandInterpreterRunResult>(rhs);
195dda28197Spatrick }
196dda28197Spatrick 
197dda28197Spatrick SBCommandInterpreterRunResult::~SBCommandInterpreterRunResult() = default;
198dda28197Spatrick 
operator =(const SBCommandInterpreterRunResult & rhs)199dda28197Spatrick SBCommandInterpreterRunResult &SBCommandInterpreterRunResult::operator=(
200dda28197Spatrick     const SBCommandInterpreterRunResult &rhs) {
201*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this, rhs);
202dda28197Spatrick 
203dda28197Spatrick   if (this == &rhs)
204*f6aab3d8Srobert     return *this;
205dda28197Spatrick   *m_opaque_up = *rhs.m_opaque_up;
206*f6aab3d8Srobert   return *this;
207dda28197Spatrick }
208dda28197Spatrick 
GetNumberOfErrors() const209dda28197Spatrick int SBCommandInterpreterRunResult::GetNumberOfErrors() const {
210*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
211dda28197Spatrick 
212dda28197Spatrick   return m_opaque_up->GetNumErrors();
213dda28197Spatrick }
214dda28197Spatrick 
215dda28197Spatrick lldb::CommandInterpreterResult
GetResult() const216dda28197Spatrick SBCommandInterpreterRunResult::GetResult() const {
217*f6aab3d8Srobert   LLDB_INSTRUMENT_VA(this);
218dda28197Spatrick 
219dda28197Spatrick   return m_opaque_up->GetResult();
220dda28197Spatrick }
221