Added some functions to our API related to classifying symbols as code, data,

const data, etc, and also for SBAddress objects to classify their type of
section they are in and also getting the module for a section offset address.

    lldb::SymbolType SBSymbol::GetType();
    
    lldb::SectionType SBAddress::GetSectionType ();
    lldb::SBModule SBAddress::GetModule ();

llvm-svn: 128602
This commit is contained in:
Greg Clayton 2011-03-31 01:08:07 +00:00
parent 0e43f321b6
commit 05d2b7f741
15 changed files with 520 additions and 471 deletions

View File

@ -11,6 +11,7 @@
#define LLDB_SBAddress_h_ #define LLDB_SBAddress_h_
#include "lldb/API/SBDefines.h" #include "lldb/API/SBDefines.h"
#include "lldb/API/SBModule.h"
namespace lldb { namespace lldb {
@ -47,6 +48,12 @@ public:
bool bool
GetDescription (lldb::SBStream &description); GetDescription (lldb::SBStream &description);
SectionType
GetSectionType ();
lldb::SBModule
GetModule ();
protected: protected:
friend class SBFrame; friend class SBFrame;

View File

@ -66,9 +66,10 @@ public:
GetSymbolAtIndex (size_t idx); GetSymbolAtIndex (size_t idx);
private: private:
friend class SBAddress;
friend class SBFrame;
friend class SBSymbolContext; friend class SBSymbolContext;
friend class SBTarget; friend class SBTarget;
friend class SBFrame;
explicit SBModule (const lldb::ModuleSP& module_sp); explicit SBModule (const lldb::ModuleSP& module_sp);

View File

@ -54,6 +54,9 @@ public:
uint32_t uint32_t
GetPrologueByteSize (); GetPrologueByteSize ();
SymbolType
GetType ();
#ifndef SWIG #ifndef SWIG
bool bool
operator == (const lldb::SBSymbol &rhs) const; operator == (const lldb::SBSymbol &rhs) const;

View File

@ -90,7 +90,7 @@ public:
/// pointer if it has one in the shared module list. /// pointer if it has one in the shared module list.
//------------------------------------------------------------------ //------------------------------------------------------------------
lldb::ModuleSP lldb::ModuleSP
GetSP (); GetSP () const;
//------------------------------------------------------------------ //------------------------------------------------------------------
/// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)
@ -144,16 +144,16 @@ public:
//------------------------------------------------------------------ //------------------------------------------------------------------
const Symbol * const Symbol *
FindFirstSymbolWithNameAndType (const ConstString &name, FindFirstSymbolWithNameAndType (const ConstString &name,
SymbolType symbol_type = eSymbolTypeAny); lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
size_t size_t
FindSymbolsWithNameAndType (const ConstString &name, FindSymbolsWithNameAndType (const ConstString &name,
SymbolType symbol_type, lldb::SymbolType symbol_type,
SymbolContextList &sc_list); SymbolContextList &sc_list);
size_t size_t
FindSymbolsMatchingRegExAndType (const RegularExpression &regex, FindSymbolsMatchingRegExAndType (const RegularExpression &regex,
SymbolType symbol_type, lldb::SymbolType symbol_type,
SymbolContextList &sc_list); SymbolContextList &sc_list);
//------------------------------------------------------------------ //------------------------------------------------------------------

View File

@ -288,7 +288,7 @@ public:
size_t size_t
FindSymbolsWithNameAndType (const ConstString &name, FindSymbolsWithNameAndType (const ConstString &name,
SymbolType symbol_type, lldb::SymbolType symbol_type,
SymbolContextList &sc_list); SymbolContextList &sc_list);
//------------------------------------------------------------------ //------------------------------------------------------------------

View File

@ -55,7 +55,7 @@ public:
FindSectionByID (lldb::user_id_t sect_id) const; FindSectionByID (lldb::user_id_t sect_id) const;
lldb::SectionSP lldb::SectionSP
FindSectionByType (SectionType sect_type, bool check_children, uint32_t start_idx = 0) const; FindSectionByType (lldb::SectionType sect_type, bool check_children, uint32_t start_idx = 0) const;
lldb::SectionSP lldb::SectionSP
GetSharedPointer (const Section *section, bool check_children) const; GetSharedPointer (const Section *section, bool check_children) const;
@ -105,7 +105,7 @@ public:
Module* module, Module* module,
lldb::user_id_t sect_id, lldb::user_id_t sect_id,
const ConstString &name, const ConstString &name,
SectionType sect_type, lldb::SectionType sect_type,
lldb::addr_t file_vm_addr, lldb::addr_t file_vm_addr,
lldb::addr_t vm_size, lldb::addr_t vm_size,
uint64_t file_offset, uint64_t file_offset,
@ -268,7 +268,7 @@ public:
lldb::addr_t lldb::addr_t
GetLinkedFileAddress () const; GetLinkedFileAddress () const;
SectionType lldb::SectionType
GetType () const GetType () const
{ {
return m_type; return m_type;
@ -278,7 +278,7 @@ protected:
Section * m_parent; // Parent section or NULL if no parent. Section * m_parent; // Parent section or NULL if no parent.
ConstString m_name; // Name of this section ConstString m_name; // Name of this section
SectionType m_type; // The type of this section lldb::SectionType m_type; // The type of this section
lldb::addr_t m_file_addr; // The absolute file virtual address range of this section if m_parent == NULL, lldb::addr_t m_file_addr; // The absolute file virtual address range of this section if m_parent == NULL,
// offset from parent file virtual address if m_parent != NULL // offset from parent file virtual address if m_parent != NULL
lldb::addr_t m_byte_size; // Size in bytes that this section will occupy in memory at runtime lldb::addr_t m_byte_size; // Size in bytes that this section will occupy in memory at runtime

View File

@ -31,7 +31,7 @@ public:
Symbol (lldb::user_id_t symID, Symbol (lldb::user_id_t symID,
const char *name, const char *name,
bool name_is_mangled, bool name_is_mangled,
SymbolType type, lldb::SymbolType type,
bool external, bool external,
bool is_debug, bool is_debug,
bool is_trampoline, bool is_trampoline,
@ -44,7 +44,7 @@ public:
Symbol (lldb::user_id_t symID, Symbol (lldb::user_id_t symID,
const char *name, const char *name,
bool name_is_mangled, bool name_is_mangled,
SymbolType type, lldb::SymbolType type,
bool external, bool external,
bool is_debug, bool is_debug,
bool is_trampoline, bool is_trampoline,
@ -58,7 +58,7 @@ public:
operator= (const Symbol& rhs); operator= (const Symbol& rhs);
bool bool
Compare (const ConstString& name, SymbolType type) const; Compare (const ConstString& name, lldb::SymbolType type) const;
void void
Dump (Stream *s, Target *target, uint32_t index) const; Dump (Stream *s, Target *target, uint32_t index) const;
@ -96,11 +96,11 @@ public:
lldb::addr_t lldb::addr_t
GetByteSize () const { return m_addr_range.GetByteSize(); } GetByteSize () const { return m_addr_range.GetByteSize(); }
SymbolType lldb::SymbolType
GetType () const { return m_type; } GetType () const { return m_type; }
void void
SetType (SymbolType type) { m_type = type; } SetType (lldb::SymbolType type) { m_type = type; }
const char * const char *
GetTypeAsString () const; GetTypeAsString () const;
@ -186,7 +186,7 @@ public:
protected: protected:
Mangled m_mangled; // uniqued symbol name/mangled name pair Mangled m_mangled; // uniqued symbol name/mangled name pair
SymbolType m_type; // symbol type lldb::SymbolType m_type; // symbol type
uint16_t m_type_data; // data specific to m_type uint16_t m_type_data; // data specific to m_type
uint16_t m_type_data_resolved:1, // True if the data in m_type_data has already been calculated uint16_t m_type_data_resolved:1, // True if the data in m_type_data has already been calculated
m_is_synthetic:1, // non-zero if this symbol is not actually in the symbol table, but synthesized from other info in the object file. m_is_synthetic:1, // non-zero if this symbol is not actually in the symbol table, but synthesized from other info in the object file.

View File

@ -52,21 +52,21 @@ public:
Symbol * FindSymbolByID (lldb::user_id_t uid) const; Symbol * FindSymbolByID (lldb::user_id_t uid) const;
Symbol * SymbolAtIndex (uint32_t idx); Symbol * SymbolAtIndex (uint32_t idx);
const Symbol * SymbolAtIndex (uint32_t idx) const; const Symbol * SymbolAtIndex (uint32_t idx) const;
Symbol * FindSymbolWithType (SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx); Symbol * FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx);
// const Symbol * FindSymbolWithType (SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx) const; // const Symbol * FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx) const;
uint32_t AppendSymbolIndexesWithType (SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const; uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue (SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const; uint32_t AppendSymbolIndexesWithTypeAndFlagsValue (lldb::SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
uint32_t AppendSymbolIndexesWithType (SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const; uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
uint32_t AppendSymbolIndexesWithName (const ConstString& symbol_name, std::vector<uint32_t>& matches); uint32_t AppendSymbolIndexesWithName (const ConstString& symbol_name, std::vector<uint32_t>& matches);
uint32_t AppendSymbolIndexesWithName (const ConstString& symbol_name, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches); uint32_t AppendSymbolIndexesWithName (const ConstString& symbol_name, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches);
uint32_t AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, SymbolType symbol_type, std::vector<uint32_t>& matches); uint32_t AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, lldb::SymbolType symbol_type, std::vector<uint32_t>& matches);
uint32_t AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches); uint32_t AppendSymbolIndexesWithNameAndType (const ConstString& symbol_name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches);
uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, SymbolType symbol_type, std::vector<uint32_t>& indexes); uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes);
uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& indexes); uint32_t AppendSymbolIndexesMatchingRegExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& indexes);
size_t FindAllSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_type, std::vector<uint32_t>& symbol_indexes); size_t FindAllSymbolsWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, std::vector<uint32_t>& symbol_indexes);
size_t FindAllSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes); size_t FindAllSymbolsWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
size_t FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes); size_t FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility); Symbol * FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility);
Symbol * FindSymbolWithFileAddress (lldb::addr_t file_addr); Symbol * FindSymbolWithFileAddress (lldb::addr_t file_addr);
// Symbol * FindSymbolContainingAddress (const Address& value, const uint32_t* indexes, uint32_t num_indexes); // Symbol * FindSymbolContainingAddress (const Address& value, const uint32_t* indexes, uint32_t num_indexes);
// Symbol * FindSymbolContainingAddress (const Address& value); // Symbol * FindSymbolContainingAddress (const Address& value);

