LLDB mainline
lldb::SBSaveCoreOptions Class Reference

#include <SBSaveCoreOptions.h>

Public Member Functions

 SBSaveCoreOptions ()
 SBSaveCoreOptions (const lldb::SBSaveCoreOptions &rhs)
 ~SBSaveCoreOptions ()
const SBSaveCoreOptionsoperator= (const lldb::SBSaveCoreOptions &rhs)
SBError SetPluginName (const char *plugin)
 Set the plugin name.
const char * GetPluginName () const
 Get the Core dump plugin name, if set.
void SetStyle (lldb::SaveCoreStyle style)
 Set the Core dump style.
lldb::SaveCoreStyle GetStyle () const
 Get the Core dump style, if set.
void SetOutputFile (SBFileSpec output_file)
 Set the output file path.
SBFileSpec GetOutputFile () const
 Get the output file spec.
SBError SetProcess (lldb::SBProcess process)
 Set the process to save, or unset if supplied with a default constructed process.
SBProcess GetProcess ()
 Get the process to save, if the process is not set an invalid SBProcess will be returned.
SBError AddThread (lldb::SBThread thread)
 Add a thread to save in the core file.
bool RemoveThread (lldb::SBThread thread)
 Remove a thread from the list of threads to save.
SBError AddMemoryRegionToSave (const SBMemoryRegionInfo &region)
 Add a memory region to save in the core file.
SBThreadCollection GetThreadsToSave () const
 Get an unsorted copy of all threads to save.
SBMemoryRegionInfoList GetMemoryRegionsToSave ()
 Get an unsorted copy of all memory regions to save.
uint64_t GetCurrentSizeInBytes (SBError &error)
 Get the current total number of bytes the core is expected to have excluding the overhead of the core file format.
void Clear ()
 Reset all options.

Protected Member Functions

lldb_private::SaveCoreOptionsref () const

Private Attributes

std::unique_ptr< lldb_private::SaveCoreOptionsm_opaque_up

Friends

class SBProcess
class SBThreadCollection

Detailed Description

Definition at line 22 of file SBSaveCoreOptions.h.

Constructor & Destructor Documentation

◆ SBSaveCoreOptions() [1/2]

SBSaveCoreOptions::SBSaveCoreOptions ( )

Definition at line 20 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by operator=(), SBSaveCoreOptions(), and ~SBSaveCoreOptions().

◆ SBSaveCoreOptions() [2/2]

SBSaveCoreOptions::SBSaveCoreOptions ( const lldb::SBSaveCoreOptions & rhs)

Definition at line 26 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBSaveCoreOptions().

◆ ~SBSaveCoreOptions()

Member Function Documentation

◆ AddMemoryRegionToSave()

lldb::SBError SBSaveCoreOptions::AddMemoryRegionToSave ( const SBMemoryRegionInfo & region)

Add a memory region to save in the core file.

Parameters
regionThe memory region to save.
Returns
An empty SBError upon success, or an error if the region is invalid.
Note
Ranges that overlapped will be unioned into a single region, this also supercedes stack minification. Specifying full regions and a non-custom core style will include the specified regions and union them with all style specific regions.

Definition at line 100 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, lldb::SBMemoryRegionInfo::ref(), and lldb::SBError.

Referenced by ~SBSaveCoreOptions().

◆ AddThread()

SBError SBSaveCoreOptions::AddThread ( lldb::SBThread thread)

Add a thread to save in the core file.

Parameters
threadThe thread to save.
Note
This will set the process if it is not already set, or return and error if the SBThread is not from the set process.

Definition at line 89 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBSaveCoreOptions().

◆ Clear()

void SBSaveCoreOptions::Clear ( )

Reset all options.

Definition at line 117 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBSaveCoreOptions().

◆ GetCurrentSizeInBytes()

uint64_t SBSaveCoreOptions::GetCurrentSizeInBytes ( SBError & error)

Get the current total number of bytes the core is expected to have excluding the overhead of the core file format.

Requires a Process and Style to be specified.

Note
This can cause some modification of the underlying data store as regions with no permissions, or invalid permissions will be removed and stacks will be minified up to their stack pointer + the redzone.
Returns
The expected size of the data contained in the core in bytes.

Definition at line 122 of file SBSaveCoreOptions.cpp.

References error(), lldb_private::Status::FromError(), LLDB_INSTRUMENT_VA, m_opaque_up, and lldb::SBError.

Referenced by ~SBSaveCoreOptions().

◆ GetMemoryRegionsToSave()

lldb::SBMemoryRegionInfoList SBSaveCoreOptions::GetMemoryRegionsToSave ( )

Get an unsorted copy of all memory regions to save.

Returns
An unsorted copy of all memory regions to save. If no process or style is specified an empty collection will be returned.

Definition at line 136 of file SBSaveCoreOptions.cpp.

References lldb::SBMemoryRegionInfoList::Append(), LLDB_INSTRUMENT_VA, m_opaque_up, and lldb::SBMemoryRegionInfoList.

