LLDB mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
lldb_private::Status Class Reference

An error handling class. More...

#include "lldb/Utility/Status.h"

Public Types

typedef uint32_t ValueType
 Every error value that this object can contain needs to be able to fit into ValueType.
 

Public Member Functions

 Status ()
 
 Status (ValueType err, lldb::ErrorType type=lldb::eErrorTypeGeneric)
 Initialize the error object with a generic success value.
 
 Status (std::error_code EC)
 
 Status (const char *format,...) __attribute__((format(printf
 
 ~Status ()
 
 Status (llvm::Error error)
 
const Statusoperator= (llvm::Error error)
 
llvm::Error ToError () const
 
const char * AsCString (const char *default_error_str="unknown error") const
 Get the error string associated with the current error.
 
void Clear ()
 Clear the object state.
 
bool Fail () const
 Test for error condition.
 
ValueType GetError () const
 Access the error value.
 
lldb::ErrorType GetType () const
 Access the error type.
 
void SetExpressionError (lldb::ExpressionResults, const char *mssg)
 
int SetExpressionErrorWithFormat (lldb::ExpressionResults, const char *format,...) __attribute__((format(printf
 
int void SetError (ValueType err, lldb::ErrorType type)
 Set accessor with an error value and type.
 
void SetErrorToErrno ()
 Set the current error to errno.
 
void SetErrorToGenericError ()
 Set the current error to a generic error.
 
void SetErrorString (llvm::StringRef err_str)
 Set the current error string to err_str.
 
int SetErrorStringWithFormat (const char *format,...) __attribute__((format(printf
 Set the current error string to a formatted error string.
 
int int SetErrorStringWithVarArg (const char *format, va_list args)
 
template<typename... Args>
void SetErrorStringWithFormatv (const char *format, Args &&... args)
 
bool Success () const
 Test for success condition.
 

Static Public Member Functions

template<typename... Args>
static Status createWithFormat (const char *format, Args &&...args)
 

Protected Attributes

ValueType m_code = 0
 Member variables.
 
lldb::ErrorType m_type
 The type of the above error code.
 
std::string m_string
 A string representation of the error code.
 

Private Member Functions

 Status (const llvm::formatv_object_base &payload)
 

Detailed Description

An error handling class.

This class is designed to be able to hold any error code that can be encountered on a given platform. The errors are stored as a value of type Status::ValueType. This value should be large enough to hold any and all errors that the class supports. Each error has an associated type that is of type lldb::ErrorType. New types can be added to support new error types, and architecture specific types can be enabled. In the future we may wish to switch to a registration mechanism where new error types can be registered at runtime instead of a hard coded scheme.

All errors in this class also know how to generate a string representation of themselves for printing results and error codes. The string value will be fetched on demand and its string value will be cached until the error is cleared of the value of the error changes.

Definition at line 44 of file Status.h.

Member Typedef Documentation

◆ ValueType

Every error value that this object can contain needs to be able to fit into ValueType.

Definition at line 48 of file Status.h.

Constructor & Destructor Documentation

◆ Status() [1/6]

Status::Status ( )

Definition at line 40 of file Status.cpp.

Referenced by createWithFormat().

◆ Status() [2/6]

Status::Status ( ValueType  err,
lldb::ErrorType  type = lldb::eErrorTypeGeneric 
)
explicit

Initialize the error object with a generic success value.

Parameters
[in]errAn error code.
[in]typeThe type for err.

Definition at line 42 of file Status.cpp.

◆ Status() [3/6]

Status::Status ( std::error_code  EC)

Definition at line 48 of file Status.cpp.

◆ Status() [4/6]

Status::Status ( const char *  format,
  ... 
)
explicit

Definition at line 54 of file Status.cpp.

References SetErrorStringWithVarArg(), and SetErrorToGenericError().

◆ ~Status()

Status::~Status ( )
default

◆ Status() [5/6]

lldb_private::Status::Status ( llvm::Error  error)
inlineexplicit

Definition at line 75 of file Status.h.

References error().

◆ Status() [6/6]

lldb_private::Status::Status ( const llvm::formatv_object_base &  payload)
inlineexplicitprivate

Definition at line 190 of file Status.h.

References m_string, and SetErrorToGenericError().

Member Function Documentation

◆ AsCString()

const char * Status::AsCString ( const char *  default_error_str = "unknown error") const

Get the error string associated with the current error.

Gets the error value as a NULL terminated C string. The error string will be fetched and cached on demand. The error string will be retrieved from a callback that is appropriate for the type of the error and will be cached until the error value is changed or cleared.

Returns
The error as a NULL terminated C string value if the error is valid and is able to be converted to a string value, NULL otherwise.

Definition at line 130 of file Status.cpp.

References lldb::eErrorTypeMachKernel, lldb::eErrorTypePOSIX, lldb::eErrorTypeWin32, m_code, m_string, m_type, and Success().

Referenced by lldb_private::ClangUserExpression::AddArguments(), lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), lldb_private::Process::CanJIT(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ConnectLocally(), CommandObjectScriptingObjectParsed::Create(), lldb_private::Breakpoint::CreateFromStructuredData(), lldb_private::BreakpointOptions::CreateFromStructuredData(), EntityPersistentVariable::Dematerialize(), EntityVariableBase::Dematerialize(), EntityRegister::Dematerialize(), EntityPersistentVariable::DestroyAllocation(), lldb_private::IRExecutionUnit::DisassembleFunction(), lldb_private::ConnectionFileDescriptor::Disconnect(), CommandObjectBreakpointSet::DoExecute(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), CommandObjectCommandsContainerDelete::DoExecute(), CommandObjectPlatformProcessAttach::DoExecute(), CommandObjectTargetCreate::DoExecute(), lldb_private::LLVMUserExpression::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::ValueObject::DumpPrintableRepresentation(), lldb_private::LLVMUserExpression::FinalizeJITExecution(), lldb_private::StringSummaryFormat::GetDescription(), lldb_private::ThreadPlanStepInRange::GetDescription(), lldb_private::ThreadPlanStepInstruction::GetDescription(), lldb_private::ThreadPlanStepOverRange::GetDescription(), lldb::SBValue::GetError(), lldb_private::MemoryHistoryASan::GetHistoryThreads(), lldb_private::Module::GetMemoryObjectFile(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::IRExecutionUnit::GetRunnableInfo(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetSeparateDebugInfo(), lldb::SBValue::GetValueAsSigned(), lldb::SBValue::GetValueAsUnsigned(), lldb_private::ValueObjectPrinter::GetValueSummaryError(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qLaunchSuccess(), HandleFileAction(), lldb_private::ClangUtilityFunction::Install(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(), EntityPersistentVariable::MakeAllocation(), PlatformPOSIX::MakeLoadImageUtilityFunction(), EntityPersistentVariable::Materialize(), EntityVariableBase::Materialize(), EntityResultVariable::Materialize(), EntitySymbol::Materialize(), EntityRegister::Materialize(), lldb_private::ConnectionFileDescriptor::OpenCommandPipe(), lldb_private::ClangUserExpression::Parse(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::ClangExpressionParser::PrepareForExecution(), lldb_private::ClangUserExpression::PrepareForParsing(), lldb_private::LLVMUserExpression::PrepareToExecuteJITExpression(), lldb_private::ValueObjectPrinter::PrintValueObject(), lldb::SBThreadPlan::QueueThreadPlanForRunToAddress(), lldb::SBThreadPlan::QueueThreadPlanForStepInRange(), lldb::SBThreadPlan::QueueThreadPlanForStepOut(), lldb::SBThreadPlan::QueueThreadPlanForStepOverRange(), lldb::SBThreadPlan::QueueThreadPlanForStepScripted(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), RecurseCopy_Callback(), lldb_private::process_linux::NativeThreadLinux::RequestStop(), lldb_private::ReportRetriever::RetrieveReportData(), lldb_private::InstrumentationRuntimeTSan::RetrieveReportData(), lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(), lldb_private::Process::RunThreadPlan(), lldb::SBThread::RunToAddress(), lldb_private::ValueObject::SetData(), lldb::SBValue::SetData(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), CommandObjectBreakpointRead::CommandOptions::SetOptionValue(), CommandObjectSourceList::CommandOptions::SetOptionValue(), ABIMacOSX_arm64::SetReturnValueObject(), ABISysV_arm64::SetReturnValueObject(), ABISysV_arc::SetReturnValueObject(), ABIMacOSX_arm::SetReturnValueObject(), ABISysV_arm::SetReturnValueObject(), ABISysV_mips::SetReturnValueObject(), ABISysV_mips64::SetReturnValueObject(), ABISysV_ppc::SetReturnValueObject(), ABISysV_ppc64::SetReturnValueObject(), ABISysV_riscv::SetReturnValueObject(), ABISysV_s390x::SetReturnValueObject(), ABIMacOSX_i386::SetReturnValueObject(), ABISysV_i386::SetReturnValueObject(), ABISysV_x86_64::SetReturnValueObject(), ABIWindows_x86_64::SetReturnValueObject(), lldb::SBThread::StepInstruction(), lldb::SBThread::StepInto(), lldb::SBThread::StepOut(), lldb::SBThread::StepOutOfFrame(), lldb::SBThread::StepOverUntil(), lldb::SBThread::StepUsingScriptedThreadPlan(), CommandObjectProcessLaunchOrAttach::StopProcessIfNecessary(), ToError(), lldb_private::ClangUserExpression::TryParse(), lldb_private::ValueObjectChild::UpdateValue(), lldb::SBValue::Watch(), and lldb_private::FunctionCaller::WriteFunctionWrapper().

◆ Clear()

void Status::Clear ( )

Clear the object state.

Reverts the state of this object to contain a generic success value and frees any cached error string value.

Definition at line 167 of file Status.cpp.

References lldb::eErrorTypeInvalid, m_code, m_string, and m_type.

Referenced by CoreSimulatorSupport::Device::Boot(), EntityResultVariable::Dematerialize(), lldb_private::IRExecutionUnit::DisassembleFunction(), lldb_private::OptionArgParser::DoToAddress(), lldb_private::plugin::dwarf::DWARFUnit::ExtractUnitDIEIfNeeded(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::UserExpression::GetObjectPointerValueObject(), lldb_private::Value::GetValueByteSize(), IRInterpreter::Interpret(), operator=(), lldb_private::ConnectionGenericFile::Read(), lldb_private::Target::ReadCStringFromMemory(), lldb_private::NativeProcessProtocol::ReadCStringFromMemory(), lldb_private::Process::ReadCStringFromMemory(), ReadRegisterValueAsScalar(), lldb_private::process_freebsd::NativeThreadFreeBSD::Resume(), lldb_private::NativeFile::SeekFromCurrent(), lldb_private::NativeFile::SeekFromEnd(), lldb_private::NativeFile::SeekFromStart(), lldb_private::StringSummaryFormat::SetSummaryString(), CoreSimulatorSupport::Device::Shutdown(), lldb_private::ThreadedCommunication::StartReadThread(), lldb_private::StackFrame::UpdatePreviousFrameFromCurrentFrame(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectRegisterSet::UpdateValue(), lldb_private::ValueObjectRegister::UpdateValue(), lldb_private::ValueObjectSynthetic::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), lldb_private::ValueObject::UpdateValueIfNeeded(), lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath(), lldb_private::ConnectionGenericFile::Write(), and lldb_private::IRMemoryMap::~IRMemoryMap().

◆ createWithFormat()

template<typename... Args>
static Status lldb_private::Status::createWithFormat ( const char *  format,
Args &&...  args 
)
inlinestatic

◆ Fail()

bool Status::Fail ( ) const

Test for error condition.

Returns
true if this object contains an error, false otherwise.

Definition at line 181 of file Status.cpp.

References m_code.

Referenced by lldb_private::process_linux::NativeProcessLinux::AddThread(), lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(), lldb_private::process_freebsd::NativeProcessFreeBSD::Attach(), lldb_private::process_netbsd::NativeProcessNetBSD::Attach(), lldb_private::Process::CalculateCoreFileSaveRanges(), lldb_private::plugin::dwarf::SymbolFileDWARF::CalculateFrameVariableError(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), CommandObjectScriptingObjectParsed::CommandObjectScriptingObjectParsed(), CommandObjectScriptingObjectParsed::Create(), lldb_private::Breakpoint::CreateFromStructuredData(), lldb_private::BreakpointOptions::CreateFromStructuredData(), lldb_private::process_linux::NativeProcessLinux::Detach(), lldb_private::process_linux::NativeRegisterContextLinux::DetermineArchitectureViaGPR(), lldb_private::Target::DisableAllWatchpoints(), CommandObjectThreadJump::DoExecute(), CommandObjectBreakpointSet::DoExecute(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectCommandsContainerAdd::DoExecute(), CommandObjectMemoryTagWrite::DoExecute(), CommandObjectPlatformProcessAttach::DoExecute(), CommandObjectTargetCreate::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::ProcessWindows::DoResume(), lldb_private::ValueObject::DumpPrintableRepresentation(), lldb_private::Target::EnableAllWatchpoints(), lldb_private::PlatformWindows::EvaluateLoaderExpression(), lldb_private::CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo(), lldb_private::IRMemoryMap::FindSpace(), lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::GetChildAtIndex(), lldb_private::StringSummaryFormat::GetDescription(), lldb_private::SymbolFile::GetFrameVariableError(), lldb_private::PlatformDarwinDevice::GetSharedModuleWithLocalCache(), lldb_private::StackFrame::GetValueForVariableExpressionPath(), lldb_private::Variable::GetValuesForVariableExpressionPath(), lldb::SBFrame::GetVariables(), GetVTableAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_vRun(), lldb_private::Process::Launch(), lldb_private::process_freebsd::NativeProcessFreeBSD::Manager::Launch(), lldb_private::process_linux::NativeProcessLinux::Manager::Launch(), lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Launch(), lldb_private::PlatformAppleSimulator::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(), DynamicLoaderPOSIXDYLD::LoadInterpreterModule(), DynamicLoaderPOSIXDYLD::LoadVDSO(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), lldb_private::ClangExpressionDeclMap::LookUpLldbObjCClass(), PlatformPOSIX::MakeLoadImageUtilityFunction(), EntityVariableBase::Materialize(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorClone(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorClone(), lldb_private::process_linux::NativeProcessLinux::MonitorSIGTRAP(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorSIGTRAP(), lldb_private::formatters::ObjCBOOLSummaryProvider(), ProcessElfCore::parseLinuxNotes(), lldb_private::process_linux::NativeProcessLinux::PopulateMemoryRegionCache(), lldb_private::ValueObjectPrinter::PrintValueObject(), lldb::SBThreadPlan::QueueThreadPlanForRunToAddress(), lldb::SBThreadPlan::QueueThreadPlanForStepInRange(), lldb::SBThreadPlan::QueueThreadPlanForStepOut(), lldb::SBThreadPlan::QueueThreadPlanForStepOverRange(), lldb::SBThreadPlan::QueueThreadPlanForStepScripted(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), RecurseCopy_Callback(), lldb_private::Target::RemoveAllWatchpoints(), lldb_private::NativeProcessProtocol::RemoveWatchpoint(), lldb_private::NativeProcessWindows::Resume(), lldb_private::InstrumentationRuntimeMainThreadChecker::RetrieveReportData(), lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), BreakpointNameOptionGroup::SetOptionValue(), CommandObjectMemoryFind::OptionGroupFindMemory::SetOptionValue(), lldb_private::DynamicRegisterInfo::SetRegisterInfo(), ABIMacOSX_arm64::SetReturnValueObject(), ABISysV_arm64::SetReturnValueObject(), ABISysV_arc::SetReturnValueObject(), ABIMacOSX_arm::SetReturnValueObject(), ABISysV_arm::SetReturnValueObject(), ABISysV_mips::SetReturnValueObject(), ABISysV_mips64::SetReturnValueObject(), ABISysV_ppc::SetReturnValueObject(), ABISysV_ppc64::SetReturnValueObject(), ABISysV_riscv::SetReturnValueObject(), ABISysV_s390x::SetReturnValueObject(), ABIMacOSX_i386::SetReturnValueObject(), ABISysV_i386::SetReturnValueObject(), ABISysV_x86_64::SetReturnValueObject(), ABIWindows_x86_64::SetReturnValueObject(), lldb_private::process_freebsd::NativeProcessFreeBSD::SetupTrace(), lldb_private::process_netbsd::NativeProcessNetBSD::SetupTrace(), lldb_private::NativeProcessProtocol::SetWatchpoint(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), lldb::SBThread::StepUsingScriptedThreadPlan(), lldb_private::PlatformWindows::UnloadImage(), lldb_private::formatters::VectorIteratorSyntheticFrontEnd::Update(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectSynthetic::UpdateValue(), and ValueObjectVTableChild::UpdateValue().

◆ GetError()

Status::ValueType Status::GetError ( ) const

◆ GetType()

ErrorType Status::GetType ( ) const

Access the error type.

Returns
The error type enumeration value.

Definition at line 177 of file Status.cpp.

References m_type.

◆ operator=()

const Status & Status::operator= ( llvm::Error  error)

Definition at line 62 of file Status.cpp.

References Clear(), error(), SetErrorString(), and SetErrorToGenericError().

◆ SetError()

void Status::SetError ( ValueType  err,
lldb::ErrorType  type 
)

Set accessor with an error value and type.

Set accessor for the error value to err and the error type to type.

Parameters
[in]errA mach error code.
[in]typeThe type for err.

Definition at line 208 of file Status.cpp.

References m_code, m_string, and m_type.

Referenced by lldb_private::ConnectionGenericFile::Connect(), and lldb_private::ProcessDebugger::DeallocateMemory().

◆ SetErrorString()

void Status::SetErrorString ( llvm::StringRef  err_str)

Set the current error string to err_str.

Set accessor for the error string value for a generic errors, or to supply additional details above and beyond the standard error strings that the standard type callbacks typically provide. This allows custom strings to be supplied as an error explanation. The error string value will remain until the error value is cleared or a new error value/type is assigned.

Parameters
err_strThe new custom error string to copy and cache.

Definition at line 233 of file Status.cpp.

References m_string, SetErrorToGenericError(), and Success().

Referenced by lldb_private::ClangUserExpression::AddArguments(), lldb_private::CommandInterpreter::AddUserCommand(), lldb_private::PlatformQemuUser::Attach(), CoreSimulatorSupport::Device::Boot(), lldb_private::ConnectionFileDescriptor::BytesAvailable(), CommandObjectScriptingObjectParsed::CommandObjectScriptingObjectParsed(), lldb_private::ConnectionFileDescriptor::Connect(), lldb_private::PlatformAppleSimulator::ConnectRemote(), lldb_private::ProcessDebugger::DeallocateMemory(), EntityResultVariable::Dematerialize(), lldb_private::IRExecutionUnit::DisassembleFunction(), lldb_private::PlatformAppleSimulator::DisconnectRemote(), lldb_private::DWARFExpressionList::Evaluate(), lldb_private::DWARFExpression::Evaluate(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashErase(), lldb_private::StackFrame::GetFrameBaseExpression(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::Target::GetOrCreateModule(), lldb_private::Target::GetREPL(), lldb::SBValue::GetSP(), lldb_private::Value::GetValueByteSize(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::HandshakeWithServer(), lldb_private::PlatformAppleSimulator::LaunchProcess(), lldb_private::ProcessDebugger::LaunchProcess(), lldb_private::PlatformWindows::MakeLoadImageUtilityFunction(), EntityResultVariable::Materialize(), operator=(), CommandObjectTargetModulesLookup::CommandOptions::OptionParsingFinished(), lldb_private::ClangExpressionParser::PrepareForExecution(), lldb_private::Thread::QueueThreadPlan(), lldb_private::ThreadedCommunication::Read(), lldb_private::ConnectionFileDescriptor::Read(), lldb_private::Target::ReadCStringFromMemory(), lldb_private::Process::ReadCStringFromMemory(), lldb_private::Communication::ReadFromConnection(), ReadRegisterValueAsScalar(), RecurseCopy_Callback(), ResolveLoadAddress(), lldb_private::Thread::ReturnFromFrame(), lldb_private::Debugger::RunREPL(), lldb_private::ClangExpressionParser::RunStaticInitializers(), lldb_private::ClangUserExpression::ScanContext(), lldb_private::NativeFile::SeekFromCurrent(), lldb_private::NativeFile::SeekFromEnd(), lldb_private::NativeFile::SeekFromStart(), lldb::SBDebugger::SetCurrentPlatform(), SetErrorStringWithFormatv(), lldb_private::Debugger::SetInputString(), ABISysV_arc::SetReturnValueObject(), ABISysV_riscv::SetReturnValueObject(), CoreSimulatorSupport::Device::Shutdown(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), lldb_private::ValueObject::UpdateValueIfNeeded(), lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath(), lldb_private::Communication::Write(), lldb_private::ConnectionFileDescriptor::Write(), and lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::WriteMemoryTags().

◆ SetErrorStringWithFormat()

int Status::SetErrorStringWithFormat ( const char *  format,
  ... 
)

Set the current error string to a formatted error string.

Parameters
formatA printf style format string

Definition at line 247 of file Status.cpp.

References m_string, and SetErrorStringWithVarArg().

Referenced by lldb_private::ConnectionGenericFile::Connect(), lldb_private::ConnectionFileDescriptor::Connect(), lldb_private::ConnectionFileDescriptor::ConnectFD(), EntityPersistentVariable::Dematerialize(), EntityVariableBase::Dematerialize(), EntityResultVariable::Dematerialize(), EntityRegister::Dematerialize(), EntityPersistentVariable::DestroyAllocation(), lldb_private::IRExecutionUnit::DisassembleFunction(), lldb_private::OptionArgParser::DoToAddress(), lldb_private::DWARFExpression::Evaluate(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashDone(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashErase(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::Target::GetREPL(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::HandshakeWithServer(), lldb_private::Target::Launch(), lldb_private::ProcessDebugger::LaunchProcess(), EntityPersistentVariable::MakeAllocation(), lldb_private::PlatformWindows::MakeLoadImageUtilityFunction(), EntityPersistentVariable::Materialize(), EntityVariableBase::Materialize(), EntityResultVariable::Materialize(), EntitySymbol::Materialize(), EntityRegister::Materialize(), lldb_private::ClangExpressionParser::PrepareForExecution(), ReadRegisterValueAsScalar(), RecurseCopy_Callback(), ResolveLoadAddress(), lldb_private::Thread::ReturnFromFrameWithIndex(), lldb_private::Debugger::RunREPL(), lldb_private::ClangExpressionParser::RunStaticInitializers(), lldb_private::Debugger::SetInputString(), ABISysV_arc::SetReturnValueObject(), ABISysV_riscv::SetReturnValueObject(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), and lldb_private::CommandInterpreter::VerifyUserMultiwordCmdPath().

◆ SetErrorStringWithFormatv()

template<typename... Args>
void lldb_private::Status::SetErrorStringWithFormatv ( const char *  format,
Args &&...  args 
)
inline

◆ SetErrorStringWithVarArg()

int Status::SetErrorStringWithVarArg ( const char *  format,
va_list  args 
)

◆ SetErrorToErrno()

void Status::SetErrorToErrno ( )

◆ SetErrorToGenericError()

void Status::SetErrorToGenericError ( )

◆ SetExpressionError()

void Status::SetExpressionError ( lldb::ExpressionResults  result,
const char *  mssg 
)

Definition at line 183 of file Status.cpp.

References lldb::eErrorTypeExpression, m_code, m_string, and m_type.

◆ SetExpressionErrorWithFormat()

int Status::SetExpressionErrorWithFormat ( lldb::ExpressionResults  result,
const char *  format,
  ... 
)

◆ Success()

bool Status::Success ( ) const

Test for success condition.

Returns true if the error code in this object is considered a successful return value.

Returns
true if this object contains an value that describes success (non-erro), false otherwise.

Definition at line 279 of file Status.cpp.

References m_code.

Referenced by lldb_private::ClangUserExpression::AddArguments(), lldb::SBCommandInterpreter::AddCommand(), lldb::SBCommandInterpreter::AddMultiwordCommand(), lldb_private::ClangExpressionDeclMap::AddValueToStruct(), RemoteNXMapTable::const_iterator::AdvanceToValidIndex(), lldb_private::NativeProcessWindows::AllocateMemory(), lldb_private::process_linux::NativeThreadLinux::AnnotateSyncTagCheckFault(), AsCString(), InterpreterStackFrame::AssignValue(), lldb_private::process_freebsd::NativeProcessFreeBSD::Manager::Attach(), lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Attach(), lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), lldb_private::Process::CanJIT(), lldb_private::NativeRegisterContextDBReg_x86::ClearHardwareWatchpoint(), lldb_private::ValueObject::CreateConstantValue(), lldb_private::PipeWindows::CreateNew(), EntityPersistentVariable::Dematerialize(), EntityVariableBase::Dematerialize(), EntityResultVariable::Dematerialize(), EntityRegister::Dematerialize(), EntityPersistentVariable::DestroyAllocation(), lldb_private::Target::DisableWatchpointByID(), lldb_private::IRExecutionUnit::DisassembleFunction(), lldb_private::LLVMUserExpression::DoExecute(), PlatformPOSIX::DoLoadImage(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoWriteMemory(), EntityPersistentVariable::DumpToLog(), EntityVariableBase::DumpToLog(), EntityResultVariable::DumpToLog(), EntitySymbol::DumpToLog(), EntityRegister::DumpToLog(), lldb_private::Target::EnableWatchpointByID(), InterpreterStackFrame::EvaluateValue(), lldb_private::LLVMUserExpression::FinalizeJITExecution(), lldb_private::IRMemoryMap::FindSpace(), lldb_private::process_gdb_remote::ProcessGDBRemote::FlashErase(), lldb_private::formatters::BlockPointerSyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEnd::GetChildAtIndex(), GetCoreFileSaveRangesStackOnly(), lldb_private::ClangUserExpression::GetCppObjectPointer(), lldb_private::ThreadPlanStepInRange::GetDescription(), lldb_private::ThreadPlanStepInstruction::GetDescription(), lldb_private::ThreadPlanStepOverRange::GetDescription(), lldb_private::ValueObject::GetDynamicValue(), lldb_private::ValueObjectConstResult::GetDynamicValue(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::DynamicLoaderWindowsDYLD::GetLoadAddress(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::GetMemoryRegionInfo(), lldb_private::UserExpression::GetObjectPointer(), lldb_private::Target::GetREPL(), lldb_private::IRExecutionUnit::GetRunnableInfo(), lldb_private::RegisterValue::GetScalarValue(), lldb_private::Value::GetValueByteSize(), GetXcodeSelectPath(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_A(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_qLaunchSuccess(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QMemTags(), lldb_private::ClangUtilityFunction::Install(), IRInterpreter::Interpret(), IOHandlerProcessSTDIO::Interrupt(), lldb_private::ConnectionFileDescriptor::InterruptRead(), lldb_private::REPL::IOHandlerInputComplete(), IsInputPending(), lldb_private::ThreadPlanAssemblyTracer::Log(), EntityPersistentVariable::MakeAllocation(), InterpreterStackFrame::MakeArgument(), lldb_private::process_linux::NativeProcessLinux::Manager::Manager(), EntityPersistentVariable::Materialize(), EntityVariableBase::Materialize(), EntityResultVariable::Materialize(), EntitySymbol::Materialize(), EntityRegister::Materialize(), lldb_private::process_freebsd::NativeProcessFreeBSD::NativeProcessFreeBSD(), lldb_private::process_linux::NativeProcessLinux::NativeProcessLinux(), lldb_private::process_netbsd::NativeProcessNetBSD::NativeProcessNetBSD(), lldb_private::ConnectionFileDescriptor::OpenCommandPipe(), lldb_private::ClangUserExpression::Parse(), lldb_private::ClangExpressionParser::ParseInternal(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::ClangUserExpression::PrepareForParsing(), lldb_private::LLVMUserExpression::PrepareToExecuteJITExpression(), InterpreterStackFrame::PrintData(), lldb_private::NativeProcessProtocol::ReadCStringFromMemory(), lldb_private::Process::ReadMemory(), RegisterContextMemory::ReadRegister(), InterpreterStackFrame::ResolveConstant(), lldb_private::process_freebsd::NativeThreadFreeBSD::Resume(), lldb_private::process_netbsd::NativeThreadNetBSD::Resume(), lldb_private::process_freebsd::NativeProcessFreeBSD::Resume(), lldb_private::process_netbsd::NativeProcessNetBSD::Resume(), lldb_private::Thread::ReturnFromFrame(), lldb_private::Debugger::RunREPL(), lldb_private::Process::RunThreadPlan(), lldb::SBThread::RunToAddress(), lldb_private::ValueObject::SetData(), lldb::SBValue::SetData(), SetErrorString(), SetErrorStringWithVarArg(), lldb_private::NativeProcessProtocol::SetHardwareBreakpoint(), CommandObjectBreakpointSet::CommandOptions::SetOptionValue(), CommandObjectSourceList::CommandOptions::SetOptionValue(), lldb_private::OptionValueProperties::SetPropertyAtIndexFromArgs(), lldb_private::NativeProcessProtocol::SetWatchpoint(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), lldb_private::process_freebsd::NativeThreadFreeBSD::SingleStep(), lldb_private::process_netbsd::NativeThreadNetBSD::SingleStep(), lldb::SBThread::StepInstruction(), lldb::SBThread::StepInto(), lldb::SBThread::StepOut(), lldb::SBThread::StepOutOfFrame(), lldb::SBThread::StepOverUntil(), lldb::SBThread::StepUsingScriptedThreadPlan(), CommandObjectProcessLaunchOrAttach::StopProcessIfNecessary(), lldb_private::process_freebsd::NativeThreadFreeBSD::Suspend(), lldb_private::process_netbsd::NativeThreadNetBSD::Suspend(), ToError(), lldb_private::ClangUserExpression::TryParse(), lldb_private::ModuleListProperties::UpdateSymlinkMappings(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectRegisterSet::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), lldb_private::ValueObject::UpdateValueIfNeeded(), lldb_private::IRExecutionUnit::WriteData(), lldb_private::FunctionCaller::WriteFunctionWrapper(), and lldb_private::IRExecutionUnit::WriteNow().

◆ ToError()

llvm::Error Status::ToError ( ) const

Definition at line 89 of file Status.cpp.

References AsCString(), m_code, m_type, and Success().

Referenced by lldb_private::NativeProcessWindows::AllocateMemory(), lldb_private::process_linux::NativeProcessLinux::Attach(), lldb_private::process_freebsd::NativeProcessFreeBSD::Manager::Attach(), lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Attach(), ComputeSignalInfo(), lldb_private::process_gdb_remote::GDBRemoteCommunication::ConnectLocally(), lldb_private::NativeProcessWindows::DeallocateMemory(), lldb_private::process_linux::NativeRegisterContextLinux::DetermineArchitectureViaGPR(), lldb_private::process_freebsd::NativeProcessFreeBSD::Manager::Launch(), lldb_private::process_linux::NativeProcessLinux::Manager::Launch(), lldb_private::process_netbsd::NativeProcessNetBSD::Manager::Launch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::LaunchProcess(), lldb_private::process_freebsd::NativeProcessFreeBSD::MonitorClone(), lldb_private::process_netbsd::NativeProcessNetBSD::MonitorClone(), lldb_private::NativeProcessWindows::NativeProcessWindows(), ProcessElfCore::parseLinuxNotes(), lldb_private::NativeProcessProtocol::ReadCStringFromMemory(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceGetBinaryData(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceGetState(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceStart(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceStop(), lldb_private::process_gdb_remote::GDBRemoteCommunicationClient::SendTraceSupported(), and lldb_private::process_linux::NativeProcessLinux::Syscall().

Member Data Documentation

◆ m_code

ValueType lldb_private::Status::m_code = 0
protected

Member variables.

Status code as an integer value.

Definition at line 185 of file Status.h.

Referenced by AsCString(), Clear(), Fail(), GetError(), SetError(), SetErrorToErrno(), SetErrorToGenericError(), SetExpressionError(), SetExpressionErrorWithFormat(), Success(), and ToError().

◆ m_string

std::string lldb_private::Status::m_string
mutableprotected

◆ m_type

lldb::ErrorType lldb_private::Status::m_type
protected
Initial value:

The type of the above error code.

Definition at line 186 of file Status.h.

Referenced by AsCString(), Clear(), GetType(), SetError(), SetErrorToErrno(), SetErrorToGenericError(), SetExpressionError(), SetExpressionErrorWithFormat(), and ToError().


The documentation for this class was generated from the following files: