Path: blob/main/contrib/llvm-project/lldb/source/API/SBCommandInterpreterRunOptions.cpp
39587 views
//===-- SBCommandInterpreterRunOptions.cpp --------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/lldb-types.h"910#include "lldb/Utility/Instrumentation.h"1112#include "lldb/API/SBCommandInterpreterRunOptions.h"13#include "lldb/Interpreter/CommandInterpreter.h"1415#include <memory>1617using namespace lldb;18using namespace lldb_private;1920SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {21LLDB_INSTRUMENT_VA(this);2223m_opaque_up = std::make_unique<CommandInterpreterRunOptions>();24}2526SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions(27const SBCommandInterpreterRunOptions &rhs) {28LLDB_INSTRUMENT_VA(this, rhs);2930m_opaque_up = std::make_unique<CommandInterpreterRunOptions>(rhs.ref());31}3233SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;3435SBCommandInterpreterRunOptions &SBCommandInterpreterRunOptions::operator=(36const SBCommandInterpreterRunOptions &rhs) {37LLDB_INSTRUMENT_VA(this, rhs);3839if (this == &rhs)40return *this;41*m_opaque_up = *rhs.m_opaque_up;42return *this;43}4445bool SBCommandInterpreterRunOptions::GetStopOnContinue() const {46LLDB_INSTRUMENT_VA(this);4748return m_opaque_up->GetStopOnContinue();49}5051void SBCommandInterpreterRunOptions::SetStopOnContinue(bool stop_on_continue) {52LLDB_INSTRUMENT_VA(this, stop_on_continue);5354m_opaque_up->SetStopOnContinue(stop_on_continue);55}5657bool SBCommandInterpreterRunOptions::GetStopOnError() const {58LLDB_INSTRUMENT_VA(this);5960return m_opaque_up->GetStopOnError();61}6263void SBCommandInterpreterRunOptions::SetStopOnError(bool stop_on_error) {64LLDB_INSTRUMENT_VA(this, stop_on_error);6566m_opaque_up->SetStopOnError(stop_on_error);67}6869bool SBCommandInterpreterRunOptions::GetStopOnCrash() const {70LLDB_INSTRUMENT_VA(this);7172return m_opaque_up->GetStopOnCrash();73}7475void SBCommandInterpreterRunOptions::SetStopOnCrash(bool stop_on_crash) {76LLDB_INSTRUMENT_VA(this, stop_on_crash);7778m_opaque_up->SetStopOnCrash(stop_on_crash);79}8081bool SBCommandInterpreterRunOptions::GetEchoCommands() const {82LLDB_INSTRUMENT_VA(this);8384return m_opaque_up->GetEchoCommands();85}8687void SBCommandInterpreterRunOptions::SetEchoCommands(bool echo_commands) {88LLDB_INSTRUMENT_VA(this, echo_commands);8990m_opaque_up->SetEchoCommands(echo_commands);91}9293bool SBCommandInterpreterRunOptions::GetEchoCommentCommands() const {94LLDB_INSTRUMENT_VA(this);9596return m_opaque_up->GetEchoCommentCommands();97}9899void SBCommandInterpreterRunOptions::SetEchoCommentCommands(bool echo) {100LLDB_INSTRUMENT_VA(this, echo);101102m_opaque_up->SetEchoCommentCommands(echo);103}104105bool SBCommandInterpreterRunOptions::GetPrintResults() const {106LLDB_INSTRUMENT_VA(this);107108return m_opaque_up->GetPrintResults();109}110111void SBCommandInterpreterRunOptions::SetPrintResults(bool print_results) {112LLDB_INSTRUMENT_VA(this, print_results);113114m_opaque_up->SetPrintResults(print_results);115}116117bool SBCommandInterpreterRunOptions::GetPrintErrors() const {118LLDB_INSTRUMENT_VA(this);119120return m_opaque_up->GetPrintErrors();121}122123void SBCommandInterpreterRunOptions::SetPrintErrors(bool print_errors) {124LLDB_INSTRUMENT_VA(this, print_errors);125126m_opaque_up->SetPrintErrors(print_errors);127}128129bool SBCommandInterpreterRunOptions::GetAddToHistory() const {130LLDB_INSTRUMENT_VA(this);131132return m_opaque_up->GetAddToHistory();133}134135void SBCommandInterpreterRunOptions::SetAddToHistory(bool add_to_history) {136LLDB_INSTRUMENT_VA(this, add_to_history);137138m_opaque_up->SetAddToHistory(add_to_history);139}140141bool SBCommandInterpreterRunOptions::GetAutoHandleEvents() const {142LLDB_INSTRUMENT_VA(this);143144return m_opaque_up->GetAutoHandleEvents();145}146147void SBCommandInterpreterRunOptions::SetAutoHandleEvents(148bool auto_handle_events) {149LLDB_INSTRUMENT_VA(this, auto_handle_events);150151m_opaque_up->SetAutoHandleEvents(auto_handle_events);152}153154bool SBCommandInterpreterRunOptions::GetSpawnThread() const {155LLDB_INSTRUMENT_VA(this);156157return m_opaque_up->GetSpawnThread();158}159160void SBCommandInterpreterRunOptions::SetSpawnThread(bool spawn_thread) {161LLDB_INSTRUMENT_VA(this, spawn_thread);162163m_opaque_up->SetSpawnThread(spawn_thread);164}165166bool SBCommandInterpreterRunOptions::GetAllowRepeats() const {167LLDB_INSTRUMENT_VA(this);168169return m_opaque_up->GetAllowRepeats();170}171172void SBCommandInterpreterRunOptions::SetAllowRepeats(bool allow_repeats) {173LLDB_INSTRUMENT_VA(this, allow_repeats);174175m_opaque_up->SetAllowRepeats(allow_repeats);176}177178lldb_private::CommandInterpreterRunOptions *179SBCommandInterpreterRunOptions::get() const {180return m_opaque_up.get();181}182183lldb_private::CommandInterpreterRunOptions &184SBCommandInterpreterRunOptions::ref() const {185return *m_opaque_up;186}187188SBCommandInterpreterRunResult::SBCommandInterpreterRunResult()189: m_opaque_up(new CommandInterpreterRunResult())190191{192LLDB_INSTRUMENT_VA(this);193}194195SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(196const SBCommandInterpreterRunResult &rhs)197: m_opaque_up(new CommandInterpreterRunResult()) {198LLDB_INSTRUMENT_VA(this, rhs);199200*m_opaque_up = *rhs.m_opaque_up;201}202203SBCommandInterpreterRunResult::SBCommandInterpreterRunResult(204const CommandInterpreterRunResult &rhs) {205m_opaque_up = std::make_unique<CommandInterpreterRunResult>(rhs);206}207208SBCommandInterpreterRunResult::~SBCommandInterpreterRunResult() = default;209210SBCommandInterpreterRunResult &SBCommandInterpreterRunResult::operator=(211const SBCommandInterpreterRunResult &rhs) {212LLDB_INSTRUMENT_VA(this, rhs);213214if (this == &rhs)215return *this;216*m_opaque_up = *rhs.m_opaque_up;217return *this;218}219220int SBCommandInterpreterRunResult::GetNumberOfErrors() const {221LLDB_INSTRUMENT_VA(this);222223return m_opaque_up->GetNumErrors();224}225226lldb::CommandInterpreterResult227SBCommandInterpreterRunResult::GetResult() const {228LLDB_INSTRUMENT_VA(this);229230return m_opaque_up->GetResult();231}232233234