Referenced by ~SBSaveCoreOptions().

◆ GetOutputFile()

SBFileSpec SBSaveCoreOptions::GetOutputFile ( ) const

Get the output file spec.

Returns
The output file spec.

Definition at line 66 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and lldb::SBFileSpec.

Referenced by ~SBSaveCoreOptions().

◆ GetPluginName()

const char * SBSaveCoreOptions::GetPluginName ( ) const

Get the Core dump plugin name, if set.

Returns
The name of the plugin, or null if not set.

Definition at line 58 of file SBSaveCoreOptions.cpp.

References lldb_private::ConstString::GetCString(), LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBSaveCoreOptions().

◆ GetProcess()

SBProcess SBSaveCoreOptions::GetProcess ( )

Get the process to save, if the process is not set an invalid SBProcess will be returned.

Returns
The set process, or an invalid SBProcess if no process is set.

Definition at line 84 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBProcess.

Referenced by lldb::SBProcess::SaveCore(), and ~SBSaveCoreOptions().

◆ GetStyle()

lldb::SaveCoreStyle SBSaveCoreOptions::GetStyle ( ) const

Get the Core dump style, if set.

Returns
The core dump style, or undefined if not set.

Definition at line 74 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBSaveCoreOptions().

◆ GetThreadsToSave()

lldb::SBThreadCollection SBSaveCoreOptions::GetThreadsToSave ( ) const

Get an unsorted copy of all threads to save.

Returns
An unsorted copy of all threads to save. If no process is specified an empty collection will be returned.

Definition at line 109 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBThreadCollection.

Referenced by ~SBSaveCoreOptions().

◆ operator=()

const SBSaveCoreOptions & SBSaveCoreOptions::operator= ( const lldb::SBSaveCoreOptions & rhs)

Definition at line 35 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and SBSaveCoreOptions().

Referenced by ~SBSaveCoreOptions().

◆ ref()

lldb_private::SaveCoreOptions & SBSaveCoreOptions::ref ( ) const
protected

Definition at line 156 of file SBSaveCoreOptions.cpp.

References m_opaque_up.

Referenced by lldb::SBProcess::SaveCore(), and SBThreadCollection.

◆ RemoveThread()

bool SBSaveCoreOptions::RemoveThread ( lldb::SBThread thread)

Remove a thread from the list of threads to save.

Parameters
threadThe thread to remove.
Returns
True if the thread was removed, false if it was not in the list.

Definition at line 94 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by ~SBSaveCoreOptions().

◆ SetOutputFile()

void SBSaveCoreOptions::SetOutputFile ( lldb::SBFileSpec file_spec)

Set the output file path.

Parameters
output_filea SBFileSpec object that describes the output file.

Definition at line 53 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and lldb::SBFileSpec::ref().

Referenced by lldb::SBProcess::SaveCore(), lldb::SBProcess::SaveCore(), and ~SBSaveCoreOptions().

◆ SetPluginName()

SBError SBSaveCoreOptions::SetPluginName ( const char * plugin)

Set the plugin name.

Supplying null or empty string will reset the option.

Parameters
pluginName of the object file plugin.

Definition at line 43 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, m_opaque_up, and lldb::SBError.

Referenced by lldb::SBProcess::SaveCore(), and ~SBSaveCoreOptions().

◆ SetProcess()

SBError SBSaveCoreOptions::SetProcess ( lldb::SBProcess process)

Set the process to save, or unset if supplied with a default constructed process.

Parameters
processThe process to save.
Returns
Success if process was set, otherwise an error
Note
This will clear all process specific options if a different process is specified than the current set process, either explicitly from this api, or implicitly from any function that requires a process.

Definition at line 79 of file SBSaveCoreOptions.cpp.

References lldb::SBProcess::GetSP(), LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by lldb::SBProcess::SaveCore(), and ~SBSaveCoreOptions().

◆ SetStyle()

void SBSaveCoreOptions::SetStyle ( lldb::SaveCoreStyle style)

Set the Core dump style.

Parameters
styleThe style of the core dump.

Definition at line 48 of file SBSaveCoreOptions.cpp.

References LLDB_INSTRUMENT_VA, and m_opaque_up.

Referenced by lldb::SBProcess::SaveCore(), lldb::SBProcess::SaveCore(), and ~SBSaveCoreOptions().

◆ SBProcess

friend class SBProcess
friend

Definition at line 154 of file SBSaveCoreOptions.h.

References SBProcess.

Referenced by GetProcess(), SBProcess, and ~SBSaveCoreOptions().

◆ SBThreadCollection

friend class SBThreadCollection
friend

Definition at line 155 of file SBSaveCoreOptions.h.

References ref(), and SBThreadCollection.

Referenced by GetThreadsToSave(), SBThreadCollection, and ~SBSaveCoreOptions().

Member Data Documentation

◆ m_opaque_up


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