View File

@ -12,380 +12,446 @@
namespace lldb { namespace lldb {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Process and Thread States // Process and Thread States
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum StateType typedef enum StateType
{ {
eStateInvalid = 0, eStateInvalid = 0,
eStateUnloaded, ///< Process is object is valid, but not currently loaded eStateUnloaded, ///< Process is object is valid, but not currently loaded
eStateConnected, ///< Process is connected to remote debug services, but not launched or attached to anything yet eStateConnected, ///< Process is connected to remote debug services, but not launched or attached to anything yet
eStateAttaching, ///< Process is currently trying to attach eStateAttaching, ///< Process is currently trying to attach
eStateLaunching, ///< Process is in the process of launching eStateLaunching, ///< Process is in the process of launching
eStateStopped, ///< Process or thread is stopped and can be examined. eStateStopped, ///< Process or thread is stopped and can be examined.
eStateRunning, ///< Process or thread is running and can't be examined. eStateRunning, ///< Process or thread is running and can't be examined.
eStateStepping, ///< Process or thread is in the process of stepping and can not be examined. eStateStepping, ///< Process or thread is in the process of stepping and can not be examined.
eStateCrashed, ///< Process or thread has crashed and can be examined. eStateCrashed, ///< Process or thread has crashed and can be examined.
eStateDetached, ///< Process has been detached and can't be examined. eStateDetached, ///< Process has been detached and can't be examined.
eStateExited, ///< Process has exited and can't be examined. eStateExited, ///< Process has exited and can't be examined.
eStateSuspended ///< Process or thread is in a suspended state as far eStateSuspended ///< Process or thread is in a suspended state as far
///< as the debugger is concerned while other processes ///< as the debugger is concerned while other processes
///< or threads get the chance to run. ///< or threads get the chance to run.
} StateType; } StateType;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Launch Flags // Launch Flags
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum LaunchFlags typedef enum LaunchFlags
{ {
eLaunchFlagNone = 0u, eLaunchFlagNone = 0u,
eLaunchFlagDisableASLR = (1u << 0), ///< Disable Address Space Layout Randomization eLaunchFlagDisableASLR = (1u << 0), ///< Disable Address Space Layout Randomization
eLaunchFlagDisableSTDIO = (1u << 1), ///< Disable stdio for inferior process (e.g. for a GUI app) eLaunchFlagDisableSTDIO = (1u << 1), ///< Disable stdio for inferior process (e.g. for a GUI app)
eLaunchFlagLaunchInTTY = (1u << 2) ///< Launch the process in a new TTY if supported by the host eLaunchFlagLaunchInTTY = (1u << 2) ///< Launch the process in a new TTY if supported by the host
} LaunchFlags; } LaunchFlags;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Thread Run Modes // Thread Run Modes
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum RunMode { typedef enum RunMode {
eOnlyThisThread, eOnlyThisThread,
eAllThreads, eAllThreads,
eOnlyDuringStepping eOnlyDuringStepping
} RunMode; } RunMode;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Byte ordering definitions // Byte ordering definitions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum ByteOrder typedef enum ByteOrder
{ {
eByteOrderInvalid = 0, eByteOrderInvalid = 0,
eByteOrderBig = 1, eByteOrderBig = 1,
eByteOrderPDP = 2, eByteOrderPDP = 2,
eByteOrderLittle = 4 eByteOrderLittle = 4
} ByteOrder; } ByteOrder;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Register encoding definitions // Register encoding definitions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum Encoding typedef enum Encoding
{ {
eEncodingInvalid = 0, eEncodingInvalid = 0,
eEncodingUint, // unsigned integer eEncodingUint, // unsigned integer
eEncodingSint, // signed integer eEncodingSint, // signed integer
eEncodingIEEE754, // float eEncodingIEEE754, // float
eEncodingVector // vector registers eEncodingVector // vector registers
} Encoding; } Encoding;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Display format definitions // Display format definitions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum Format typedef enum Format
{ {
eFormatDefault = 0, eFormatDefault = 0,
eFormatInvalid = 0, eFormatInvalid = 0,
eFormatBoolean, eFormatBoolean,
eFormatBinary, eFormatBinary,
eFormatBytes, eFormatBytes,
eFormatBytesWithASCII, eFormatBytesWithASCII,
eFormatChar, eFormatChar,
eFormatCharPrintable, // Only printable characters, space if not printable eFormatCharPrintable, // Only printable characters, space if not printable
eFormatComplex, // Floating point complex type eFormatComplex, // Floating point complex type
eFormatComplexFloat = eFormatComplex, eFormatComplexFloat = eFormatComplex,
eFormatCString, // NULL terminated C strings eFormatCString, // NULL terminated C strings
eFormatDecimal, eFormatDecimal,
eFormatEnum, eFormatEnum,
eFormatHex, eFormatHex,
eFormatFloat, eFormatFloat,
eFormatOctal, eFormatOctal,
eFormatOSType, // OS character codes encoded into an integer 'PICT' 'text' etc... eFormatOSType, // OS character codes encoded into an integer 'PICT' 'text' etc...
eFormatUnicode16, eFormatUnicode16,
eFormatUnicode32, eFormatUnicode32,
eFormatUnsigned, eFormatUnsigned,
eFormatPointer, eFormatPointer,
eFormatVectorOfChar, eFormatVectorOfChar,
eFormatVectorOfSInt8, eFormatVectorOfSInt8,
eFormatVectorOfUInt8, eFormatVectorOfUInt8,
eFormatVectorOfSInt16, eFormatVectorOfSInt16,
eFormatVectorOfUInt16, eFormatVectorOfUInt16,
eFormatVectorOfSInt32, eFormatVectorOfSInt32,
eFormatVectorOfUInt32, eFormatVectorOfUInt32,
eFormatVectorOfSInt64, eFormatVectorOfSInt64,
eFormatVectorOfUInt64, eFormatVectorOfUInt64,
eFormatVectorOfFloat32, eFormatVectorOfFloat32,
eFormatVectorOfFloat64, eFormatVectorOfFloat64,
eFormatVectorOfUInt128, eFormatVectorOfUInt128,
eFormatComplexInteger // Integer complex type eFormatComplexInteger // Integer complex type
} Format; } Format;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls // Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum DescriptionLevel typedef enum DescriptionLevel
{ {
eDescriptionLevelBrief = 0, eDescriptionLevelBrief = 0,
eDescriptionLevelFull, eDescriptionLevelFull,
eDescriptionLevelVerbose, eDescriptionLevelVerbose,
kNumDescriptionLevels kNumDescriptionLevels
} DescriptionLevel; } DescriptionLevel;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Script interpreter types // Script interpreter types
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum ScriptLanguage typedef enum ScriptLanguage
{ {
eScriptLanguageNone, eScriptLanguageNone,
eScriptLanguagePython, eScriptLanguagePython,
eScriptLanguageDefault = eScriptLanguagePython eScriptLanguageDefault = eScriptLanguagePython
} ScriptLanguage; } ScriptLanguage;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Register numbering types // Register numbering types
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum RegisterKind typedef enum RegisterKind
{ {
eRegisterKindGCC = 0, // the register numbers seen in eh_frame eRegisterKindGCC = 0, // the register numbers seen in eh_frame
eRegisterKindDWARF, // the register numbers seen DWARF eRegisterKindDWARF, // the register numbers seen DWARF
eRegisterKindGeneric, // insn ptr reg, stack ptr reg, etc not specific to any particular target eRegisterKindGeneric, // insn ptr reg, stack ptr reg, etc not specific to any particular target
eRegisterKindGDB, // the register numbers gdb uses (matches stabs numbers?) eRegisterKindGDB, // the register numbers gdb uses (matches stabs numbers?)
eRegisterKindLLDB, // lldb's internal register numbers eRegisterKindLLDB, // lldb's internal register numbers
kNumRegisterKinds kNumRegisterKinds
} RegisterKind; } RegisterKind;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Thread stop reasons // Thread stop reasons
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum StopReason typedef enum StopReason
{ {
eStopReasonInvalid = 0, eStopReasonInvalid = 0,
eStopReasonNone, eStopReasonNone,
eStopReasonTrace, eStopReasonTrace,
eStopReasonBreakpoint, eStopReasonBreakpoint,
eStopReasonWatchpoint, eStopReasonWatchpoint,
eStopReasonSignal, eStopReasonSignal,
eStopReasonException, eStopReasonException,
eStopReasonPlanComplete eStopReasonPlanComplete
} StopReason; } StopReason;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Command Return Status Types // Command Return Status Types
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum ReturnStatus typedef enum ReturnStatus
{ {
eReturnStatusInvalid, eReturnStatusInvalid,
eReturnStatusSuccessFinishNoResult, eReturnStatusSuccessFinishNoResult,
eReturnStatusSuccessFinishResult, eReturnStatusSuccessFinishResult,
eReturnStatusSuccessContinuingNoResult, eReturnStatusSuccessContinuingNoResult,
eReturnStatusSuccessContinuingResult, eReturnStatusSuccessContinuingResult,
eReturnStatusStarted, eReturnStatusStarted,
eReturnStatusFailed, eReturnStatusFailed,
eReturnStatusQuit eReturnStatusQuit
} ReturnStatus; } ReturnStatus;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Connection Status Types // Connection Status Types
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum ConnectionStatus typedef enum ConnectionStatus
{ {
eConnectionStatusSuccess, // Success eConnectionStatusSuccess, // Success
eConnectionStatusEndOfFile, // End-of-file encountered eConnectionStatusEndOfFile, // End-of-file encountered
eConnectionStatusError, // Check GetError() for details eConnectionStatusError, // Check GetError() for details
eConnectionStatusTimedOut, // Request timed out eConnectionStatusTimedOut, // Request timed out
eConnectionStatusNoConnection, // No connection eConnectionStatusNoConnection, // No connection
eConnectionStatusLostConnection // Lost connection while connected to a valid connection eConnectionStatusLostConnection // Lost connection while connected to a valid connection
} ConnectionStatus; } ConnectionStatus;
typedef enum ErrorType typedef enum ErrorType
{ {
eErrorTypeInvalid, eErrorTypeInvalid,
eErrorTypeGeneric, ///< Generic errors that can be any value. eErrorTypeGeneric, ///< Generic errors that can be any value.
eErrorTypeMachKernel, ///< Mach kernel error codes. eErrorTypeMachKernel, ///< Mach kernel error codes.
eErrorTypePOSIX ///< POSIX error codes. eErrorTypePOSIX ///< POSIX error codes.
} ErrorType; } ErrorType;
typedef enum ValueType typedef enum ValueType
{ {
eValueTypeInvalid = 0, eValueTypeInvalid = 0,
eValueTypeVariableGlobal = 1, // globals variable eValueTypeVariableGlobal = 1, // globals variable
eValueTypeVariableStatic = 2, // static variable eValueTypeVariableStatic = 2, // static variable
eValueTypeVariableArgument = 3, // function argument variables eValueTypeVariableArgument = 3, // function argument variables
eValueTypeVariableLocal = 4, // function local variables eValueTypeVariableLocal = 4, // function local variables
eValueTypeRegister = 5, // stack frame register value eValueTypeRegister = 5, // stack frame register value
eValueTypeRegisterSet = 6, // A collection of stack frame register values eValueTypeRegisterSet = 6, // A collection of stack frame register values
eValueTypeConstResult = 7 // constant result variables eValueTypeConstResult = 7 // constant result variables
} ValueType; } ValueType;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Token size/granularities for Input Readers // Token size/granularities for Input Readers
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum InputReaderGranularity typedef enum InputReaderGranularity
{ {
eInputReaderGranularityInvalid = 0, eInputReaderGranularityInvalid = 0,
eInputReaderGranularityByte, eInputReaderGranularityByte,
eInputReaderGranularityWord, eInputReaderGranularityWord,
eInputReaderGranularityLine, eInputReaderGranularityLine,
eInputReaderGranularityAll eInputReaderGranularityAll
} InputReaderGranularity; } InputReaderGranularity;
//------------------------------------------------------------------ //------------------------------------------------------------------
/// These mask bits allow a common interface for queries that can /// These mask bits allow a common interface for queries that can
/// limit the amount of information that gets parsed to only the /// limit the amount of information that gets parsed to only the
/// information that is requested. These bits also can indicate what /// information that is requested. These bits also can indicate what
/// actually did get resolved during query function calls. /// actually did get resolved during query function calls.
/// ///
/// Each definition corresponds to a one of the member variables /// Each definition corresponds to a one of the member variables
/// in this class, and requests that that item be resolved, or /// in this class, and requests that that item be resolved, or
/// indicates that the member did get resolved. /// indicates that the member did get resolved.
//------------------------------------------------------------------ //------------------------------------------------------------------
typedef enum SymbolContextItem typedef enum SymbolContextItem
{ {
eSymbolContextTarget = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results eSymbolContextTarget = (1 << 0), ///< Set when \a target is requested from a query, or was located in query results
eSymbolContextModule = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results eSymbolContextModule = (1 << 1), ///< Set when \a module is requested from a query, or was located in query results
eSymbolContextCompUnit = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results eSymbolContextCompUnit = (1 << 2), ///< Set when \a comp_unit is requested from a query, or was located in query results
eSymbolContextFunction = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results eSymbolContextFunction = (1 << 3), ///< Set when \a function is requested from a query, or was located in query results
eSymbolContextBlock = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results eSymbolContextBlock = (1 << 4), ///< Set when the deepest \a block is requested from a query, or was located in query results
eSymbolContextLineEntry = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results eSymbolContextLineEntry = (1 << 5), ///< Set when \a line_entry is requested from a query, or was located in query results
eSymbolContextSymbol = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results eSymbolContextSymbol = (1 << 6), ///< Set when \a symbol is requested from a query, or was located in query results
eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1) ///< Indicates to try and lookup everything up during a query. eSymbolContextEverything = ((eSymbolContextSymbol << 1) - 1) ///< Indicates to try and lookup everything up during a query.
} SymbolContextItem; } SymbolContextItem;
typedef enum Permissions typedef enum Permissions
{ {
ePermissionsWritable = (1 << 0), ePermissionsWritable = (1 << 0),
ePermissionsReadable = (1 << 1), ePermissionsReadable = (1 << 1),
ePermissionsExecutable = (1 << 2) ePermissionsExecutable = (1 << 2)
} Permissions; } Permissions;
typedef enum InputReaderAction typedef enum InputReaderAction
{ {
eInputReaderActivate, // reader is newly pushed onto the reader stack eInputReaderActivate, // reader is newly pushed onto the reader stack
eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off eInputReaderReactivate, // reader is on top of the stack again after another reader was popped off
eInputReaderDeactivate, // another reader was pushed on the stack eInputReaderDeactivate, // another reader was pushed on the stack
eInputReaderGotToken, // reader got one of its tokens (granularity) eInputReaderGotToken, // reader got one of its tokens (granularity)
eInputReaderInterrupt, // reader received an interrupt signal (probably from a control-c) eInputReaderInterrupt, // reader received an interrupt signal (probably from a control-c)
eInputReaderEndOfFile, // reader received an EOF char (probably from a control-d) eInputReaderEndOfFile, // reader received an EOF char (probably from a control-d)
eInputReaderDone // reader was just popped off the stack and is done eInputReaderDone // reader was just popped off the stack and is done
} InputReaderAction; } InputReaderAction;
typedef enum BreakpointEventType typedef enum BreakpointEventType
{ {
eBreakpointEventTypeInvalidType = (1u << 0), eBreakpointEventTypeInvalidType = (1u << 0),
eBreakpointEventTypeAdded = (1u << 1), eBreakpointEventTypeAdded = (1u << 1),
eBreakpointEventTypeRemoved = (1u << 2), eBreakpointEventTypeRemoved = (1u << 2),
eBreakpointEventTypeLocationsAdded = (1u << 3), eBreakpointEventTypeLocationsAdded = (1u << 3),
eBreakpointEventTypeLocationsRemoved = (1u << 4), eBreakpointEventTypeLocationsRemoved = (1u << 4),
eBreakpointEventTypeLocationsResolved = (1u << 5) eBreakpointEventTypeLocationsResolved = (1u << 5)
} BreakpointEventType; } BreakpointEventType;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/// Programming language type. /// Programming language type.
/// ///
/// These enumerations use the same language enumerations as the DWARF /// These enumerations use the same language enumerations as the DWARF
/// specification for ease of use and consistency. /// specification for ease of use and consistency.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
typedef enum LanguageType typedef enum LanguageType
{ {
eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value. eLanguageTypeUnknown = 0x0000, ///< Unknown or invalid language value.
eLanguageTypeC89 = 0x0001, ///< ISO C:1989. eLanguageTypeC89 = 0x0001, ///< ISO C:1989.
eLanguageTypeC = 0x0002, ///< Non-standardized C, such as K&R. eLanguageTypeC = 0x0002, ///< Non-standardized C, such as K&R.
eLanguageTypeAda83 = 0x0003, ///< ISO Ada:1983. eLanguageTypeAda83 = 0x0003, ///< ISO Ada:1983.
eLanguageTypeC_plus_plus = 0x0004, ///< ISO C++:1998. eLanguageTypeC_plus_plus = 0x0004, ///< ISO C++:1998.
eLanguageTypeCobol74 = 0x0005, ///< ISO Cobol:1974. eLanguageTypeCobol74 = 0x0005, ///< ISO Cobol:1974.
eLanguageTypeCobol85 = 0x0006, ///< ISO Cobol:1985. eLanguageTypeCobol85 = 0x0006, ///< ISO Cobol:1985.
eLanguageTypeFortran77 = 0x0007, ///< ISO Fortran 77. eLanguageTypeFortran77 = 0x0007, ///< ISO Fortran 77.
eLanguageTypeFortran90 = 0x0008, ///< ISO Fortran 90. eLanguageTypeFortran90 = 0x0008, ///< ISO Fortran 90.
eLanguageTypePascal83 = 0x0009, ///< ISO Pascal:1983. eLanguageTypePascal83 = 0x0009, ///< ISO Pascal:1983.
eLanguageTypeModula2 = 0x000a, ///< ISO Modula-2:1996. eLanguageTypeModula2 = 0x000a, ///< ISO Modula-2:1996.
eLanguageTypeJava = 0x000b, ///< Java. eLanguageTypeJava = 0x000b, ///< Java.
eLanguageTypeC99 = 0x000c, ///< ISO C:1999. eLanguageTypeC99 = 0x000c, ///< ISO C:1999.
eLanguageTypeAda95 = 0x000d, ///< ISO Ada:1995. eLanguageTypeAda95 = 0x000d, ///< ISO Ada:1995.
eLanguageTypeFortran95 = 0x000e, ///< ISO Fortran 95. eLanguageTypeFortran95 = 0x000e, ///< ISO Fortran 95.
eLanguageTypePLI = 0x000f, ///< ANSI PL/I:1976. eLanguageTypePLI = 0x000f, ///< ANSI PL/I:1976.
eLanguageTypeObjC = 0x0010, ///< Objective-C. eLanguageTypeObjC = 0x0010, ///< Objective-C.
eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++. eLanguageTypeObjC_plus_plus = 0x0011, ///< Objective-C++.
eLanguageTypeUPC = 0x0012, ///< Unified Parallel C. eLanguageTypeUPC = 0x0012, ///< Unified Parallel C.
eLanguageTypeD = 0x0013, ///< D. eLanguageTypeD = 0x0013, ///< D.
eLanguageTypePython = 0x0014 ///< Python. eLanguageTypePython = 0x0014 ///< Python.
} LanguageType; } LanguageType;
typedef enum AccessType typedef enum AccessType
{ {
eAccessNone, eAccessNone,
eAccessPublic, eAccessPublic,
eAccessPrivate, eAccessPrivate,
eAccessProtected, eAccessProtected,
eAccessPackage eAccessPackage
} AccessType; } AccessType;
typedef enum CommandArgumentType typedef enum CommandArgumentType
{ {
eArgTypeAddress = 0, eArgTypeAddress = 0,
eArgTypeAliasName, eArgTypeAliasName,
eArgTypeAliasOptions, eArgTypeAliasOptions,
eArgTypeArchitecture, eArgTypeArchitecture,
eArgTypeBoolean, eArgTypeBoolean,
eArgTypeBreakpointID, eArgTypeBreakpointID,
eArgTypeBreakpointIDRange, eArgTypeBreakpointIDRange,
eArgTypeByteSize, eArgTypeByteSize,
eArgTypeClassName, eArgTypeClassName,
eArgTypeCommandName, eArgTypeCommandName,
eArgTypeCount, eArgTypeCount,
eArgTypeEndAddress, eArgTypeEndAddress,
eArgTypeExpression, eArgTypeExpression,
eArgTypeExprFormat, eArgTypeExprFormat,
eArgTypeFilename, eArgTypeFilename,
eArgTypeFormat, eArgTypeFormat,
eArgTypeFrameIndex, eArgTypeFrameIndex,
eArgTypeFullName, eArgTypeFullName,
eArgTypeFunctionName, eArgTypeFunctionName,
eArgTypeIndex, eArgTypeIndex,
eArgTypeLineNum, eArgTypeLineNum,
eArgTypeLogCategory, eArgTypeLogCategory,
eArgTypeLogChannel, eArgTypeLogChannel,
eArgTypeMethod, eArgTypeMethod,
eArgTypeName, eArgTypeName,
eArgTypeNewPathPrefix, eArgTypeNewPathPrefix,
eArgTypeNumLines, eArgTypeNumLines,
eArgTypeNumberPerLine, eArgTypeNumberPerLine,
eArgTypeOffset, eArgTypeOffset,
eArgTypeOldPathPrefix, eArgTypeOldPathPrefix,
eArgTypeOneLiner, eArgTypeOneLiner,
eArgTypePath, eArgTypePath,
eArgTypePid, eArgTypePid,
eArgTypePlugin, eArgTypePlugin,
eArgTypeProcessName, eArgTypeProcessName,
eArgTypeQueueName, eArgTypeQueueName,
eArgTypeRegisterName, eArgTypeRegisterName,
eArgTypeRegularExpression, eArgTypeRegularExpression,
eArgTypeRunArgs, eArgTypeRunArgs,
eArgTypeRunMode, eArgTypeRunMode,
eArgTypeScriptLang, eArgTypeScriptLang,
eArgTypeSearchWord, eArgTypeSearchWord,
eArgTypeSelector, eArgTypeSelector,
eArgTypeSettingIndex, eArgTypeSettingIndex,
eArgTypeSettingKey, eArgTypeSettingKey,
eArgTypeSettingPrefix, eArgTypeSettingPrefix,
eArgTypeSettingVariableName, eArgTypeSettingVariableName,
eArgTypeShlibName, eArgTypeShlibName,
eArgTypeSourceFile, eArgTypeSourceFile,
eArgTypeSortOrder, eArgTypeSortOrder,
eArgTypeStartAddress, eArgTypeStartAddress,
eArgTypeSymbol, eArgTypeSymbol,
eArgTypeThreadID, eArgTypeThreadID,
eArgTypeThreadIndex, eArgTypeThreadIndex,
eArgTypeThreadName, eArgTypeThreadName,
eArgTypeUnixSignal, eArgTypeUnixSignal,
eArgTypeVarName, eArgTypeVarName,
eArgTypeValue, eArgTypeValue,
eArgTypeWidth, eArgTypeWidth,
eArgTypeNone, eArgTypeNone,
eArgTypeLastArg // Always keep this entry as the last entry in this enumeration!! eArgTypeLastArg // Always keep this entry as the last entry in this enumeration!!
} CommandArgumentType; } CommandArgumentType;
//----------------------------------------------------------------------
// Symbol types
//----------------------------------------------------------------------
typedef enum SymbolType
{
eSymbolTypeAny = 0,
eSymbolTypeInvalid = 0,
eSymbolTypeAbsolute,
eSymbolTypeExtern,
eSymbolTypeCode,
eSymbolTypeData,
eSymbolTypeTrampoline,
eSymbolTypeRuntime,
eSymbolTypeException,
eSymbolTypeSourceFile,
eSymbolTypeHeaderFile,
eSymbolTypeObjectFile,
eSymbolTypeCommonBlock,
eSymbolTypeBlock,
eSymbolTypeLocal,
eSymbolTypeParam,
eSymbolTypeVariable,
eSymbolTypeVariableType,
eSymbolTypeLineEntry,
eSymbolTypeLineHeader,
eSymbolTypeScopeBegin,
eSymbolTypeScopeEnd,
eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
eSymbolTypeCompiler,
eSymbolTypeInstrumentation,
eSymbolTypeUndefined
} SymbolType;
typedef enum SectionType
{
eSectionTypeInvalid,
eSectionTypeCode,
eSectionTypeContainer, // The section contains child sections
eSectionTypeData,
eSectionTypeDataCString, // Inlined C string data
eSectionTypeDataCStringPointers, // Pointers to C string data
eSectionTypeDataSymbolAddress, // Address of a symbol in the symbol table
eSectionTypeData4,
eSectionTypeData8,
eSectionTypeData16,
eSectionTypeDataPointers,
eSectionTypeDebug,
eSectionTypeZeroFill,
eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector
eSectionTypeDataObjCCFStrings, // Objective C const CFString/NSString objects
eSectionTypeDWARFDebugAbbrev,
eSectionTypeDWARFDebugAranges,
eSectionTypeDWARFDebugFrame,
eSectionTypeDWARFDebugInfo,
eSectionTypeDWARFDebugLine,
eSectionTypeDWARFDebugLoc,
eSectionTypeDWARFDebugMacInfo,
eSectionTypeDWARFDebugPubNames,
eSectionTypeDWARFDebugPubTypes,
eSectionTypeDWARFDebugRanges,
eSectionTypeDWARFDebugStr,
eSectionTypeEHFrame,
eSectionTypeOther
} SectionType;
} // namespace lldb } // namespace lldb

