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

A class to manage flags. More...

#include "lldb/Utility/Flags.h"

Inheritance diagram for lldb_private::Flags:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Flags:
Collaboration graph
[legend]

Public Types

typedef uint32_t ValueType
 The value type for flags is a 32 bit unsigned integer type. More...
 

Public Member Functions

 Flags (ValueType flags=0)
 Construct with initial flag bit values. More...
 
 Flags (const Flags &rhs)
 Copy constructor. More...
 
 ~Flags ()
 Destructor. More...
 
ValueType Get () const
 Get accessor for all flags. More...
 
size_t GetBitSize () const
 Return the number of flags that can be represented in this object. More...
 
void Reset (ValueType flags)
 Set accessor for all flags. More...
 
ValueType Clear (ValueType mask=~(ValueType) 0)
 Clear one or more flags. More...
 
ValueType Set (ValueType mask)
 Set one or more flags by logical OR'ing mask with the current flags. More...
 
bool AllSet (ValueType mask) const
 Test if all bits in mask are 1 in the current flags. More...
 
bool AnySet (ValueType mask) const
 Test one or more flags. More...
 
bool Test (ValueType bit) const
 Test a single flag bit. More...
 
bool AllClear (ValueType mask) const
 Test if all bits in mask are clear. More...
 
bool AnyClear (ValueType mask) const
 
bool IsClear (ValueType bit) const
 Test a single flag bit to see if it is clear (zero). More...
 
size_t ClearCount () const
 Get the number of zero bits in m_flags. More...
 
size_t SetCount () const
 Get the number of one bits in m_flags. More...
 

Protected Attributes

ValueType m_flags
 The flags. More...
 

Detailed Description

A class to manage flags.

The Flags class managed flag bits and allows testing and modification of individual or multiple flag bits.

Definition at line 22 of file Flags.h.

Member Typedef Documentation

◆ ValueType

The value type for flags is a 32 bit unsigned integer type.

Definition at line 25 of file Flags.h.

Constructor & Destructor Documentation

◆ Flags() [1/2]

lldb_private::Flags::Flags ( ValueType  flags = 0)
inline

Construct with initial flag bit values.

Constructs this object with mask as the initial value for all of the flags.

Parameters
[in]maskThe initial value for all flags.

Definition at line 34 of file Flags.h.

◆ Flags() [2/2]

lldb_private::Flags::Flags ( const Flags rhs)
inline

Copy constructor.

Construct and copy the flags from rhs.

Parameters
[in]rhsA const Flags object reference to copy.

Definition at line 42 of file Flags.h.

◆ ~Flags()

lldb_private::Flags::~Flags ( )
inline

Destructor.

Definition at line 45 of file Flags.h.

Member Function Documentation

◆ AllClear()

bool lldb_private::Flags::AllClear ( ValueType  mask) const
inline

Test if all bits in mask are clear.

Returns
true if all flags in mask are clear, false otherwise.

Definition at line 114 of file Flags.h.

References m_flags.

Referenced by lldb_private::ValueObject::GetValueForExpressionPath(), and IsPointerValue().

◆ AllSet()

bool lldb_private::Flags::AllSet ( ValueType  mask) const
inline

Test if all bits in mask are 1 in the current flags.

Returns
true if all flags in mask are 1, false otherwise.

Definition at line 94 of file Flags.h.

References m_flags.

Referenced by lldb_private::Log::Channel::GetLogIfAll().

◆ AnyClear()

bool lldb_private::Flags::AnyClear ( ValueType  mask) const
inline

Definition at line 116 of file Flags.h.

References m_flags.

◆ AnySet()

bool lldb_private::Flags::AnySet ( ValueType  mask) const
inline

◆ Clear()

ValueType lldb_private::Flags::Clear ( ValueType  mask = ~(ValueType)0)
inline

◆ ClearCount()

size_t lldb_private::Flags::ClearCount ( ) const
inline

Get the number of zero bits in m_flags.

Returns
The number of bits that are set to 0 in the current flags.

Definition at line 128 of file Flags.h.

References m_flags.

◆ Get()