View File

@ -67,73 +67,6 @@ typedef enum Vote
eVoteYes = 1 eVoteYes = 1
} Vote; } Vote;
//----------------------------------------------------------------------
// Symbol types
//----------------------------------------------------------------------
typedef enum SymbolType
{
eSymbolTypeAny = 0,
eSymbolTypeInvalid = 0,
eSymbolTypeAbsolute,
eSymbolTypeExtern,
eSymbolTypeCode,
eSymbolTypeData,
eSymbolTypeTrampoline,
eSymbolTypeRuntime,
eSymbolTypeException,
eSymbolTypeSourceFile,
eSymbolTypeHeaderFile,
eSymbolTypeObjectFile,
eSymbolTypeCommonBlock,
eSymbolTypeBlock,
eSymbolTypeLocal,
eSymbolTypeParam,
eSymbolTypeVariable,
eSymbolTypeVariableType,
eSymbolTypeLineEntry,
eSymbolTypeLineHeader,
eSymbolTypeScopeBegin,
eSymbolTypeScopeEnd,
eSymbolTypeAdditional, // When symbols take more than one entry, the extra entries get this type
eSymbolTypeCompiler,
eSymbolTypeInstrumentation,
eSymbolTypeUndefined
} SymbolType;
typedef enum SectionType
{
eSectionTypeInvalid,
eSectionTypeCode,
eSectionTypeContainer, // The section contains child sections
eSectionTypeData,
eSectionTypeDataCString, // Inlined C string data
eSectionTypeDataCStringPointers, // Pointers to C string data
eSectionTypeDataSymbolAddress, // Address of a symbol in the symbol table
eSectionTypeData4,
eSectionTypeData8,
eSectionTypeData16,
eSectionTypeDataPointers,
eSectionTypeDebug,
eSectionTypeZeroFill,
eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector
eSectionTypeDataObjCCFStrings, // Objective C const CFString/NSString objects
eSectionTypeDWARFDebugAbbrev,
eSectionTypeDWARFDebugAranges,
eSectionTypeDWARFDebugFrame,
eSectionTypeDWARFDebugInfo,
eSectionTypeDWARFDebugLine,
eSectionTypeDWARFDebugLoc,
eSectionTypeDWARFDebugMacInfo,
eSectionTypeDWARFDebugPubNames,
eSectionTypeDWARFDebugPubTypes,
eSectionTypeDWARFDebugRanges,
eSectionTypeDWARFDebugStr,
eSectionTypeEHFrame,
eSectionTypeOther
} SectionType;
typedef enum ArchitectureType typedef enum ArchitectureType
{ {
eArchTypeInvalid, eArchTypeInvalid,

View File

@ -70,7 +70,7 @@ const char *
GetVoteAsCString (Vote vote); GetVoteAsCString (Vote vote);
const char * const char *
GetSectionTypeAsCString (SectionType sect_type); GetSectionTypeAsCString (lldb::SectionType sect_type);
bool bool
NameMatches (const char *name, NameMatchType match_type, const char *match); NameMatches (const char *name, NameMatchType match_type, const char *match);

View File

@ -12,6 +12,7 @@
#include "lldb/API/SBStream.h" #include "lldb/API/SBStream.h"
#include "lldb/Core/Address.h" #include "lldb/Core/Address.h"
#include "lldb/Core/Log.h" #include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Host/Mutex.h" #include "lldb/Host/Mutex.h"
#include "lldb/Target/Target.h" #include "lldb/Target/Target.h"
@ -170,3 +171,31 @@ SBAddress::GetDescription (SBStream &description)
return true; return true;
} }
SectionType
SBAddress::GetSectionType ()
{
if (m_opaque_ap.get())
{
const Section *section = m_opaque_ap->GetSection();
if (section)
return section->GetType();
}
return eSectionTypeInvalid;
}
SBModule
SBAddress::GetModule ()
{
SBModule sb_module;
if (m_opaque_ap.get())
{
const Module *module = m_opaque_ap->GetModule();
if (module)
*sb_module = module->GetSP();
}
return sb_module;
}

View File

@ -198,3 +198,11 @@ SBSymbol::GetPrologueByteSize ()
return m_opaque_ptr->GetPrologueByteSize(); return m_opaque_ptr->GetPrologueByteSize();
return 0; return 0;
} }
SymbolType
SBSymbol::GetType ()
{
if (m_opaque_ptr)
return m_opaque_ptr->GetType();
return eSymbolTypeInvalid;
}

View File

@ -74,7 +74,7 @@ Module::~Module()
ModuleSP ModuleSP
Module::GetSP () Module::GetSP () const
{ {
return ModuleList::GetModuleSP (this); return ModuleList::GetModuleSP (this);
} }

View File

@ -168,7 +168,9 @@ public:
const DWARFDebugRanges* DebugRanges() const; const DWARFDebugRanges* DebugRanges() const;
const lldb_private::DataExtractor& const lldb_private::DataExtractor&
GetCachedSectionData (uint32_t got_flag, lldb_private::SectionType sect_type, lldb_private::DataExtractor &data); GetCachedSectionData (uint32_t got_flag,
lldb::SectionType sect_type,
lldb_private::DataExtractor &data);
static bool static bool
SupportedVersion(uint16_t version); SupportedVersion(uint16_t version);