ValueType lldb_private::Flags::Get ( ) const
inline

Get accessor for all flags.

Returns
Returns all of the flags as a Flags::ValueType.

Definition at line 51 of file Flags.h.

References m_flags.

Referenced by lldb_private::CommandObject::CheckRequirements(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoLaunch(), and lldb_private::StackFrame::GetSymbolContext().

◆ GetBitSize()

size_t lldb_private::Flags::GetBitSize ( ) const
inline

Return the number of flags that can be represented in this object.

Returns
The maximum number bits in this flag object.

Definition at line 57 of file Flags.h.

◆ IsClear()

bool lldb_private::Flags::IsClear ( ValueType  bit) const
inline

◆ Reset()

void lldb_private::Flags::Reset ( ValueType  flags)
inline

Set accessor for all flags.

Parameters
[in]flagsThe bits with which to replace all of the current flags.

Definition at line 63 of file Flags.h.

References m_flags.

Referenced by lldb_private::StackFrame::ChangePC(), lldb_private::ValueObject::GetValueForExpressionPath(), and lldb_private::Property::Property().

◆ Set()

ValueType lldb_private::Flags::Set ( ValueType  mask)
inline

Set one or more flags by logical OR'ing mask with the current flags.

Parameters
[in]maskA bitfield containing one or more flags.
Returns
The new flags after setting all bits from mask.

Definition at line 84 of file Flags.h.

References m_flags.

Referenced by lldb_private::BreakpointName::Permissions::AnySet(), lldb_private::BreakpointOptions::BreakpointOptions(), lldb_private::CompileUnit::CompileUnit(), lldb_private::BreakpointOptions::CopyOverSetOptions(), lldb_private::BreakpointOptions::CreateFromStructuredData(), PlatformAppleSimulator::DebugProcess(), lldb_private::platform_netbsd::PlatformNetBSD::DebugProcess(), lldb_private::PlatformWindows::DebugProcess(), lldb_private::platform_linux::PlatformLinux::DebugProcess(), lldb_private::Platform::DebugProcess(), lldb_private::CompileUnit::GetDebugMacros(), lldb_private::ThreadPlanStepOverRange::GetDescription(), lldb_private::StackFrame::GetFrameBaseValue(), lldb_private::StackFrame::GetFrameCodeAddress(), lldb_private::CompileUnit::GetImportedModules(), lldb_private::CompileUnit::GetLanguage(), lldb_private::CompileUnit::GetLineTable(), lldb_private::Function::GetPrologueByteSize(), lldb_private::StackFrame::GetStackID(), lldb_private::CompileUnit::GetSupportFiles(), lldb_private::StackFrame::GetSymbolContext(), lldb_private::BreakpointOptions::GetThreadSpec(), lldb_private::StackFrame::GetVariableList(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerCommon::Handle_QSetDetachOnError(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::Handle_QSetDisableASLR(), lldb_private::Target::Launch(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess(), lldb_private::Platform::LaunchProcess(), lldb_private::BreakpointName::Permissions::Permissions(), lldb_private::Stream::PutBytesAsRawHex8(), lldb_private::StreamGDBRemote::PutEscapedBytes(), lldb_private::Stream::PutRawBytes(), lldb_private::Stream::PutStringAsRawHex8(), lldb_private::BreakpointOptions::SetCallback(), lldb_private::BreakpointOptions::SetCommandDataCallback(), lldb_private::BreakpointOptions::SetCondition(), lldb_private::CompileUnit::SetDebugMacros(), lldb_private::ProcessLaunchInfo::SetDetachOnError(), lldb_private::ThreadPlanStepOverRange::SetFlagsToDefault(), lldb_private::ThreadPlanStepOut::SetFlagsToDefault(), lldb_private::ThreadPlanStepInRange::SetFlagsToDefault(), lldb_private::CompileUnit::SetLanguage(), lldb_private::ProcessLaunchInfo::SetLaunchInSeparateProcessGroup(), lldb_private::CompileUnit::SetLineTable(), lldb_private::TargetProperties::SetRequireHardwareBreakpoints(), lldb_private::ProcessLaunchInfo::SetShell(), lldb_private::ProcessLaunchInfo::SetShellExpandArguments(), lldb_private::StackFrame::SetSymbolContextScope(), lldb_private::BreakpointOptions::SetThreadID(), lldb_private::BreakpointOptions::SetThreadSpec(), lldb_private::CompilerType::SetValueFromScalar(), lldb_private::ThreadPlanStepInRange::ThreadPlanStepInRange(), and lldb_private::ThreadPlanStepOut::ThreadPlanStepOut().

◆ SetCount()

size_t lldb_private::Flags::SetCount ( ) const
inline

Get the number of one bits in m_flags.

Returns
The number of bits that are set to 1 in the current flags.

Definition at line 141 of file Flags.h.

References m_flags.

◆ Test()

bool lldb_private::Flags::Test ( ValueType  bit) const
inline

Test a single flag bit.

Returns
true if bit is set, false otherwise.

Definition at line 107 of file Flags.h.

References m_flags.

Referenced by lldb_private::Stream::_PutHex8(), lldb_private::Target::Attach(), ChildFunc(), lldb_private::BreakpointOptions::CopyOverSetOptions(), lldb_private::ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(), DisableASLRIfRequested(), lldb_private::ProcessWindows::DoLaunch(), DWARFDebugInfoEntry::DumpAttribute(), lldb_private::ValueObject::DumpPrintableRepresentation(), lldb_private::ProcessLaunchInfo::GetDetachOnError(), lldb_private::ProcessLaunchInfo::GetLaunchInSeparateProcessGroup(), ProcessMachCore::GetMemoryRegionInfo(), ProcessElfCore::GetMemoryRegionInfo(), GetPosixspawnFlags(), lldb_private::platform_linux::PlatformLinux::GetResumeCountForLaunchInfo(), lldb_private::platform_netbsd::PlatformNetBSD::GetResumeCountForLaunchInfo(), lldb_private::ProcessLaunchInfo::GetShellExpandArguments(), lldb_private::ValueObject::GetValueForExpressionPath(), lldb_private::Log::GetVerbose(), lldb_private::ValueObject::HasSpecialPrintableRepresentation(), lldb_private::CommandInterpreter::IOHandlerInputComplete(), lldb_private::ValueObject::IsCStringContainer(), lldb_private::ClangASTContext::IsCStringType(), lldb_private::BreakpointName::Permissions::IsSet(), lldb_private::Target::Launch(), lldb_private::Process::Launch(), LaunchInNewTerminalWithAppleScript(), lldb_private::ProcessLauncherWindows::LaunchProcess(), lldb_private::MonitoringProcessLauncher::LaunchProcess(), lldb_private::platform_gdb_server::PlatformRemoteGDBServer::LaunchProcess(), lldb_private::Platform::LaunchProcess(), lldb_private::darwin_process_launcher::PosixSpawnChildForPTraceDebugging(), lldb_private::Stream::PrintfVarArg(), lldb_private::Stream::PutBytesAsRawHex8(), lldb_private::Stream::PutCString(), lldb_private::StreamGDBRemote::PutEscapedBytes(), lldb_private::Stream::PutRawBytes(), lldb_private::Stream::PutSLEB128(), lldb_private::Stream::PutStringAsRawHex8(), lldb_private::Stream::PutULEB128(), lldb_private::ValueObject::ReadPointedString(), ObjectFileELF::ReadSectionData(), lldb_private::BreakpointOptions::SerializeToStructuredData(), lldb_private::TargetProperties::SetProcessLaunchInfo(), ShouldLaunchUsingXPC(), CoreSimulatorSupport::Device::Spawn(), and lldb_private::CommandInterpreter::WasInterrupted().

Member Data Documentation

◆ m_flags

ValueType lldb_private::Flags::m_flags
protected

The flags.

Definition at line 151 of file Flags.h.

Referenced by AllClear(), AllSet(), AnyClear(), AnySet(), Clear(), ClearCount(), Get(), IsClear(), Reset(), Set(), SetCount(), and Test().


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