Update LLDB snapshot to upstream r241361
Notable upstream commits (upstream revision in parens): - Add a JSON producer to LLDB (228636) - Don't crash on bad DWARF expression (228729) - Add support of DWARFv3 DW_OP_form_tls_address (231342) - Assembly profiler for MIPS64 (232619) - Handle FreeBSD/arm64 core files (233273) - Read/Write register for MIPS64 (233685) - Rework LLDB system initialization (233758) - SysV ABI for aarch64 (236098) - MIPS software single stepping (236696) - FreeBSD/arm live debugging support (237303) - Assembly profiler for mips32 (237420) - Parse function name from DWARF DW_AT_abstract_origin (238307) - Improve LLDB prompt handling (238313) - Add real time signals support to FreeBSDSignals (238316) - Fix race in IOHandlerProcessSTDIO (238423) - MIPS64 Branch instruction emulation for SW single stepping (238820) - Improve OSType initialization in elf object file's arch_spec (239148) - Emulation of MIPS64 floating-point branch instructions (239996) - ABI Plugin for MIPS32 (239997) - ABI Plugin for MIPS64 (240123) - MIPS32 branch emulation and single stepping (240373) - Improve instruction emulation based stack unwinding on ARM (240533) - Add branch emulation to aarch64 instruction emulator (240769)
This commit is contained in:
commit
1c3bbb013d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/clang-trunk/; revision=285116
@ -52,5 +52,6 @@
|
|||||||
#include "lldb/API/SBType.h"
|
#include "lldb/API/SBType.h"
|
||||||
#include "lldb/API/SBValue.h"
|
#include "lldb/API/SBValue.h"
|
||||||
#include "lldb/API/SBValueList.h"
|
#include "lldb/API/SBValueList.h"
|
||||||
|
#include "lldb/API/SBVariablesOptions.h"
|
||||||
|
|
||||||
#endif // LLDB_LLDB_h_
|
#endif // LLDB_LLDB_h_
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBAddress
|
class LLDB_API SBAddress
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
149
contrib/llvm/tools/lldb/include/lldb/API/SBAttachInfo.h
Normal file
149
contrib/llvm/tools/lldb/include/lldb/API/SBAttachInfo.h
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
//===-- SBAttachInfo.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLDB_SBAttachInfo_h_
|
||||||
|
#define LLDB_SBAttachInfo_h_
|
||||||
|
|
||||||
|
#include "lldb/API/SBDefines.h"
|
||||||
|
|
||||||
|
namespace lldb {
|
||||||
|
|
||||||
|
class SBTarget;
|
||||||
|
|
||||||
|
class LLDB_API SBAttachInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SBAttachInfo ();
|
||||||
|
|
||||||
|
SBAttachInfo (lldb::pid_t pid);
|
||||||
|
|
||||||
|
SBAttachInfo (const char *path, bool wait_for);
|
||||||
|
|
||||||
|
SBAttachInfo (const SBAttachInfo &rhs);
|
||||||
|
|
||||||
|
~SBAttachInfo();
|
||||||
|
|
||||||
|
SBAttachInfo &
|
||||||
|
operator = (const SBAttachInfo &rhs);
|
||||||
|
|
||||||
|
lldb::pid_t
|
||||||
|
GetProcessID ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetProcessID (lldb::pid_t pid);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetExecutable (const char *path);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetExecutable (lldb::SBFileSpec exe_file);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetWaitForLaunch ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetWaitForLaunch (bool b);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIgnoreExisting ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIgnoreExisting (bool b);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetResumeCount ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetResumeCount (uint32_t c);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetProcessPluginName ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetProcessPluginName (const char *plugin_name);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetUserID();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetGroupID();
|
||||||
|
|
||||||
|
bool
|
||||||
|
UserIDIsValid ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
GroupIDIsValid ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetUserID (uint32_t uid);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetGroupID (uint32_t gid);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetEffectiveUserID();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetEffectiveGroupID();
|
||||||
|
|
||||||
|
bool
|
||||||
|
EffectiveUserIDIsValid ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
EffectiveGroupIDIsValid ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetEffectiveUserID (uint32_t uid);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetEffectiveGroupID (uint32_t gid);
|
||||||
|
|
||||||
|
lldb::pid_t
|
||||||
|
GetParentProcessID ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetParentProcessID (lldb::pid_t pid);
|
||||||
|
|
||||||
|
bool
|
||||||
|
ParentProcessIDIsValid();
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Get the listener that will be used to receive process events.
|
||||||
|
///
|
||||||
|
/// If no listener has been set via a call to
|
||||||
|
/// SBLaunchInfo::SetListener(), then an invalid SBListener will be
|
||||||
|
/// returned (SBListener::IsValid() will return false). If a listener
|
||||||
|
/// has been set, then the valid listener object will be returned.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
SBListener
|
||||||
|
GetListener ();
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Set the listener that will be used to receive process events.
|
||||||
|
///
|
||||||
|
/// By default the SBDebugger, which has a listener, that the SBTarget
|
||||||
|
/// belongs to will listen for the process events. Calling this function
|
||||||
|
/// allows a different listener to be used to listen for process events.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
SetListener (SBListener &listener);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
friend class SBTarget;
|
||||||
|
|
||||||
|
lldb_private::ProcessAttachInfo &
|
||||||
|
ref ();
|
||||||
|
|
||||||
|
ProcessAttachInfoSP m_opaque_sp;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lldb
|
||||||
|
|
||||||
|
#endif // LLDB_SBAttachInfo_h_
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBBlock
|
class LLDB_API SBBlock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBBreakpoint
|
class LLDB_API SBBreakpoint
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBBreakpointLocation
|
class LLDB_API SBBreakpointLocation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -101,9 +101,7 @@ class SBBreakpointLocation
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class SBBreakpoint;
|
friend class SBBreakpoint;
|
||||||
#ifndef LLDB_DISABLE_PYTHON
|
|
||||||
friend class lldb_private::ScriptInterpreterPython;
|
|
||||||
#endif
|
|
||||||
void
|
void
|
||||||
SetLocation (const lldb::BreakpointLocationSP &break_loc_sp);
|
SetLocation (const lldb::BreakpointLocationSP &break_loc_sp);
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBBroadcaster
|
class LLDB_API SBBroadcaster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBBroadcaster ();
|
SBBroadcaster ();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBCommandInterpreterRunOptions
|
class LLDB_API SBCommandInterpreterRunOptions
|
||||||
{
|
{
|
||||||
friend class SBDebugger;
|
friend class SBDebugger;
|
||||||
friend class SBCommandInterpreter;
|
friend class SBCommandInterpreter;
|
||||||
@ -94,6 +94,9 @@ class SBCommandInterpreter
|
|||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type);
|
GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type);
|
||||||
|
|
||||||
|
static bool
|
||||||
|
EventIsCommandInterpreterEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsValid() const;
|
IsValid() const;
|
||||||
@ -216,6 +219,19 @@ class SBCommandInterpreter
|
|||||||
const char *
|
const char *
|
||||||
GetIOHandlerControlSequence(char ch);
|
GetIOHandlerControlSequence(char ch);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetPromptOnQuit();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetPromptOnQuit(bool b);
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Resolve the command just as HandleCommand would, expanding abbreviations
|
||||||
|
/// and aliases. If successful, result->GetOutput has the full expansion.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
ResolveCommand(const char *command_line, SBCommandReturnObject &result);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
lldb_private::CommandInterpreter &
|
lldb_private::CommandInterpreter &
|
||||||
@ -266,6 +282,21 @@ class SBCommand
|
|||||||
const char*
|
const char*
|
||||||
GetHelp ();
|
GetHelp ();
|
||||||
|
|
||||||
|
const char*
|
||||||
|
GetHelpLong ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetHelp (const char*);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetHelpLong (const char*);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetFlags ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetFlags (uint32_t flags);
|
||||||
|
|
||||||
lldb::SBCommand
|
lldb::SBCommand
|
||||||
AddMultiwordCommand (const char* name, const char* help = NULL);
|
AddMultiwordCommand (const char* name, const char* help = NULL);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBCommandReturnObject
|
class LLDB_API SBCommandReturnObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBCommunication
|
class LLDB_API SBCommunication
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum {
|
FLAGS_ANONYMOUS_ENUM()
|
||||||
|
{
|
||||||
eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
|
eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
|
||||||
eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
|
eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
|
||||||
eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
|
eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBCompileUnit
|
class LLDB_API SBCompileUnit
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBData
|
class LLDB_API SBData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
|
|
||||||
class SBInputReader
|
class LLDB_API SBInputReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBInputReader();
|
SBInputReader();
|
||||||
@ -28,7 +28,7 @@ class SBInputReader
|
|||||||
bool IsActive() const;
|
bool IsActive() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SBDebugger
|
class LLDB_API SBDebugger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBDeclaration
|
class LLDB_API SBDeclaration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ class LLDB_API SBFunction;
|
|||||||
class LLDB_API SBHostOS;
|
class LLDB_API SBHostOS;
|
||||||
class LLDB_API SBInstruction;
|
class LLDB_API SBInstruction;
|
||||||
class LLDB_API SBInstructionList;
|
class LLDB_API SBInstructionList;
|
||||||
|
class LLDB_API SBLanguageRuntime;
|
||||||
|
class LLDB_API SBLaunchInfo;
|
||||||
class LLDB_API SBLineEntry;
|
class LLDB_API SBLineEntry;
|
||||||
class LLDB_API SBListener;
|
class LLDB_API SBListener;
|
||||||
class LLDB_API SBModule;
|
class LLDB_API SBModule;
|
||||||
@ -90,6 +92,7 @@ class LLDB_API SBTypeSynthetic;
|
|||||||
class LLDB_API SBTypeList;
|
class LLDB_API SBTypeList;
|
||||||
class LLDB_API SBValue;
|
class LLDB_API SBValue;
|
||||||
class LLDB_API SBValueList;
|
class LLDB_API SBValueList;
|
||||||
|
class LLDB_API SBVariablesOptions;
|
||||||
class LLDB_API SBWatchpoint;
|
class LLDB_API SBWatchpoint;
|
||||||
class LLDB_API SBUnixSignals;
|
class LLDB_API SBUnixSignals;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBError {
|
class LLDB_API SBError {
|
||||||
public:
|
public:
|
||||||
SBError ();
|
SBError ();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ namespace lldb {
|
|||||||
|
|
||||||
class SBBroadcaster;
|
class SBBroadcaster;
|
||||||
|
|
||||||
class SBEvent
|
class LLDB_API SBEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBEvent();
|
SBEvent();
|
||||||
@ -78,6 +78,7 @@ class SBEvent
|
|||||||
friend class SBBreakpoint;
|
friend class SBBreakpoint;
|
||||||
friend class SBDebugger;
|
friend class SBDebugger;
|
||||||
friend class SBProcess;
|
friend class SBProcess;
|
||||||
|
friend class SBTarget;
|
||||||
friend class SBThread;
|
friend class SBThread;
|
||||||
friend class SBWatchpoint;
|
friend class SBWatchpoint;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBExecutionContext
|
class LLDB_API SBExecutionContext
|
||||||
{
|
{
|
||||||
friend class SBCommandInterpreter;
|
friend class SBCommandInterpreter;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
|
|
||||||
class SBExpressionOptions
|
class LLDB_API SBExpressionOptions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBExpressionOptions();
|
SBExpressionOptions();
|
||||||
@ -105,6 +105,12 @@ class SBExpressionOptions
|
|||||||
void
|
void
|
||||||
SetSuppressPersistentResult (bool b = false);
|
SetSuppressPersistentResult (bool b = false);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetPrefix () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetPrefix (const char *prefix);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
|
SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBFileSpec
|
class LLDB_API SBFileSpec
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBFileSpec ();
|
SBFileSpec ();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBFileSpecList
|
class LLDB_API SBFileSpecList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBFileSpecList ();
|
SBFileSpecList ();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBFrame
|
class LLDB_API SBFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBFrame ();
|
SBFrame ();
|
||||||
@ -25,7 +25,7 @@ class SBFrame
|
|||||||
const lldb::SBFrame &
|
const lldb::SBFrame &
|
||||||
operator =(const lldb::SBFrame &rhs);
|
operator =(const lldb::SBFrame &rhs);
|
||||||
|
|
||||||
~SBFrame();
|
~SBFrame();
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsEqual (const lldb::SBFrame &that) const;
|
IsEqual (const lldb::SBFrame &that) const;
|
||||||
@ -36,6 +36,9 @@ class SBFrame
|
|||||||
uint32_t
|
uint32_t
|
||||||
GetFrameID () const;
|
GetFrameID () const;
|
||||||
|
|
||||||
|
lldb::addr_t
|
||||||
|
GetCFA () const;
|
||||||
|
|
||||||
lldb::addr_t
|
lldb::addr_t
|
||||||
GetPC () const;
|
GetPC () const;
|
||||||
|
|
||||||
@ -88,12 +91,18 @@ class SBFrame
|
|||||||
const char *
|
const char *
|
||||||
GetFunctionName();
|
GetFunctionName();
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetFunctionName() const;
|
||||||
|
|
||||||
/// Return true if this frame represents an inlined function.
|
/// Return true if this frame represents an inlined function.
|
||||||
///
|
///
|
||||||
/// See also GetFunctionName().
|
/// See also GetFunctionName().
|
||||||
bool
|
bool
|
||||||
IsInlined();
|
IsInlined();
|
||||||
|
|
||||||
|
bool
|
||||||
|
IsInlined() const;
|
||||||
|
|
||||||
/// The version that doesn't supply a 'use_dynamic' value will use the
|
/// The version that doesn't supply a 'use_dynamic' value will use the
|
||||||
/// target's default.
|
/// target's default.
|
||||||
lldb::SBValue
|
lldb::SBValue
|
||||||
@ -156,6 +165,9 @@ class SBFrame
|
|||||||
bool in_scope_only,
|
bool in_scope_only,
|
||||||
lldb::DynamicValueType use_dynamic);
|
lldb::DynamicValueType use_dynamic);
|
||||||
|
|
||||||
|
lldb::SBValueList
|
||||||
|
GetVariables (const lldb::SBVariablesOptions& options);
|
||||||
|
|
||||||
lldb::SBValueList
|
lldb::SBValueList
|
||||||
GetRegisters ();
|
GetRegisters ();
|
||||||
|
|
||||||
@ -210,9 +222,6 @@ class SBFrame
|
|||||||
friend class SBInstruction;
|
friend class SBInstruction;
|
||||||
friend class SBThread;
|
friend class SBThread;
|
||||||
friend class SBValue;
|
friend class SBValue;
|
||||||
#ifndef LLDB_DISABLE_PYTHON
|
|
||||||
friend class lldb_private::ScriptInterpreterPython;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lldb::StackFrameSP
|
lldb::StackFrameSP
|
||||||
GetFrameSP() const;
|
GetFrameSP() const;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBFunction
|
class LLDB_API SBFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBHostOS
|
class LLDB_API SBHostOS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBInstruction
|
class LLDB_API SBInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBInstructionList
|
class LLDB_API SBInstructionList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
29
contrib/llvm/tools/lldb/include/lldb/API/SBLanguageRuntime.h
Normal file
29
contrib/llvm/tools/lldb/include/lldb/API/SBLanguageRuntime.h
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
//===-- SBLanguageRuntime.h -------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLDB_SBLanguageRuntime_h_
|
||||||
|
#define LLDB_SBLanguageRuntime_h_
|
||||||
|
|
||||||
|
#include "lldb/API/SBDefines.h"
|
||||||
|
|
||||||
|
namespace lldb {
|
||||||
|
|
||||||
|
class SBLanguageRuntime
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static lldb::LanguageType
|
||||||
|
GetLanguageTypeFromString (const char *string);
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
GetNameForLanguageType (lldb::LanguageType language);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lldb
|
||||||
|
|
||||||
|
#endif // LLDB_SBLanguageRuntime_h_
|
195
contrib/llvm/tools/lldb/include/lldb/API/SBLaunchInfo.h
Normal file
195
contrib/llvm/tools/lldb/include/lldb/API/SBLaunchInfo.h
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
//===-- SBLaunchInfo.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLDB_SBLaunchInfo_h_
|
||||||
|
#define LLDB_SBLaunchInfo_h_
|
||||||
|
|
||||||
|
#include "lldb/API/SBDefines.h"
|
||||||
|
|
||||||
|
namespace lldb {
|
||||||
|
|
||||||
|
class SBPlatform;
|
||||||
|
class SBTarget;
|
||||||
|
|
||||||
|
class LLDB_API SBLaunchInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SBLaunchInfo (const char **argv);
|
||||||
|
|
||||||
|
~SBLaunchInfo();
|
||||||
|
|
||||||
|
lldb::pid_t
|
||||||
|
GetProcessID();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetUserID();
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetGroupID();
|
||||||
|
|
||||||
|
bool
|
||||||
|
UserIDIsValid ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
GroupIDIsValid ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetUserID (uint32_t uid);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetGroupID (uint32_t gid);
|
||||||
|
|
||||||
|
SBFileSpec
|
||||||
|
GetExecutableFile ();
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Set the executable file that will be used to launch the process and
|
||||||
|
/// optionally set it as the first argument in the argument vector.
|
||||||
|
///
|
||||||
|
/// This only needs to be specified if clients wish to carefully control
|
||||||
|
/// the exact path will be used to launch a binary. If you create a
|
||||||
|
/// target with a symlink, that symlink will get resolved in the target
|
||||||
|
/// and the resolved path will get used to launch the process. Calling
|
||||||
|
/// this function can help you still launch your process using the
|
||||||
|
/// path of your choice.
|
||||||
|
///
|
||||||
|
/// If this function is not called prior to launching with
|
||||||
|
/// SBTarget::Launch(...), the target will use the resolved executable
|
||||||
|
/// path that was used to create the target.
|
||||||
|
///
|
||||||
|
/// @param[in] exe_file
|
||||||
|
/// The override path to use when launching the executable.
|
||||||
|
///
|
||||||
|
/// @param[in] add_as_first_arg
|
||||||
|
/// If true, then the path will be inserted into the argument vector
|
||||||
|
/// prior to launching. Otherwise the argument vector will be left
|
||||||
|
/// alone.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Get the listener that will be used to receive process events.
|
||||||
|
///
|
||||||
|
/// If no listener has been set via a call to
|
||||||
|
/// SBLaunchInfo::SetListener(), then an invalid SBListener will be
|
||||||
|
/// returned (SBListener::IsValid() will return false). If a listener
|
||||||
|
/// has been set, then the valid listener object will be returned.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
SBListener
|
||||||
|
GetListener ();
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Set the listener that will be used to receive process events.
|
||||||
|
///
|
||||||
|
/// By default the SBDebugger, which has a listener, that the SBTarget
|
||||||
|
/// belongs to will listen for the process events. Calling this function
|
||||||
|
/// allows a different listener to be used to listen for process events.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
SetListener (SBListener &listener);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetNumArguments ();
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetArgumentAtIndex (uint32_t idx);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetArguments (const char **argv, bool append);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetNumEnvironmentEntries ();
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetEnvironmentEntryAtIndex (uint32_t idx);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetEnvironmentEntries (const char **envp, bool append);
|
||||||
|
|
||||||
|
void
|
||||||
|
Clear ();
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetWorkingDirectory () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetWorkingDirectory (const char *working_dir);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetLaunchFlags ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetLaunchFlags (uint32_t flags);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetProcessPluginName ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetProcessPluginName (const char *plugin_name);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetShell ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetShell (const char * path);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetShellExpandArguments ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetShellExpandArguments (bool glob);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetResumeCount ();
|
||||||
|
|
||||||
|
void
|
||||||
|
SetResumeCount (uint32_t c);
|
||||||
|
|
||||||
|
bool
|
||||||
|
AddCloseFileAction (int fd);
|
||||||
|
|
||||||
|
bool
|
||||||
|
AddDuplicateFileAction (int fd, int dup_fd);
|
||||||
|
|
||||||
|
bool
|
||||||
|
AddOpenFileAction (int fd, const char *path, bool read, bool write);
|
||||||
|
|
||||||
|
bool
|
||||||
|
AddSuppressFileAction (int fd, bool read, bool write);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetLaunchEventData (const char *data);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
GetLaunchEventData () const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetDetachOnError() const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetDetachOnError(bool enable);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
friend class SBPlatform;
|
||||||
|
friend class SBTarget;
|
||||||
|
|
||||||
|
lldb_private::ProcessLaunchInfo &
|
||||||
|
ref ();
|
||||||
|
|
||||||
|
const lldb_private::ProcessLaunchInfo &
|
||||||
|
ref () const;
|
||||||
|
|
||||||
|
ProcessLaunchInfoSP m_opaque_sp;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lldb
|
||||||
|
|
||||||
|
#endif // LLDB_SBLaunchInfo_h_
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBLineEntry
|
class LLDB_API SBLineEntry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBListener
|
class LLDB_API SBListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBListener ();
|
SBListener ();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBModule
|
class LLDB_API SBModule
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ class SBModule
|
|||||||
/// or "./usr/lib", then the install path will be resolved using
|
/// or "./usr/lib", then the install path will be resolved using
|
||||||
/// the platform's current working directory as the base path.
|
/// the platform's current working directory as the base path.
|
||||||
///
|
///
|
||||||
/// @param[in]
|
/// @param[in] file
|
||||||
/// A file specification object.
|
/// A file specification object.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
@ -318,6 +318,23 @@ class SBModule
|
|||||||
GetVersion (uint32_t *versions,
|
GetVersion (uint32_t *versions,
|
||||||
uint32_t num_versions);
|
uint32_t num_versions);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Get accessor for the symbol file specification.
|
||||||
|
///
|
||||||
|
/// When debugging an object file an additional debug information can
|
||||||
|
/// be provided in separate file. Therefore if you debugging something
|
||||||
|
/// like '/usr/lib/liba.dylib' then debug information can be located
|
||||||
|
/// in folder like '/usr/lib/liba.dylib.dSYM/'.
|
||||||
|
///
|
||||||
|
/// @return
|
||||||
|
/// A const reference to the file specification object.
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
lldb::SBFileSpec
|
||||||
|
GetSymbolFileSpec() const;
|
||||||
|
|
||||||
|
lldb::SBAddress
|
||||||
|
GetObjectFileHeaderAddress() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class SBAddress;
|
friend class SBAddress;
|
||||||
friend class SBFrame;
|
friend class SBFrame;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBModuleSpec
|
class LLDB_API SBModuleSpec
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -12,12 +12,16 @@
|
|||||||
|
|
||||||
#include "lldb/API/SBDefines.h"
|
#include "lldb/API/SBDefines.h"
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
struct PlatformConnectOptions;
|
struct PlatformConnectOptions;
|
||||||
struct PlatformShellCommand;
|
struct PlatformShellCommand;
|
||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBPlatformConnectOptions
|
class SBLaunchInfo;
|
||||||
|
|
||||||
|
class LLDB_API SBPlatformConnectOptions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBPlatformConnectOptions (const char *url);
|
SBPlatformConnectOptions (const char *url);
|
||||||
@ -55,7 +59,7 @@ namespace lldb {
|
|||||||
PlatformConnectOptions *m_opaque_ptr;
|
PlatformConnectOptions *m_opaque_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SBPlatformShellCommand
|
class LLDB_API SBPlatformShellCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBPlatformShellCommand (const char *shell_command);
|
SBPlatformShellCommand (const char *shell_command);
|
||||||
@ -100,7 +104,7 @@ namespace lldb {
|
|||||||
PlatformShellCommand *m_opaque_ptr;
|
PlatformShellCommand *m_opaque_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SBPlatform
|
class LLDB_API SBPlatform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -170,6 +174,12 @@ namespace lldb {
|
|||||||
SBError
|
SBError
|
||||||
Run (SBPlatformShellCommand &shell_command);
|
Run (SBPlatformShellCommand &shell_command);
|
||||||
|
|
||||||
|
SBError
|
||||||
|
Launch (SBLaunchInfo &launch_info);
|
||||||
|
|
||||||
|
SBError
|
||||||
|
Kill (const lldb::pid_t pid);
|
||||||
|
|
||||||
SBError
|
SBError
|
||||||
MakeDirectory (const char *path, uint32_t file_permissions = eFilePermissionsDirectoryDefault);
|
MakeDirectory (const char *path, uint32_t file_permissions = eFilePermissionsDirectoryDefault);
|
||||||
|
|
||||||
@ -190,6 +200,9 @@ namespace lldb {
|
|||||||
void
|
void
|
||||||
SetSP (const lldb::PlatformSP& platform_sp);
|
SetSP (const lldb::PlatformSP& platform_sp);
|
||||||
|
|
||||||
|
SBError
|
||||||
|
ExecuteConnected (const std::function<lldb_private::Error(const lldb::PlatformSP&)>& func);
|
||||||
|
|
||||||
lldb::PlatformSP m_opaque_sp;
|
lldb::PlatformSP m_opaque_sp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,13 +20,13 @@ namespace lldb {
|
|||||||
|
|
||||||
class SBEvent;
|
class SBEvent;
|
||||||
|
|
||||||
class SBProcess
|
class LLDB_API SBProcess
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Broadcaster event bits definitions.
|
/// Broadcaster event bits definitions.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
enum
|
FLAGS_ANONYMOUS_ENUM()
|
||||||
{
|
{
|
||||||
eBroadcastBitStateChanged = (1 << 0),
|
eBroadcastBitStateChanged = (1 << 0),
|
||||||
eBroadcastBitInterrupt = (1 << 1),
|
eBroadcastBitInterrupt = (1 << 1),
|
||||||
@ -229,7 +229,22 @@ class SBProcess
|
|||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
GetStopID(bool include_expression_stops = false);
|
GetStopID(bool include_expression_stops = false);
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Gets the stop event corresponding to stop ID.
|
||||||
|
//
|
||||||
|
/// Note that it wasn't fully implemented and tracks only the stop
|
||||||
|
/// event for the last natural stop ID.
|
||||||
|
///
|
||||||
|
/// @param [in] stop_id
|
||||||
|
/// The ID of the stop event to return.
|
||||||
|
///
|
||||||
|
/// @return
|
||||||
|
/// The stop event corresponding to stop ID.
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
lldb::SBEvent
|
||||||
|
GetStopEventForStopID(uint32_t stop_id);
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
ReadMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);
|
ReadMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);
|
||||||
|
|
||||||
@ -260,6 +275,9 @@ class SBProcess
|
|||||||
|
|
||||||
static lldb::SBProcess
|
static lldb::SBProcess
|
||||||
GetProcessFromEvent (const lldb::SBEvent &event);
|
GetProcessFromEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
|
static bool
|
||||||
|
GetInterruptedFromEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
EventIsProcessEvent (const lldb::SBEvent &event);
|
EventIsProcessEvent (const lldb::SBEvent &event);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBQueue
|
class LLDB_API SBQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBQueue ();
|
SBQueue ();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBQueueItem
|
class LLDB_API SBQueueItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBQueueItem ();
|
SBQueueItem ();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBSection
|
class LLDB_API SBSection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBSourceManager
|
class LLDB_API SBSourceManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBSourceManager (const SBDebugger &debugger);
|
SBSourceManager (const SBDebugger &debugger);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBStream
|
class LLDB_API SBStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBStringList
|
class LLDB_API SBStringList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBSymbol
|
class LLDB_API SBSymbol
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBSymbolContext
|
class LLDB_API SBSymbolContext
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBSymbolContext ();
|
SBSymbolContext ();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBSymbolContextList
|
class LLDB_API SBSymbolContextList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBSymbolContextList ();
|
SBSymbolContextList ();
|
||||||
|
@ -12,9 +12,11 @@
|
|||||||
|
|
||||||
#include "lldb/API/SBDefines.h"
|
#include "lldb/API/SBDefines.h"
|
||||||
#include "lldb/API/SBAddress.h"
|
#include "lldb/API/SBAddress.h"
|
||||||
|
#include "lldb/API/SBAttachInfo.h"
|
||||||
#include "lldb/API/SBBroadcaster.h"
|
#include "lldb/API/SBBroadcaster.h"
|
||||||
#include "lldb/API/SBFileSpec.h"
|
#include "lldb/API/SBFileSpec.h"
|
||||||
#include "lldb/API/SBFileSpecList.h"
|
#include "lldb/API/SBFileSpecList.h"
|
||||||
|
#include "lldb/API/SBLaunchInfo.h"
|
||||||
#include "lldb/API/SBSymbolContextList.h"
|
#include "lldb/API/SBSymbolContextList.h"
|
||||||
#include "lldb/API/SBType.h"
|
#include "lldb/API/SBType.h"
|
||||||
#include "lldb/API/SBValue.h"
|
#include "lldb/API/SBValue.h"
|
||||||
@ -24,295 +26,7 @@ namespace lldb {
|
|||||||
|
|
||||||
class SBPlatform;
|
class SBPlatform;
|
||||||
|
|
||||||
class SBLaunchInfo
|
class LLDB_API SBTarget
|
||||||
{
|
|
||||||
public:
|
|
||||||
SBLaunchInfo (const char **argv);
|
|
||||||
|
|
||||||
~SBLaunchInfo();
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetUserID();
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetGroupID();
|
|
||||||
|
|
||||||
bool
|
|
||||||
UserIDIsValid ();
|
|
||||||
|
|
||||||
bool
|
|
||||||
GroupIDIsValid ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetUserID (uint32_t uid);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetGroupID (uint32_t gid);
|
|
||||||
|
|
||||||
SBFileSpec
|
|
||||||
GetExecutableFile ();
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
/// Set the executable file that will be used to launch the process and
|
|
||||||
/// optionally set it as the first argument in the argument vector.
|
|
||||||
///
|
|
||||||
/// This only needs to be specified if clients wish to carefully control
|
|
||||||
/// the exact path will be used to launch a binary. If you create a
|
|
||||||
/// target with a symlink, that symlink will get resolved in the target
|
|
||||||
/// and the resolved path will get used to launch the process. Calling
|
|
||||||
/// this function can help you still launch your process using the
|
|
||||||
/// path of your choice.
|
|
||||||
///
|
|
||||||
/// If this function is not called prior to launching with
|
|
||||||
/// SBTarget::Launch(...), the target will use the resolved executable
|
|
||||||
/// path that was used to create the target.
|
|
||||||
///
|
|
||||||
/// @param[in] exe_file
|
|
||||||
/// The override path to use when launching the executable.
|
|
||||||
///
|
|
||||||
/// @param[in] add_as_first_arg
|
|
||||||
/// If true, then the path will be inserted into the argument vector
|
|
||||||
/// prior to launching. Otherwise the argument vector will be left
|
|
||||||
/// alone.
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
/// Get the listener that will be used to receive process events.
|
|
||||||
///
|
|
||||||
/// If no listener has been set via a call to
|
|
||||||
/// SBLaunchInfo::SetListener(), then an invalid SBListener will be
|
|
||||||
/// returned (SBListener::IsValid() will return false). If a listener
|
|
||||||
/// has been set, then the valid listener object will be returned.
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
SBListener
|
|
||||||
GetListener ();
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
/// Set the listener that will be used to receive process events.
|
|
||||||
///
|
|
||||||
/// By default the SBDebugger, which has a listener, that the SBTarget
|
|
||||||
/// belongs to will listen for the process events. Calling this function
|
|
||||||
/// allows a different listener to be used to listen for process events.
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SetListener (SBListener &listener);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetNumArguments ();
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetArgumentAtIndex (uint32_t idx);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetArguments (const char **argv, bool append);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetNumEnvironmentEntries ();
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetEnvironmentEntryAtIndex (uint32_t idx);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetEnvironmentEntries (const char **envp, bool append);
|
|
||||||
|
|
||||||
void
|
|
||||||
Clear ();
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetWorkingDirectory () const;
|
|
||||||
|
|
||||||
void
|
|
||||||
SetWorkingDirectory (const char *working_dir);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetLaunchFlags ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetLaunchFlags (uint32_t flags);
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetProcessPluginName ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetProcessPluginName (const char *plugin_name);
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetShell ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetShell (const char * path);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetResumeCount ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetResumeCount (uint32_t c);
|
|
||||||
|
|
||||||
bool
|
|
||||||
AddCloseFileAction (int fd);
|
|
||||||
|
|
||||||
bool
|
|
||||||
AddDuplicateFileAction (int fd, int dup_fd);
|
|
||||||
|
|
||||||
bool
|
|
||||||
AddOpenFileAction (int fd, const char *path, bool read, bool write);
|
|
||||||
|
|
||||||
bool
|
|
||||||
AddSuppressFileAction (int fd, bool read, bool write);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetLaunchEventData (const char *data);
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetLaunchEventData () const;
|
|
||||||
|
|
||||||
bool
|
|
||||||
GetDetachOnError() const;
|
|
||||||
|
|
||||||
void
|
|
||||||
SetDetachOnError(bool enable);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
friend class SBTarget;
|
|
||||||
|
|
||||||
lldb_private::ProcessLaunchInfo &
|
|
||||||
ref ();
|
|
||||||
|
|
||||||
ProcessLaunchInfoSP m_opaque_sp;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SBAttachInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SBAttachInfo ();
|
|
||||||
|
|
||||||
SBAttachInfo (lldb::pid_t pid);
|
|
||||||
|
|
||||||
SBAttachInfo (const char *path, bool wait_for);
|
|
||||||
|
|
||||||
SBAttachInfo (const SBAttachInfo &rhs);
|
|
||||||
|
|
||||||
~SBAttachInfo();
|
|
||||||
|
|
||||||
SBAttachInfo &
|
|
||||||
operator = (const SBAttachInfo &rhs);
|
|
||||||
|
|
||||||
lldb::pid_t
|
|
||||||
GetProcessID ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetProcessID (lldb::pid_t pid);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetExecutable (const char *path);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetExecutable (lldb::SBFileSpec exe_file);
|
|
||||||
|
|
||||||
bool
|
|
||||||
GetWaitForLaunch ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetWaitForLaunch (bool b);
|
|
||||||
|
|
||||||
bool
|
|
||||||
GetIgnoreExisting ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetIgnoreExisting (bool b);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetResumeCount ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetResumeCount (uint32_t c);
|
|
||||||
|
|
||||||
const char *
|
|
||||||
GetProcessPluginName ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetProcessPluginName (const char *plugin_name);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetUserID();
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetGroupID();
|
|
||||||
|
|
||||||
bool
|
|
||||||
UserIDIsValid ();
|
|
||||||
|
|
||||||
bool
|
|
||||||
GroupIDIsValid ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetUserID (uint32_t uid);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetGroupID (uint32_t gid);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetEffectiveUserID();
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
GetEffectiveGroupID();
|
|
||||||
|
|
||||||
bool
|
|
||||||
EffectiveUserIDIsValid ();
|
|
||||||
|
|
||||||
bool
|
|
||||||
EffectiveGroupIDIsValid ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetEffectiveUserID (uint32_t uid);
|
|
||||||
|
|
||||||
void
|
|
||||||
SetEffectiveGroupID (uint32_t gid);
|
|
||||||
|
|
||||||
lldb::pid_t
|
|
||||||
GetParentProcessID ();
|
|
||||||
|
|
||||||
void
|
|
||||||
SetParentProcessID (lldb::pid_t pid);
|
|
||||||
|
|
||||||
bool
|
|
||||||
ParentProcessIDIsValid();
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
/// Get the listener that will be used to receive process events.
|
|
||||||
///
|
|
||||||
/// If no listener has been set via a call to
|
|
||||||
/// SBLaunchInfo::SetListener(), then an invalid SBListener will be
|
|
||||||
/// returned (SBListener::IsValid() will return false). If a listener
|
|
||||||
/// has been set, then the valid listener object will be returned.
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
SBListener
|
|
||||||
GetListener ();
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
/// Set the listener that will be used to receive process events.
|
|
||||||
///
|
|
||||||
/// By default the SBDebugger, which has a listener, that the SBTarget
|
|
||||||
/// belongs to will listen for the process events. Calling this function
|
|
||||||
/// allows a different listener to be used to listen for process events.
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SetListener (SBListener &listener);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
friend class SBTarget;
|
|
||||||
|
|
||||||
lldb_private::ProcessAttachInfo &
|
|
||||||
ref ();
|
|
||||||
|
|
||||||
ProcessAttachInfoSP m_opaque_sp;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SBTarget
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
@ -346,7 +60,19 @@ class SBTarget
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
IsValid() const;
|
IsValid() const;
|
||||||
|
|
||||||
|
static bool
|
||||||
|
EventIsTargetEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
|
static lldb::SBTarget
|
||||||
|
GetTargetFromEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
|
static uint32_t
|
||||||
|
GetNumModulesFromEvent (const lldb::SBEvent &event);
|
||||||
|
|
||||||
|
static lldb::SBModule
|
||||||
|
GetModuleAtIndexFromEvent (const uint32_t idx, const lldb::SBEvent &event);
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
GetBroadcasterClassName ();
|
GetBroadcasterClassName ();
|
||||||
|
|
||||||
@ -432,7 +158,7 @@ class SBTarget
|
|||||||
/// @param[in] stop_at_entry
|
/// @param[in] stop_at_entry
|
||||||
/// If false do not stop the inferior at the entry point.
|
/// If false do not stop the inferior at the entry point.
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error object. Contains the reason if there is some failure.
|
/// An error object. Contains the reason if there is some failure.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -503,7 +229,7 @@ class SBTarget
|
|||||||
/// @param[in] pid
|
/// @param[in] pid
|
||||||
/// The process ID to attach to.
|
/// The process ID to attach to.
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error explaining what went wrong if attach fails.
|
/// An error explaining what went wrong if attach fails.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -537,7 +263,7 @@ class SBTarget
|
|||||||
/// @param[in] wait_for
|
/// @param[in] wait_for
|
||||||
/// If true wait for a new instance of 'name' to be launched.
|
/// If true wait for a new instance of 'name' to be launched.
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error explaining what went wrong if attach fails.
|
/// An error explaining what went wrong if attach fails.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -564,7 +290,7 @@ class SBTarget
|
|||||||
/// @param[in] plugin_name
|
/// @param[in] plugin_name
|
||||||
/// The plugin name to be used; can be NULL.
|
/// The plugin name to be used; can be NULL.
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error explaining what went wrong if the connect fails.
|
/// An error explaining what went wrong if the connect fails.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -923,13 +649,13 @@ class SBTarget
|
|||||||
|
|
||||||
lldb::SBBreakpoint
|
lldb::SBBreakpoint
|
||||||
BreakpointCreateBySourceRegex (const char *source_regex,
|
BreakpointCreateBySourceRegex (const char *source_regex,
|
||||||
const lldb::SBFileSpec &source_file,
|
const SBFileSpec &source_file,
|
||||||
const char *module_name = NULL);
|
const char *module_name = NULL);
|
||||||
|
|
||||||
lldb::SBBreakpoint
|
lldb::SBBreakpoint
|
||||||
BreakpointCreateBySourceRegex (const char *source_regex,
|
BreakpointCreateBySourceRegex (const char *source_regex,
|
||||||
const SBFileSpecList &module_list,
|
const SBFileSpecList &module_list,
|
||||||
const lldb::SBFileSpecList &source_file);
|
const SBFileSpecList &source_file);
|
||||||
|
|
||||||
lldb::SBBreakpoint
|
lldb::SBBreakpoint
|
||||||
BreakpointCreateForException (lldb::LanguageType language,
|
BreakpointCreateForException (lldb::LanguageType language,
|
||||||
@ -1047,6 +773,12 @@ class SBTarget
|
|||||||
|
|
||||||
lldb::addr_t
|
lldb::addr_t
|
||||||
GetStackRedZoneSize();
|
GetStackRedZoneSize();
|
||||||
|
|
||||||
|
lldb::SBLaunchInfo
|
||||||
|
GetLaunchInfo () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetLaunchInfo (const lldb::SBLaunchInfo &launch_info);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class SBAddress;
|
friend class SBAddress;
|
||||||
|
@ -18,7 +18,7 @@ namespace lldb {
|
|||||||
|
|
||||||
class SBFrame;
|
class SBFrame;
|
||||||
|
|
||||||
class SBThread
|
class LLDB_API SBThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBThreadCollection
|
class LLDB_API SBThreadCollection
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBThreadPlan
|
class LLDB_API SBThreadPlan
|
||||||
{
|
{
|
||||||
|
|
||||||
friend class lldb_private::ThreadPlan;
|
friend class lldb_private::ThreadPlan;
|
||||||
|
@ -16,7 +16,7 @@ namespace lldb {
|
|||||||
|
|
||||||
class SBTypeList;
|
class SBTypeList;
|
||||||
|
|
||||||
class SBTypeMember
|
class LLDB_API SBTypeMember
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBTypeMember ();
|
SBTypeMember ();
|
||||||
@ -152,6 +152,9 @@ class SBType
|
|||||||
bool
|
bool
|
||||||
IsArrayType ();
|
IsArrayType ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
IsVectorType ();
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsTypedefType ();
|
IsTypedefType ();
|
||||||
|
|
||||||
@ -175,6 +178,9 @@ class SBType
|
|||||||
|
|
||||||
lldb::SBType
|
lldb::SBType
|
||||||
GetArrayElementType ();
|
GetArrayElementType ();
|
||||||
|
|
||||||
|
lldb::SBType
|
||||||
|
GetVectorElementType ();
|
||||||
|
|
||||||
lldb::SBType
|
lldb::SBType
|
||||||
GetCanonicalType();
|
GetCanonicalType();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeCategory
|
class LLDB_API SBTypeCategory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeEnumMember
|
class LLDB_API SBTypeEnumMember
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBTypeEnumMember ();
|
SBTypeEnumMember ();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeFilter
|
class LLDB_API SBTypeFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeFormat
|
class LLDB_API SBTypeFormat
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeNameSpecifier
|
class LLDB_API SBTypeNameSpecifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#ifndef LLDB_DISABLE_PYTHON
|
#ifndef LLDB_DISABLE_PYTHON
|
||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
class SBTypeSummaryOptions
|
class LLDB_API SBTypeSummaryOptions
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SBTypeSummaryOptions();
|
SBTypeSummaryOptions();
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBTypeSynthetic
|
class LLDB_API SBTypeSynthetic
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBUnixSignals {
|
class LLDB_API SBUnixSignals {
|
||||||
public:
|
public:
|
||||||
SBUnixSignals ();
|
SBUnixSignals ();
|
||||||
|
|
||||||
|
@ -19,10 +19,8 @@ class ValueLocker;
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBValue
|
class LLDB_API SBValue
|
||||||
{
|
{
|
||||||
friend class ValueLocker;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SBValue ();
|
SBValue ();
|
||||||
|
|
||||||
@ -84,6 +82,7 @@ friend class ValueLocker;
|
|||||||
ValueType
|
ValueType
|
||||||
GetValueType ();
|
GetValueType ();
|
||||||
|
|
||||||
|
// If you call this on a newly created ValueObject, it will always return false.
|
||||||
bool
|
bool
|
||||||
GetValueDidChange ();
|
GetValueDidChange ();
|
||||||
|
|
||||||
@ -223,7 +222,7 @@ friend class ValueLocker;
|
|||||||
/// and also if the target can be run to figure out the dynamic
|
/// and also if the target can be run to figure out the dynamic
|
||||||
/// type of the child value.
|
/// type of the child value.
|
||||||
///
|
///
|
||||||
/// @param[in] synthetic_allowed
|
/// @param[in] can_create_synthetic
|
||||||
/// If \b true, then allow child values to be created by index
|
/// If \b true, then allow child values to be created by index
|
||||||
/// for pointers and arrays for indexes that normally wouldn't
|
/// for pointers and arrays for indexes that normally wouldn't
|
||||||
/// be allowed.
|
/// be allowed.
|
||||||
@ -326,6 +325,9 @@ friend class ValueLocker;
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
MightHaveChildren ();
|
MightHaveChildren ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
IsRuntimeSupportValue ();
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
GetNumChildren ();
|
GetNumChildren ();
|
||||||
@ -386,7 +388,7 @@ friend class ValueLocker;
|
|||||||
/// @param[in] write
|
/// @param[in] write
|
||||||
/// Stop when this value is modified
|
/// Stop when this value is modified
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error object. Contains the reason if there is some failure.
|
/// An error object. Contains the reason if there is some failure.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -419,7 +421,7 @@ friend class ValueLocker;
|
|||||||
/// @param[in] write
|
/// @param[in] write
|
||||||
/// Stop when this value is modified
|
/// Stop when this value is modified
|
||||||
///
|
///
|
||||||
/// @param[out]
|
/// @param[out] error
|
||||||
/// An error object. Contains the reason if there is some failure.
|
/// An error object. Contains the reason if there is some failure.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
|
@ -16,7 +16,7 @@ class ValueListImpl;
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBValueList
|
class LLDB_API SBValueList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -0,0 +1,98 @@
|
|||||||
|
//===-- SBVariablesOptions.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLDB_SBVariablesOptions_h_
|
||||||
|
#define LLDB_SBVariablesOptions_h_
|
||||||
|
|
||||||
|
#include "lldb/API/SBDefines.h"
|
||||||
|
|
||||||
|
class VariablesOptionsImpl;
|
||||||
|
|
||||||
|
namespace lldb {
|
||||||
|
|
||||||
|
class LLDB_API SBVariablesOptions
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SBVariablesOptions ();
|
||||||
|
|
||||||
|
SBVariablesOptions (const SBVariablesOptions& options);
|
||||||
|
|
||||||
|
SBVariablesOptions&
|
||||||
|
operator = (const SBVariablesOptions& options);
|
||||||
|
|
||||||
|
~SBVariablesOptions ();
|
||||||
|
|
||||||
|
bool
|
||||||
|
IsValid () const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIncludeArguments () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIncludeArguments (bool);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIncludeLocals () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIncludeLocals (bool);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIncludeStatics () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIncludeStatics (bool);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetInScopeOnly () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetInScopeOnly (bool);
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetIncludeRuntimeSupportValues () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetIncludeRuntimeSupportValues (bool);
|
||||||
|
|
||||||
|
lldb::DynamicValueType
|
||||||
|
GetUseDynamic () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
SetUseDynamic (lldb::DynamicValueType);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
VariablesOptionsImpl *
|
||||||
|
operator->();
|
||||||
|
|
||||||
|
const VariablesOptionsImpl *
|
||||||
|
operator->() const;
|
||||||
|
|
||||||
|
VariablesOptionsImpl *
|
||||||
|
get ();
|
||||||
|
|
||||||
|
VariablesOptionsImpl &
|
||||||
|
ref();
|
||||||
|
|
||||||
|
const VariablesOptionsImpl &
|
||||||
|
ref() const;
|
||||||
|
|
||||||
|
SBVariablesOptions (VariablesOptionsImpl *lldb_object_ptr);
|
||||||
|
|
||||||
|
void
|
||||||
|
SetOptions (VariablesOptionsImpl *lldb_object_ptr);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
std::unique_ptr<VariablesOptionsImpl> m_opaque_ap;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lldb
|
||||||
|
|
||||||
|
#endif // LLDB_SBValue_h_
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace lldb {
|
namespace lldb {
|
||||||
|
|
||||||
class SBWatchpoint
|
class LLDB_API SBWatchpoint
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
//===-- SystemInitializerFull.h ---------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef LLDB_API_SYSTEM_INITIALIZER_FULL_H
|
||||||
|
#define LLDB_API_SYSTEM_INITIALIZER_FULL_H
|
||||||
|
|
||||||
|
#include "lldb/Initialization/SystemInitializerCommon.h"
|
||||||
|
|
||||||
|
namespace lldb_private
|
||||||
|
{
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Initializes lldb.
|
||||||
|
///
|
||||||
|
/// This class is responsible for initializing all of lldb system
|
||||||
|
/// services needed to use the full LLDB application. This class is
|
||||||
|
/// not intended to be used externally, but is instead used
|
||||||
|
/// internally by SBDebugger to initialize the system.
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
class SystemInitializerFull : public SystemInitializerCommon
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SystemInitializerFull();
|
||||||
|
virtual ~SystemInitializerFull();
|
||||||
|
|
||||||
|
void Initialize() override;
|
||||||
|
void Terminate() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void InitializeSWIG();
|
||||||
|
void TerminateSWIG();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -155,6 +155,23 @@ class Breakpoint:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class BreakpointPrecondition
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~BreakpointPrecondition() {}
|
||||||
|
|
||||||
|
virtual bool
|
||||||
|
EvaluatePrecondition(StoppointCallbackContext &context);
|
||||||
|
|
||||||
|
virtual Error
|
||||||
|
ConfigurePrecondition(Args &options);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
DescribePrecondition(Stream &stream, lldb::DescriptionLevel level);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::shared_ptr<BreakpointPrecondition> BreakpointPreconditionSP;
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Destructor.
|
/// Destructor.
|
||||||
///
|
///
|
||||||
@ -665,6 +682,31 @@ class Breakpoint:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Set a pre-condition filter that overrides all user provided filters/callbacks etc.
|
||||||
|
///
|
||||||
|
/// Used to define fancy breakpoints that can do dynamic hit detection without taking up the condition slot -
|
||||||
|
/// which really belongs to the user anyway...
|
||||||
|
///
|
||||||
|
/// The Precondition should not continue the target, it should return true if the condition says to stop and
|
||||||
|
/// false otherwise.
|
||||||
|
///
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
SetPrecondition(BreakpointPreconditionSP precondition_sp)
|
||||||
|
{
|
||||||
|
m_precondition_sp = precondition_sp;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EvaluatePrecondition (StoppointCallbackContext &context);
|
||||||
|
|
||||||
|
BreakpointPreconditionSP
|
||||||
|
GetPrecondition()
|
||||||
|
{
|
||||||
|
return m_precondition_sp;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Target;
|
friend class Target;
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
@ -714,6 +756,19 @@ class Breakpoint:
|
|||||||
bool
|
bool
|
||||||
IgnoreCountShouldStop ();
|
IgnoreCountShouldStop ();
|
||||||
|
|
||||||
|
void
|
||||||
|
IncrementHitCount()
|
||||||
|
{
|
||||||
|
m_hit_count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DecrementHitCount()
|
||||||
|
{
|
||||||
|
assert (m_hit_count > 0);
|
||||||
|
m_hit_count--;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This one should only be used by Target to copy breakpoints from target to target - primarily from the dummy
|
// This one should only be used by Target to copy breakpoints from target to target - primarily from the dummy
|
||||||
// target to prime new targets.
|
// target to prime new targets.
|
||||||
@ -724,16 +779,23 @@ class Breakpoint:
|
|||||||
// For Breakpoint only
|
// For Breakpoint only
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool m_being_created;
|
bool m_being_created;
|
||||||
bool m_hardware; // If this breakpoint is required to use a hardware breakpoint
|
bool m_hardware; // If this breakpoint is required to use a hardware breakpoint
|
||||||
Target &m_target; // The target that holds this breakpoint.
|
Target &m_target; // The target that holds this breakpoint.
|
||||||
std::unordered_set<std::string> m_name_list; // If not empty, this is the name of this breakpoint (many breakpoints can share the same name.)
|
std::unordered_set<std::string> m_name_list; // If not empty, this is the name of this breakpoint (many breakpoints can share the same name.)
|
||||||
lldb::SearchFilterSP m_filter_sp; // The filter that constrains the breakpoint's domain.
|
lldb::SearchFilterSP m_filter_sp; // The filter that constrains the breakpoint's domain.
|
||||||
lldb::BreakpointResolverSP m_resolver_sp; // The resolver that defines this breakpoint.
|
lldb::BreakpointResolverSP m_resolver_sp; // The resolver that defines this breakpoint.
|
||||||
BreakpointOptions m_options; // Settable breakpoint options
|
BreakpointPreconditionSP m_precondition_sp; // The precondition is a breakpoint-level hit filter that can be used
|
||||||
BreakpointLocationList m_locations; // The list of locations currently found for this breakpoint.
|
// to skip certain breakpoint hits. For instance, exception breakpoints
|
||||||
|
// use this to limit the stop to certain exception classes, while leaving
|
||||||
|
// the condition & callback free for user specification.
|
||||||
|
BreakpointOptions m_options; // Settable breakpoint options
|
||||||
|
BreakpointLocationList m_locations; // The list of locations currently found for this breakpoint.
|
||||||
std::string m_kind_description;
|
std::string m_kind_description;
|
||||||
bool m_resolve_indirect_symbols;
|
bool m_resolve_indirect_symbols;
|
||||||
|
uint32_t m_hit_count; // Number of times this breakpoint/watchpoint has been hit. This is kept
|
||||||
|
// separately from the locations hit counts, since locations can go away when
|
||||||
|
// their backing library gets unloaded, and we would lose hit counts.
|
||||||
|
|
||||||
void
|
void
|
||||||
SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind);
|
SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind);
|
||||||
|
|
||||||
|
@ -21,11 +21,8 @@
|
|||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-private.h"
|
||||||
#include "lldb/Breakpoint/StoppointLocation.h"
|
#include "lldb/Breakpoint/StoppointLocation.h"
|
||||||
#include "lldb/Core/Address.h"
|
#include "lldb/Core/Address.h"
|
||||||
#include "lldb/Core/StringList.h"
|
|
||||||
#include "lldb/Core/UserID.h"
|
#include "lldb/Core/UserID.h"
|
||||||
#include "lldb/Host/Mutex.h"
|
#include "lldb/Host/Mutex.h"
|
||||||
#include "lldb/Target/Process.h"
|
|
||||||
#include "lldb/Expression/ClangUserExpression.h"
|
|
||||||
|
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
|
|
||||||
@ -390,6 +387,7 @@ class BreakpointLocation :
|
|||||||
friend class BreakpointSite;
|
friend class BreakpointSite;
|
||||||
friend class BreakpointLocationList;
|
friend class BreakpointLocationList;
|
||||||
friend class Process;
|
friend class Process;
|
||||||
|
friend class StopInfoBreakpoint;
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Set the breakpoint site for this location to \a bp_site_sp.
|
/// Set the breakpoint site for this location to \a bp_site_sp.
|
||||||
@ -417,6 +415,9 @@ class BreakpointLocation :
|
|||||||
void
|
void
|
||||||
BumpHitCount();
|
BumpHitCount();
|
||||||
|
|
||||||
|
void
|
||||||
|
UndoBumpHitCount();
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Constructors and Destructors
|
// Constructors and Destructors
|
||||||
@ -460,7 +461,7 @@ class BreakpointLocation :
|
|||||||
Breakpoint &m_owner; ///< The breakpoint that produced this object.
|
Breakpoint &m_owner; ///< The breakpoint that produced this object.
|
||||||
std::unique_ptr<BreakpointOptions> m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options.
|
std::unique_ptr<BreakpointOptions> m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options.
|
||||||
lldb::BreakpointSiteSP m_bp_site_sp; ///< Our breakpoint site (it may be shared by more than one location.)
|
lldb::BreakpointSiteSP m_bp_site_sp; ///< Our breakpoint site (it may be shared by more than one location.)
|
||||||
ClangUserExpression::ClangUserExpressionSP m_user_expression_sp; ///< The compiled expression to use in testing our condition.
|
lldb::ClangUserExpressionSP m_user_expression_sp; ///< The compiled expression to use in testing our condition.
|
||||||
Mutex m_condition_mutex; ///< Guards parsing and evaluation of the condition, which could be evaluated by multiple processes.
|
Mutex m_condition_mutex; ///< Guards parsing and evaluation of the condition, which could be evaluated by multiple processes.
|
||||||
size_t m_condition_hash; ///< For testing whether the condition source code changed.
|
size_t m_condition_hash; ///< For testing whether the condition source code changed.
|
||||||
|
|
||||||
|
@ -89,6 +89,9 @@ class BreakpointOptions
|
|||||||
// callback.
|
// callback.
|
||||||
// Asynchronous callbacks get run as part of the "ShouldStop" logic in the thread plan. The logic there is:
|
// Asynchronous callbacks get run as part of the "ShouldStop" logic in the thread plan. The logic there is:
|
||||||
// a) If the breakpoint is thread specific and not for this thread, continue w/o running the callback.
|
// a) If the breakpoint is thread specific and not for this thread, continue w/o running the callback.
|
||||||
|
// NB. This is actually enforced underneath the breakpoint system, the Process plugin is expected to
|
||||||
|
// call BreakpointSite::IsValidForThread, and set the thread's StopInfo to "no reason". That way,
|
||||||
|
// thread displays won't show stops for breakpoints not for that thread...
|
||||||
// b) If the ignore count says we shouldn't stop, then ditto.
|
// b) If the ignore count says we shouldn't stop, then ditto.
|
||||||
// c) If the condition says we shouldn't stop, then ditto.
|
// c) If the condition says we shouldn't stop, then ditto.
|
||||||
// d) Otherwise, the callback will get run, and if it returns true we will stop, and if false we won't.
|
// d) Otherwise, the callback will get run, and if it returns true we will stop, and if false we won't.
|
||||||
|
@ -32,7 +32,8 @@ class BreakpointResolverFileLine :
|
|||||||
const FileSpec &resolver,
|
const FileSpec &resolver,
|
||||||
uint32_t line_no,
|
uint32_t line_no,
|
||||||
bool check_inlines,
|
bool check_inlines,
|
||||||
bool skip_prologue);
|
bool skip_prologue,
|
||||||
|
bool exact_match);
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~BreakpointResolverFileLine ();
|
~BreakpointResolverFileLine ();
|
||||||
@ -67,6 +68,7 @@ class BreakpointResolverFileLine :
|
|||||||
uint32_t m_line_number; // This is the line number that we are looking for.
|
uint32_t m_line_number; // This is the line number that we are looking for.
|
||||||
bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
|
bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
|
||||||
bool m_skip_prologue;
|
bool m_skip_prologue;
|
||||||
|
bool m_exact_match;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
|
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
|
||||||
|
@ -29,7 +29,8 @@ class BreakpointResolverFileRegex :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BreakpointResolverFileRegex (Breakpoint *bkpt,
|
BreakpointResolverFileRegex (Breakpoint *bkpt,
|
||||||
RegularExpression ®ex);
|
RegularExpression ®ex,
|
||||||
|
bool exact_match);
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~BreakpointResolverFileRegex ();
|
~BreakpointResolverFileRegex ();
|
||||||
@ -61,6 +62,7 @@ class BreakpointResolverFileRegex :
|
|||||||
protected:
|
protected:
|
||||||
friend class Breakpoint;
|
friend class Breakpoint;
|
||||||
RegularExpression m_regex; // This is the line expression that we are looking for.
|
RegularExpression m_regex; // This is the line expression that we are looking for.
|
||||||
|
bool m_exact_match;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
|
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileRegex);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
// Other libraries and framework includes
|
// Other libraries and framework includes
|
||||||
|
|
||||||
// Project includes
|
// Project includes
|
||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-forward.h"
|
||||||
#include "lldb/Host/Mutex.h"
|
#include "lldb/Host/Mutex.h"
|
||||||
#include "lldb/Core/UserID.h"
|
#include "lldb/Core/UserID.h"
|
||||||
#include "lldb/Breakpoint/StoppointLocation.h"
|
#include "lldb/Breakpoint/StoppointLocation.h"
|
||||||
|
@ -134,6 +134,9 @@ class StoppointLocation
|
|||||||
++m_hit_count;
|
++m_hit_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DecrementHitCount ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// For StoppointLocation only
|
// For StoppointLocation only
|
||||||
|
@ -20,10 +20,11 @@
|
|||||||
|
|
||||||
// Project includes
|
// Project includes
|
||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-private.h"
|
||||||
#include "lldb/Target/Target.h"
|
|
||||||
#include "lldb/Core/UserID.h"
|
|
||||||
#include "lldb/Breakpoint/WatchpointOptions.h"
|
#include "lldb/Breakpoint/WatchpointOptions.h"
|
||||||
#include "lldb/Breakpoint/StoppointLocation.h"
|
#include "lldb/Breakpoint/StoppointLocation.h"
|
||||||
|
#include "lldb/Core/UserID.h"
|
||||||
|
#include "lldb/Symbol/ClangASTType.h"
|
||||||
|
#include "lldb/Target/Target.h"
|
||||||
|
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
|
|
||||||
@ -205,7 +206,18 @@ class Watchpoint :
|
|||||||
friend class Target;
|
friend class Target;
|
||||||
friend class WatchpointList;
|
friend class WatchpointList;
|
||||||
|
|
||||||
void ResetHitCount() { m_hit_count = 0; }
|
void
|
||||||
|
ResetHitCount ()
|
||||||
|
{
|
||||||
|
m_hit_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ResetHistoricValues ()
|
||||||
|
{
|
||||||
|
m_old_value_sp.reset(nullptr);
|
||||||
|
m_new_value_sp.reset(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
Target &m_target;
|
Target &m_target;
|
||||||
bool m_enabled; // Is this watchpoint enabled
|
bool m_enabled; // Is this watchpoint enabled
|
||||||
|
@ -88,6 +88,8 @@ class Address
|
|||||||
///< if the address is in a section (section of pointers, c strings, etc).
|
///< if the address is in a section (section of pointers, c strings, etc).
|
||||||
DumpStyleResolvedDescriptionNoModule,
|
DumpStyleResolvedDescriptionNoModule,
|
||||||
DumpStyleResolvedDescriptionNoFunctionArguments,
|
DumpStyleResolvedDescriptionNoFunctionArguments,
|
||||||
|
DumpStyleNoFunctionName, ///< Elide the function name; display an offset into the current function.
|
||||||
|
///< Used primarily in disassembly symbolication
|
||||||
DumpStyleDetailedSymbolContext, ///< Detailed symbol context information for an address for all symbol
|
DumpStyleDetailedSymbolContext, ///< Detailed symbol context information for an address for all symbol
|
||||||
///< context members.
|
///< context members.
|
||||||
DumpStyleResolvedPointerDescription ///< Dereference a pointer at the current address and then lookup the
|
DumpStyleResolvedPointerDescription ///< Dereference a pointer at the current address and then lookup the
|
||||||
|
@ -12,9 +12,8 @@
|
|||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-forward.h"
|
||||||
#include "lldb/Core/ConstString.h"
|
#include "lldb/Core/ConstString.h"
|
||||||
#include "llvm/ADT/StringRef.h"
|
|
||||||
#include "llvm/ADT/Triple.h"
|
#include "llvm/ADT/Triple.h"
|
||||||
|
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
@ -33,6 +32,23 @@ struct CoreDefinition;
|
|||||||
class ArchSpec
|
class ArchSpec
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum MIPSSubType
|
||||||
|
{
|
||||||
|
eMIPSSubType_unknown,
|
||||||
|
eMIPSSubType_mips32,
|
||||||
|
eMIPSSubType_mips32r2,
|
||||||
|
eMIPSSubType_mips32r6,
|
||||||
|
eMIPSSubType_mips32el,
|
||||||
|
eMIPSSubType_mips32r2el,
|
||||||
|
eMIPSSubType_mips32r6el,
|
||||||
|
eMIPSSubType_mips64,
|
||||||
|
eMIPSSubType_mips64r2,
|
||||||
|
eMIPSSubType_mips64r6,
|
||||||
|
eMIPSSubType_mips64el,
|
||||||
|
eMIPSSubType_mips64r2el,
|
||||||
|
eMIPSSubType_mips64r6el,
|
||||||
|
};
|
||||||
|
|
||||||
enum Core
|
enum Core
|
||||||
{
|
{
|
||||||
eCore_arm_generic,
|
eCore_arm_generic,
|
||||||
@ -66,8 +82,27 @@ class ArchSpec
|
|||||||
eCore_arm_arm64,
|
eCore_arm_arm64,
|
||||||
eCore_arm_armv8,
|
eCore_arm_armv8,
|
||||||
eCore_arm_aarch64,
|
eCore_arm_aarch64,
|
||||||
|
|
||||||
|
eCore_mips32,
|
||||||
|
eCore_mips32r2,
|
||||||
|
eCore_mips32r3,
|
||||||
|
eCore_mips32r5,
|
||||||
|
eCore_mips32r6,
|
||||||
|
eCore_mips32el,
|
||||||
|
eCore_mips32r2el,
|
||||||
|
eCore_mips32r3el,
|
||||||
|
eCore_mips32r5el,
|
||||||
|
eCore_mips32r6el,
|
||||||
eCore_mips64,
|
eCore_mips64,
|
||||||
|
eCore_mips64r2,
|
||||||
|
eCore_mips64r3,
|
||||||
|
eCore_mips64r5,
|
||||||
|
eCore_mips64r6,
|
||||||
|
eCore_mips64el,
|
||||||
|
eCore_mips64r2el,
|
||||||
|
eCore_mips64r3el,
|
||||||
|
eCore_mips64r5el,
|
||||||
|
eCore_mips64r6el,
|
||||||
|
|
||||||
eCore_ppc_generic,
|
eCore_ppc_generic,
|
||||||
eCore_ppc_ppc601,
|
eCore_ppc_ppc601,
|
||||||
@ -142,7 +177,19 @@ class ArchSpec
|
|||||||
kCore_hexagon_last = eCore_hexagon_hexagonv5,
|
kCore_hexagon_last = eCore_hexagon_hexagonv5,
|
||||||
|
|
||||||
kCore_kalimba_first = eCore_kalimba3,
|
kCore_kalimba_first = eCore_kalimba3,
|
||||||
kCore_kalimba_last = eCore_kalimba5
|
kCore_kalimba_last = eCore_kalimba5,
|
||||||
|
|
||||||
|
kCore_mips32_first = eCore_mips32,
|
||||||
|
kCore_mips32_last = eCore_mips32r6,
|
||||||
|
|
||||||
|
kCore_mips32el_first = eCore_mips32el,
|
||||||
|
kCore_mips32el_last = eCore_mips32r6el,
|
||||||
|
|
||||||
|
kCore_mips64_first = eCore_mips64,
|
||||||
|
kCore_mips64_last = eCore_mips64r6,
|
||||||
|
|
||||||
|
kCore_mips64el_first = eCore_mips64el,
|
||||||
|
kCore_mips64el_last = eCore_mips64r6el
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread &thread);
|
typedef void (* StopInfoOverrideCallbackType)(lldb_private::Thread &thread);
|
||||||
@ -277,56 +324,61 @@ class ArchSpec
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Sets this ArchSpec according to the given architecture name.
|
/// Merges fields from another ArchSpec into this ArchSpec.
|
||||||
///
|
///
|
||||||
/// The architecture name can be one of the generic system default
|
/// This will use the supplied ArchSpec to fill in any fields of
|
||||||
/// values:
|
/// the triple in this ArchSpec which were unspecified. This can
|
||||||
|
/// be used to refine a generic ArchSpec with a more specific one.
|
||||||
|
/// For example, if this ArchSpec's triple is something like
|
||||||
|
/// i386-unknown-unknown-unknown, and we have a triple which is
|
||||||
|
/// x64-pc-windows-msvc, then merging that triple into this one
|
||||||
|
/// will result in the triple i386-pc-windows-msvc.
|
||||||
///
|
///
|
||||||
/// @li \c LLDB_ARCH_DEFAULT - The arch the current system defaults
|
|
||||||
/// to when a program is launched without any extra
|
|
||||||
/// attributes or settings.
|
|
||||||
/// @li \c LLDB_ARCH_DEFAULT_32BIT - The default host architecture
|
|
||||||
/// for 32 bit (if any).
|
|
||||||
/// @li \c LLDB_ARCH_DEFAULT_64BIT - The default host architecture
|
|
||||||
/// for 64 bit (if any).
|
|
||||||
///
|
|
||||||
/// Alternatively, if the object type of this ArchSpec has been
|
|
||||||
/// configured, a concrete architecture can be specified to set
|
|
||||||
/// the CPU type ("x86_64" for example).
|
|
||||||
///
|
|
||||||
/// Finally, an encoded object and archetecture format is accepted.
|
|
||||||
/// The format contains an object type (like "macho" or "elf"),
|
|
||||||
/// followed by a platform dependent encoding of CPU type and
|
|
||||||
/// subtype. For example:
|
|
||||||
///
|
|
||||||
/// "macho" : Specifies an object type of MachO.
|
|
||||||
/// "macho-16-6" : MachO specific encoding for ARMv6.
|
|
||||||
/// "elf-43 : ELF specific encoding for Sparc V9.
|
|
||||||
///
|
|
||||||
/// @param[in] arch_name The name of an architecture.
|
|
||||||
///
|
|
||||||
/// @return True if @p arch_name was successfully translated, false
|
|
||||||
/// otherwise.
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// bool
|
void
|
||||||
// SetArchitecture (const llvm::StringRef& arch_name);
|
MergeFrom(const ArchSpec &other);
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// SetArchitecture (const char *arch_name);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Change the architecture object type and CPU type.
|
/// Change the architecture object type, CPU type and OS type.
|
||||||
///
|
///
|
||||||
/// @param[in] arch_type The object type of this ArchSpec.
|
/// @param[in] arch_type The object type of this ArchSpec.
|
||||||
///
|
///
|
||||||
/// @param[in] cpu The required CPU type.
|
/// @param[in] cpu The required CPU type.
|
||||||
///
|
///
|
||||||
/// @return True if the object and CPU type were successfully set.
|
/// @param[in] os The optional OS type
|
||||||
|
/// The default value of 0 was choosen to from the ELF spec value
|
||||||
|
/// ELFOSABI_NONE. ELF is the only one using this parameter. If another
|
||||||
|
/// format uses this parameter and 0 does not work, use a value over
|
||||||
|
/// 255 because in the ELF header this is value is only a byte.
|
||||||
|
///
|
||||||
|
/// @return True if the object, and CPU were successfully set.
|
||||||
|
///
|
||||||
|
/// As a side effect, the vendor value is usually set to unknown.
|
||||||
|
/// The exections are
|
||||||
|
/// aarch64-apple-ios
|
||||||
|
/// arm-apple-ios
|
||||||
|
/// thumb-apple-ios
|
||||||
|
/// x86-apple-
|
||||||
|
/// x86_64-apple-
|
||||||
|
///
|
||||||
|
/// As a side effect, the os value is usually set to unknown
|
||||||
|
/// The exceptions are
|
||||||
|
/// *-*-aix
|
||||||
|
/// aarch64-apple-ios
|
||||||
|
/// arm-apple-ios
|
||||||
|
/// thumb-apple-ios
|
||||||
|
/// powerpc-apple-darwin
|
||||||
|
/// *-*-freebsd
|
||||||
|
/// *-*-linux
|
||||||
|
/// *-*-netbsd
|
||||||
|
/// *-*-openbsd
|
||||||
|
/// *-*-solaris
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
SetArchitecture (ArchitectureType arch_type,
|
SetArchitecture (ArchitectureType arch_type,
|
||||||
uint32_t cpu,
|
uint32_t cpu,
|
||||||
uint32_t sub);
|
uint32_t sub,
|
||||||
|
uint32_t os = 0);
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Returns the byte order for the architecture specification.
|
/// Returns the byte order for the architecture specification.
|
||||||
@ -441,8 +493,18 @@ class ArchSpec
|
|||||||
GetDefaultEndian () const;
|
GetDefaultEndian () const;
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Compare an ArchSpec to another ArchSpec, requiring an exact cpu
|
/// Returns true if 'char' is a signed type by defualt in the
|
||||||
/// type match between them.
|
/// architecture false otherwise
|
||||||
|
///
|
||||||
|
/// @return True if 'char' is a signed type by default on the
|
||||||
|
/// architecture and false otherwise.
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
bool
|
||||||
|
CharIsSignedByDefault () const;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Compare an ArchSpec to another ArchSpec, requiring an exact cpu
|
||||||
|
/// type match between them.
|
||||||
/// e.g. armv7s is not an exact match with armv7 - this would return false
|
/// e.g. armv7s is not an exact match with armv7 - this would return false
|
||||||
///
|
///
|
||||||
/// @return true if the two ArchSpecs match.
|
/// @return true if the two ArchSpecs match.
|
||||||
|
@ -419,12 +419,7 @@ class Broadcaster
|
|||||||
HijackBroadcaster (Listener *listener, uint32_t event_mask = UINT32_MAX);
|
HijackBroadcaster (Listener *listener, uint32_t event_mask = UINT32_MAX);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsHijackedForEvent (uint32_t event_mask)
|
IsHijackedForEvent (uint32_t event_mask);
|
||||||
{
|
|
||||||
if (m_hijacking_listeners.size() > 0)
|
|
||||||
return (event_mask & m_hijacking_masks.back()) != 0;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Restore the state of the Broadcaster from a previous hijack attempt.
|
/// Restore the state of the Broadcaster from a previous hijack attempt.
|
||||||
|
@ -72,11 +72,14 @@ namespace clang
|
|||||||
class FunctionTemplateSpecializationInfo;
|
class FunctionTemplateSpecializationInfo;
|
||||||
class GotoStmt;
|
class GotoStmt;
|
||||||
class HeaderSearchOptions;
|
class HeaderSearchOptions;
|
||||||
|
class IdentifierInfo;
|
||||||
class IdentifierTable;
|
class IdentifierTable;
|
||||||
class IntegerLiteral;
|
class IntegerLiteral;
|
||||||
class LabelStmt;
|
class LabelStmt;
|
||||||
class LangOptions;
|
class LangOptions;
|
||||||
|
class MacroDirective;
|
||||||
class MemberExpr;
|
class MemberExpr;
|
||||||
|
class Module;
|
||||||
class NamedDecl;
|
class NamedDecl;
|
||||||
class NamespaceDecl;
|
class NamespaceDecl;
|
||||||
class NonTypeTemplateParmDecl;
|
class NonTypeTemplateParmDecl;
|
||||||
|
@ -85,14 +85,16 @@ namespace lldb_private {
|
|||||||
class Communication : public Broadcaster
|
class Communication : public Broadcaster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum {
|
FLAGS_ANONYMOUS_ENUM()
|
||||||
eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
|
{
|
||||||
eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
|
eBroadcastBitDisconnected = (1u << 0), ///< Sent when the communications connection is lost.
|
||||||
eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
|
eBroadcastBitReadThreadGotBytes = (1u << 1), ///< Sent by the read thread when bytes become available.
|
||||||
eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread.
|
eBroadcastBitReadThreadDidExit = (1u << 2), ///< Sent by the read thread when it exits to inform clients.
|
||||||
eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet.
|
eBroadcastBitReadThreadShouldExit = (1u << 3), ///< Sent by clients that need to cancel the read thread.
|
||||||
kLoUserBroadcastBit = (1 << 16),///< Subclasses can used bits 31:16 for any needed events.
|
eBroadcastBitPacketAvailable = (1u << 4), ///< Sent when data received makes a complete packet.
|
||||||
kHiUserBroadcastBit = (1 << 31),
|
eBroadcastBitNoMorePendingInput = (1u << 5), ///< Sent by the read thread to indicate all pending input has been processed.
|
||||||
|
kLoUserBroadcastBit = (1u << 16),///< Subclasses can used bits 31:16 for any needed events.
|
||||||
|
kHiUserBroadcastBit = (1u << 31),
|
||||||
eAllEventBits = 0xffffffff
|
eAllEventBits = 0xffffffff
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -321,6 +323,16 @@ class Communication : public Broadcaster
|
|||||||
SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback,
|
SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback,
|
||||||
void *callback_baton);
|
void *callback_baton);
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Wait for the read thread to process all outstanding data.
|
||||||
|
///
|
||||||
|
/// After this function returns, the read thread has processed all data that
|
||||||
|
/// has been waiting in the Connection queue.
|
||||||
|
///
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
void SynchronizeWithReadThread ();
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
ConnectionStatusAsCString (lldb::ConnectionStatus status);
|
ConnectionStatusAsCString (lldb::ConnectionStatus status);
|
||||||
|
|
||||||
@ -354,9 +366,11 @@ class Communication : public Broadcaster
|
|||||||
lldb::ConnectionSP m_connection_sp; ///< The connection that is current in use by this communications class.
|
lldb::ConnectionSP m_connection_sp; ///< The connection that is current in use by this communications class.
|
||||||
HostThread m_read_thread; ///< The read thread handle in case we need to cancel the thread.
|
HostThread m_read_thread; ///< The read thread handle in case we need to cancel the thread.
|
||||||
std::atomic<bool> m_read_thread_enabled;
|
std::atomic<bool> m_read_thread_enabled;
|
||||||
|
std::atomic<bool> m_read_thread_did_exit;
|
||||||
std::string m_bytes; ///< A buffer to cache bytes read in the ReadThread function.
|
std::string m_bytes; ///< A buffer to cache bytes read in the ReadThread function.
|
||||||
Mutex m_bytes_mutex; ///< A mutex to protect multi-threaded access to the cached bytes.
|
Mutex m_bytes_mutex; ///< A mutex to protect multi-threaded access to the cached bytes.
|
||||||
Mutex m_write_mutex; ///< Don't let multiple threads write at the same time...
|
Mutex m_write_mutex; ///< Don't let multiple threads write at the same time...
|
||||||
|
Mutex m_synchronize_mutex;
|
||||||
ReadThreadBytesReceived m_callback;
|
ReadThreadBytesReceived m_callback;
|
||||||
void *m_callback_baton;
|
void *m_callback_baton;
|
||||||
bool m_close_on_eof;
|
bool m_close_on_eof;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
// C Includes
|
// C Includes
|
||||||
// C++ Includes
|
// C++ Includes
|
||||||
|
#include <string>
|
||||||
// Other libraries and framework includes
|
// Other libraries and framework includes
|
||||||
// Project includes
|
// Project includes
|
||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-private.h"
|
||||||
@ -110,6 +111,13 @@ class Connection
|
|||||||
/// The number of bytes to attempt to read, and also the max
|
/// The number of bytes to attempt to read, and also the max
|
||||||
/// number of bytes that can be placed into \a dst.
|
/// number of bytes that can be placed into \a dst.
|
||||||
///
|
///
|
||||||
|
/// @param[in] timeout_usec
|
||||||
|
/// The number of microseconds to wait for the data.
|
||||||
|
///
|
||||||
|
/// @param[out] status
|
||||||
|
/// On return, indicates whether the call was sucessful or terminated
|
||||||
|
/// due to some error condition.
|
||||||
|
///
|
||||||
/// @param[out] error_ptr
|
/// @param[out] error_ptr
|
||||||
/// A pointer to an error object that should be given an
|
/// A pointer to an error object that should be given an
|
||||||
/// approriate error value if this method returns zero. This
|
/// approriate error value if this method returns zero. This
|
||||||
@ -133,13 +141,13 @@ class Connection
|
|||||||
///
|
///
|
||||||
/// Subclasses must override this function.
|
/// Subclasses must override this function.
|
||||||
///
|
///
|
||||||
/// @param[in] src
|
/// @param[in] dst
|
||||||
/// A source buffer that must be at least \a src_len bytes
|
/// A desination buffer that must be at least \a dst_len bytes
|
||||||
/// long.
|
/// long.
|
||||||
///
|
///
|
||||||
/// @param[in] src_len
|
/// @param[in] dst_len
|
||||||
/// The number of bytes to attempt to write, and also the
|
/// The number of bytes to attempt to write, and also the
|
||||||
/// number of bytes are currently available in \a src.
|
/// number of bytes are currently available in \a dst.
|
||||||
///
|
///
|
||||||
/// @param[out] error_ptr
|
/// @param[out] error_ptr
|
||||||
/// A pointer to an error object that should be given an
|
/// A pointer to an error object that should be given an
|
||||||
@ -150,7 +158,34 @@ class Connection
|
|||||||
/// The number of bytes actually Written.
|
/// The number of bytes actually Written.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
virtual size_t
|
virtual size_t
|
||||||
Write (const void *buffer, size_t length, lldb::ConnectionStatus &status, Error *error_ptr) = 0;
|
Write (const void *dst, size_t dst_len, lldb::ConnectionStatus &status, Error *error_ptr) = 0;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Returns a URI that describes this connection object
|
||||||
|
///
|
||||||
|
/// Subclasses may override this function.
|
||||||
|
///
|
||||||
|
/// @return
|
||||||
|
/// Returns URI or an empty string if disconnecteds
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
virtual std::string
|
||||||
|
GetURI() = 0;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
/// Interrupts an ongoing Read() operation.
|
||||||
|
///
|
||||||
|
/// If there is an ongoing read operation in another thread, this operation
|
||||||
|
/// return with status == eConnectionStatusInterrupted. Note that if there
|
||||||
|
/// data waiting to be read and an interrupt request is issued, the Read()
|
||||||
|
/// function will return the data immediately without processing the
|
||||||
|
/// interrupt request (which will remain queued for the next Read()
|
||||||
|
/// operation).
|
||||||
|
///
|
||||||
|
/// @return
|
||||||
|
/// Returns true is the interrupt request was sucessful.
|
||||||
|
//------------------------------------------------------------------
|
||||||
|
virtual bool
|
||||||
|
InterruptRead() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
@ -56,6 +56,9 @@ class ConnectionMachPort :
|
|||||||
lldb::ConnectionStatus &status,
|
lldb::ConnectionStatus &status,
|
||||||
lldb_private::Error *error_ptr);
|
lldb_private::Error *error_ptr);
|
||||||
|
|
||||||
|
virtual std::string
|
||||||
|
GetURI();
|
||||||
|
|
||||||
lldb::ConnectionStatus
|
lldb::ConnectionStatus
|
||||||
BootstrapCheckIn (const char *port_name,
|
BootstrapCheckIn (const char *port_name,
|
||||||
lldb_private::Error *error_ptr);
|
lldb_private::Error *error_ptr);
|
||||||
@ -83,6 +86,7 @@ class ConnectionMachPort :
|
|||||||
mach_port_t m_port;
|
mach_port_t m_port;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string m_uri;
|
||||||
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN (ConnectionMachPort);
|
DISALLOW_COPY_AND_ASSIGN (ConnectionMachPort);
|
||||||
|
@ -53,6 +53,9 @@ class ConnectionSharedMemory :
|
|||||||
virtual size_t
|
virtual size_t
|
||||||
Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr);
|
Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr);
|
||||||
|
|
||||||
|
virtual std::string
|
||||||
|
GetURI();
|
||||||
|
|
||||||
lldb::ConnectionStatus
|
lldb::ConnectionStatus
|
||||||
Open (bool create, const char *name, size_t size, Error *error_ptr);
|
Open (bool create, const char *name, size_t size, Error *error_ptr);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ class ConstString
|
|||||||
const char *
|
const char *
|
||||||
AsCString(const char *value_if_empty = NULL) const
|
AsCString(const char *value_if_empty = NULL) const
|
||||||
{
|
{
|
||||||
if (m_string == NULL)
|
if (IsEmpty())
|
||||||
return value_if_empty;
|
return value_if_empty;
|
||||||
return m_string;
|
return m_string;
|
||||||
}
|
}
|
||||||
|
21
contrib/llvm/tools/lldb/include/lldb/Core/CxaDemangle.h
Normal file
21
contrib/llvm/tools/lldb/include/lldb/Core/CxaDemangle.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
//===-- CxaDemangle.h -------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef liblldb_CxaDemangle_h_
|
||||||
|
#define liblldb_CxaDemangle_h_
|
||||||
|
|
||||||
|
namespace lldb_private
|
||||||
|
{
|
||||||
|
|
||||||
|
char*
|
||||||
|
__cxa_demangle(const char* mangled_name, char* buf, size_t* n, int* status);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -357,7 +357,7 @@ class DataEncoder
|
|||||||
/// The number of bytes that this object now contains.
|
/// The number of bytes that this object now contains.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
uint32_t
|
uint32_t
|
||||||
SetData (const void *bytes, uint32_t length, lldb::ByteOrder byte_order);
|
SetData (void *bytes, uint32_t length, lldb::ByteOrder byte_order);
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Adopt a subset of shared data in \a data_sp.
|
/// Adopt a subset of shared data in \a data_sp.
|
||||||
@ -446,7 +446,7 @@ class DataEncoder
|
|||||||
uint8_t *m_end; ///< A pointer to the byte that is past the end of the data.
|
uint8_t *m_end; ///< A pointer to the byte that is past the end of the data.
|
||||||
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
|
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
|
||||||
uint8_t m_addr_size; ///< The address size to use when extracting pointers or addresses
|
uint8_t m_addr_size; ///< The address size to use when extracting pointers or addresses
|
||||||
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances
|
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multiple instances
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN (DataEncoder);
|
DISALLOW_COPY_AND_ASSIGN (DataEncoder);
|
||||||
|
@ -234,7 +234,7 @@ class DataExtractor
|
|||||||
/// bytes into the contained data, into the stream \a s. \a
|
/// bytes into the contained data, into the stream \a s. \a
|
||||||
/// num_per_line objects will be dumped on each line before a new
|
/// num_per_line objects will be dumped on each line before a new
|
||||||
/// line will be output. If \a base_addr is a valid address, then
|
/// line will be output. If \a base_addr is a valid address, then
|
||||||
/// each new line of output will be prededed by the address value
|
/// each new line of output will be preceded by the address value
|
||||||
/// plus appropriate offset, and a colon and space. Bitfield values
|
/// plus appropriate offset, and a colon and space. Bitfield values
|
||||||
/// can be dumped by calling this function multiple times with the
|
/// can be dumped by calling this function multiple times with the
|
||||||
/// same start offset, format and size, yet differing \a
|
/// same start offset, format and size, yet differing \a
|
||||||
@ -574,7 +574,7 @@ class DataExtractor
|
|||||||
GetSharedDataOffset () const;
|
GetSharedDataOffset () const;
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Get a the data start pointer.
|
/// Get the data start pointer.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
/// Returns a pointer to the first byte contained in this
|
/// Returns a pointer to the first byte contained in this
|
||||||
@ -908,7 +908,7 @@ class DataExtractor
|
|||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
/// \a dst if all values were properly extracted and copied,
|
/// \a dst if all values were properly extracted and copied,
|
||||||
/// NULL otherise.
|
/// NULL otherwise.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void *
|
void *
|
||||||
GetU8 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
GetU8 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
||||||
@ -955,7 +955,7 @@ class DataExtractor
|
|||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
/// \a dst if all values were properly extracted and copied,
|
/// \a dst if all values were properly extracted and copied,
|
||||||
/// NULL otherise.
|
/// NULL otherwise.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void *
|
void *
|
||||||
GetU16 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
GetU16 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
||||||
@ -1002,7 +1002,7 @@ class DataExtractor
|
|||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
/// \a dst if all values were properly extracted and copied,
|
/// \a dst if all values were properly extracted and copied,
|
||||||
/// NULL otherise.
|
/// NULL otherwise.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void *
|
void *
|
||||||
GetU32 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
GetU32 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
||||||
@ -1049,7 +1049,7 @@ class DataExtractor
|
|||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
/// \a dst if all values were properly extracted and copied,
|
/// \a dst if all values were properly extracted and copied,
|
||||||
/// NULL otherise.
|
/// NULL otherwise.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void *
|
void *
|
||||||
GetU64 ( lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
GetU64 ( lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
|
||||||
@ -1328,7 +1328,7 @@ class DataExtractor
|
|||||||
const uint8_t * m_end; ///< A pointer to the byte that is past the end of the data.
|
const uint8_t * m_end; ///< A pointer to the byte that is past the end of the data.
|
||||||
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
|
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
|
||||||
uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses
|
uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses
|
||||||
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances
|
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multiple instances
|
||||||
const uint32_t m_target_byte_size;
|
const uint32_t m_target_byte_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,21 +14,16 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <stack>
|
|
||||||
|
|
||||||
#include "lldb/lldb-public.h"
|
#include "lldb/lldb-public.h"
|
||||||
#include "lldb/Core/Broadcaster.h"
|
#include "lldb/Core/Broadcaster.h"
|
||||||
#include "lldb/Core/Communication.h"
|
#include "lldb/Core/FormatEntity.h"
|
||||||
#include "lldb/Core/IOHandler.h"
|
#include "lldb/Core/IOHandler.h"
|
||||||
#include "lldb/Core/Listener.h"
|
#include "lldb/Core/Listener.h"
|
||||||
#include "lldb/Core/SourceManager.h"
|
#include "lldb/Core/SourceManager.h"
|
||||||
#include "lldb/Core/UserID.h"
|
#include "lldb/Core/UserID.h"
|
||||||
#include "lldb/Core/UserSettingsController.h"
|
#include "lldb/Core/UserSettingsController.h"
|
||||||
#include "lldb/DataFormatters/FormatManager.h"
|
|
||||||
#include "lldb/Host/HostThread.h"
|
#include "lldb/Host/HostThread.h"
|
||||||
#include "lldb/Host/Terminal.h"
|
#include "lldb/Host/Terminal.h"
|
||||||
#include "lldb/Interpreter/OptionValueProperties.h"
|
|
||||||
#include "lldb/Target/ExecutionContext.h"
|
|
||||||
#include "lldb/Target/Platform.h"
|
#include "lldb/Target/Platform.h"
|
||||||
#include "lldb/Target/TargetList.h"
|
#include "lldb/Target/TargetList.h"
|
||||||
|
|
||||||
@ -60,10 +55,6 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType) (const lldb::DebuggerSP &debugger_sp,
|
|
||||||
const FileSpec& spec,
|
|
||||||
Error& error);
|
|
||||||
|
|
||||||
static lldb::DebuggerSP
|
static lldb::DebuggerSP
|
||||||
CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL);
|
CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL);
|
||||||
|
|
||||||
@ -74,10 +65,10 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
FindTargetWithProcess (Process *process);
|
FindTargetWithProcess (Process *process);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Initialize (LoadPluginCallbackType load_plugin_callback);
|
Initialize(LoadPluginCallbackType load_plugin_callback);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Terminate ();
|
Terminate();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SettingsInitialize ();
|
SettingsInitialize ();
|
||||||
@ -158,8 +149,6 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
// To get the target's source manager, call GetSourceManager on the target instead.
|
// To get the target's source manager, call GetSourceManager on the target instead.
|
||||||
SourceManager &
|
SourceManager &
|
||||||
GetSourceManager ();
|
GetSourceManager ();
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
lldb::TargetSP
|
lldb::TargetSP
|
||||||
GetSelectedTarget ()
|
GetSelectedTarget ()
|
||||||
@ -221,14 +210,17 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
bool
|
bool
|
||||||
IsTopIOHandler (const lldb::IOHandlerSP& reader_sp);
|
IsTopIOHandler (const lldb::IOHandlerSP& reader_sp);
|
||||||
|
|
||||||
|
void
|
||||||
|
PrintAsync (const char *s, size_t len, bool is_stdout);
|
||||||
|
|
||||||
ConstString
|
ConstString
|
||||||
GetTopIOHandlerControlSequence(char ch);
|
GetTopIOHandlerControlSequence(char ch);
|
||||||
|
|
||||||
bool
|
const char *
|
||||||
HideTopIOHandler();
|
GetIOHandlerCommandPrefix();
|
||||||
|
|
||||||
void
|
const char *
|
||||||
RefreshTopIOHandler();
|
GetIOHandlerHelpPrologue();
|
||||||
|
|
||||||
static lldb::DebuggerSP
|
static lldb::DebuggerSP
|
||||||
FindDebuggerWithID (lldb::user_id_t id);
|
FindDebuggerWithID (lldb::user_id_t id);
|
||||||
@ -243,15 +235,7 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
GetDebuggerAtIndex (size_t index);
|
GetDebuggerAtIndex (size_t index);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
FormatPrompt (const char *format,
|
FormatDisassemblerAddress (const FormatEntity::Entry *format,
|
||||||
const SymbolContext *sc,
|
|
||||||
const ExecutionContext *exe_ctx,
|
|
||||||
const Address *addr,
|
|
||||||
Stream &s,
|
|
||||||
ValueObject* valobj = NULL);
|
|
||||||
|
|
||||||
static bool
|
|
||||||
FormatDisassemblerAddress (const char *format,
|
|
||||||
const SymbolContext *sc,
|
const SymbolContext *sc,
|
||||||
const SymbolContext *prev_sc,
|
const SymbolContext *prev_sc,
|
||||||
const ExecutionContext *exe_ctx,
|
const ExecutionContext *exe_ctx,
|
||||||
@ -261,9 +245,6 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
void
|
void
|
||||||
ClearIOHandlers ();
|
ClearIOHandlers ();
|
||||||
|
|
||||||
static int
|
|
||||||
TestDebuggerRefCount ();
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
GetCloseInputOnEOF () const;
|
GetCloseInputOnEOF () const;
|
||||||
|
|
||||||
@ -296,13 +277,13 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
bool
|
bool
|
||||||
GetAutoConfirm () const;
|
GetAutoConfirm () const;
|
||||||
|
|
||||||
const char *
|
const FormatEntity::Entry *
|
||||||
GetDisassemblyFormat() const;
|
GetDisassemblyFormat() const;
|
||||||
|
|
||||||
const char *
|
const FormatEntity::Entry *
|
||||||
GetFrameFormat() const;
|
GetFrameFormat() const;
|
||||||
|
|
||||||
const char *
|
const FormatEntity::Entry *
|
||||||
GetThreadFormat() const;
|
GetThreadFormat() const;
|
||||||
|
|
||||||
lldb::ScriptLanguage
|
lldb::ScriptLanguage
|
||||||
@ -352,7 +333,6 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
GetNotifyVoid () const;
|
GetNotifyVoid () const;
|
||||||
|
|
||||||
|
|
||||||
const ConstString &
|
const ConstString &
|
||||||
GetInstanceName()
|
GetInstanceName()
|
||||||
@ -364,7 +344,7 @@ friend class SourceManager; // For GetSourceFileCache.
|
|||||||
LoadPlugin (const FileSpec& spec, Error& error);
|
LoadPlugin (const FileSpec& spec, Error& error);
|
||||||
|
|
||||||
void
|
void
|
||||||
ExecuteIOHanders();
|
ExecuteIOHandlers();
|
||||||
|
|
||||||
bool
|
bool
|
||||||
IsForwardingEvents ();
|
IsForwardingEvents ();
|
||||||
|
@ -117,9 +117,15 @@ class Instruction
|
|||||||
/// the InstructionList.
|
/// the InstructionList.
|
||||||
/// Only needed if show_address is true.
|
/// Only needed if show_address is true.
|
||||||
///
|
///
|
||||||
/// @param[in] disassembly_addr_format_spec
|
/// @param[in] disassembly_addr_format
|
||||||
/// The format specification for how addresses are printed.
|
/// The format specification for how addresses are printed.
|
||||||
/// Only needed if show_address is true.
|
/// Only needed if show_address is true.
|
||||||
|
///
|
||||||
|
/// @param[in] max_address_text_size
|
||||||
|
/// The length of the longest address string at the start of the
|
||||||
|
/// disassembly line that will be printed (the Debugger::FormatDisassemblerAddress() string)
|
||||||
|
/// so this method can properly align the instruction opcodes.
|
||||||
|
/// May be 0 to indicate no indentation/alignment of the opcodes.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
@ -130,7 +136,8 @@ class Instruction
|
|||||||
const ExecutionContext* exe_ctx,
|
const ExecutionContext* exe_ctx,
|
||||||
const SymbolContext *sym_ctx,
|
const SymbolContext *sym_ctx,
|
||||||
const SymbolContext *prev_sym_ctx,
|
const SymbolContext *prev_sym_ctx,
|
||||||
const char *disassembly_addr_format_spec);
|
const FormatEntity::Entry *disassembly_addr_format,
|
||||||
|
size_t max_address_text_size);
|
||||||
|
|
||||||
virtual bool
|
virtual bool
|
||||||
DoesBranch () = 0;
|
DoesBranch () = 0;
|
||||||
@ -218,7 +225,7 @@ class InstructionList
|
|||||||
GetInstructionAtIndex (size_t idx) const;
|
GetInstructionAtIndex (size_t idx) const;
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
GetIndexOfNextBranchInstruction(uint32_t start) const;
|
GetIndexOfNextBranchInstruction(uint32_t start, Target &target) const;
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target);
|
GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target);
|
||||||
@ -457,7 +464,7 @@ class Disassembler :
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Classes that inherit from Disassembler can see and modify these
|
// Classes that inherit from Disassembler can see and modify these
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
const ArchSpec m_arch;
|
ArchSpec m_arch;
|
||||||
InstructionList m_instruction_list;
|
InstructionList m_instruction_list;
|
||||||
lldb::addr_t m_base_addr;
|
lldb::addr_t m_base_addr;
|
||||||
std::string m_flavor;
|
std::string m_flavor;
|
||||||
|
24
contrib/llvm/tools/lldb/include/lldb/Core/FastDemangle.h
Normal file
24
contrib/llvm/tools/lldb/include/lldb/Core/FastDemangle.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
//===-- FastDemangle.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef liblldb_FastDemangle_h_
|
||||||
|
#define liblldb_FastDemangle_h_
|
||||||
|
|
||||||
|
namespace lldb_private
|
||||||
|
{
|
||||||
|
|
||||||
|
char *
|
||||||
|
FastDemangle(const char *mangled_name);
|
||||||
|
|
||||||
|
char *
|
||||||
|
FastDemangle(const char *mangled_name, long mangled_name_length);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
263
contrib/llvm/tools/lldb/include/lldb/Core/FormatEntity.h
Normal file
263
contrib/llvm/tools/lldb/include/lldb/Core/FormatEntity.h
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
//===-- FormatEntity.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef liblldb_FormatEntity_h_
|
||||||
|
#define liblldb_FormatEntity_h_
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "lldb/lldb-private.h"
|
||||||
|
#include "lldb/Core/Error.h"
|
||||||
|
|
||||||
|
namespace llvm
|
||||||
|
{
|
||||||
|
class StringRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace lldb_private
|
||||||
|
{
|
||||||
|
class FormatEntity
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct Entry
|
||||||
|
{
|
||||||
|
enum class Type {
|
||||||
|
Invalid,
|
||||||
|
ParentNumber,
|
||||||
|
ParentString,
|
||||||
|
InsertString,
|
||||||
|
Root,
|
||||||
|
String,
|
||||||
|
Scope,
|
||||||
|
Variable,
|
||||||
|
VariableSynthetic,
|
||||||
|
ScriptVariable,
|
||||||
|
ScriptVariableSynthetic,
|
||||||
|
AddressLoad,
|
||||||
|
AddressFile,
|
||||||
|
AddressLoadOrFile,
|
||||||
|
ProcessID,
|
||||||
|
ProcessFile,
|
||||||
|
ScriptProcess,
|
||||||
|
ThreadID,
|
||||||
|
ThreadProtocolID,
|
||||||
|
ThreadIndexID,
|
||||||
|
ThreadName,
|
||||||
|
ThreadQueue,
|
||||||
|
ThreadStopReason,
|
||||||
|
ThreadReturnValue,
|
||||||
|
ThreadCompletedExpression,
|
||||||
|
ScriptThread,
|
||||||
|
ThreadInfo,
|
||||||
|
TargetArch,
|
||||||
|
ScriptTarget,
|
||||||
|
ModuleFile,
|
||||||
|
File,
|
||||||
|
Lang,
|
||||||
|
FrameIndex,
|
||||||
|
FrameRegisterPC,
|
||||||
|
FrameRegisterSP,
|
||||||
|
FrameRegisterFP,
|
||||||
|
FrameRegisterFlags,
|
||||||
|
FrameRegisterByName,
|
||||||
|
ScriptFrame,
|
||||||
|
FunctionID,
|
||||||
|
FunctionDidChange,
|
||||||
|
FunctionInitialFunction,
|
||||||
|
FunctionName,
|
||||||
|
FunctionNameWithArgs,
|
||||||
|
FunctionNameNoArgs,
|
||||||
|
FunctionAddrOffset,
|
||||||
|
FunctionAddrOffsetConcrete,
|
||||||
|
FunctionLineOffset,
|
||||||
|
FunctionPCOffset,
|
||||||
|
FunctionInitial,
|
||||||
|
FunctionChanged,
|
||||||
|
LineEntryFile,
|
||||||
|
LineEntryLineNumber,
|
||||||
|
LineEntryStartAddress,
|
||||||
|
LineEntryEndAddress,
|
||||||
|
CurrentPCArrow
|
||||||
|
};
|
||||||
|
|
||||||
|
enum FormatType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
UInt32,
|
||||||
|
UInt64,
|
||||||
|
CString
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Definition
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
const char *string; // Insert this exact string into the output
|
||||||
|
Entry::Type type;
|
||||||
|
FormatType format_type; // uint32_t, uint64_t, cstr, or anything that can be formatted by printf or lldb::Format
|
||||||
|
uint64_t data;
|
||||||
|
uint32_t num_children;
|
||||||
|
Definition *children; // An array of "num_children" Definition entries,
|
||||||
|
bool keep_separator;
|
||||||
|
};
|
||||||
|
|
||||||
|
Entry (Type t = Type::Invalid,
|
||||||
|
const char *s = NULL,
|
||||||
|
const char *f = NULL) :
|
||||||
|
string (s ? s : ""),
|
||||||
|
printf_format (f ? f : ""),
|
||||||
|
children (),
|
||||||
|
definition (NULL),
|
||||||
|
type (t),
|
||||||
|
fmt (lldb::eFormatDefault),
|
||||||
|
number (0),
|
||||||
|
deref (false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Entry (llvm::StringRef s);
|
||||||
|
Entry (char ch);
|
||||||
|
|
||||||
|
void
|
||||||
|
AppendChar (char ch);
|
||||||
|
|
||||||
|
void
|
||||||
|
AppendText (const llvm::StringRef &s);
|
||||||
|
|
||||||
|
void
|
||||||
|
AppendText (const char *cstr);
|
||||||
|
|
||||||
|
void
|
||||||
|
AppendEntry (const Entry &&entry)
|
||||||
|
{
|
||||||
|
children.push_back(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Clear ()
|
||||||
|
{
|
||||||
|
string.clear();
|
||||||
|
printf_format.clear();
|
||||||
|
children.clear();
|
||||||
|
definition = NULL;
|
||||||
|
type = Type::Invalid;
|
||||||
|
fmt = lldb::eFormatDefault;
|
||||||
|
number = 0;
|
||||||
|
deref = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
TypeToCString (Type t);
|
||||||
|
|
||||||
|
void
|
||||||
|
Dump (Stream &s, int depth = 0) const;
|
||||||
|
|
||||||
|
bool
|
||||||
|
operator == (const Entry &rhs) const
|
||||||
|
{
|
||||||
|
if (string != rhs.string)
|
||||||
|
return false;
|
||||||
|
if (printf_format != rhs.printf_format)
|
||||||
|
return false;
|
||||||
|
const size_t n = children.size();
|
||||||
|
const size_t m = rhs.children.size();
|
||||||
|
for (size_t i=0; i < std::min<size_t>(n, m); ++i)
|
||||||
|
{
|
||||||
|
if (!(children[i] == rhs.children[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (children != rhs.children)
|
||||||
|
return false;
|
||||||
|
if (definition != rhs.definition)
|
||||||
|
return false;
|
||||||
|
if (type != rhs.type)
|
||||||
|
return false;
|
||||||
|
if (fmt != rhs.fmt)
|
||||||
|
return false;
|
||||||
|
if (deref != rhs.deref)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string string;
|
||||||
|
std::string printf_format;
|
||||||
|
std::vector<Entry> children;
|
||||||
|
Definition *definition;
|
||||||
|
Type type;
|
||||||
|
lldb::Format fmt;
|
||||||
|
lldb::addr_t number;
|
||||||
|
bool deref;
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
Format (const Entry &entry,
|
||||||
|
Stream &s,
|
||||||
|
const SymbolContext *sc,
|
||||||
|
const ExecutionContext *exe_ctx,
|
||||||
|
const Address *addr,
|
||||||
|
ValueObject* valobj,
|
||||||
|
bool function_changed,
|
||||||
|
bool initial_function);
|
||||||
|
|
||||||
|
static bool
|
||||||
|
FormatStringRef (const llvm::StringRef &format,
|
||||||
|
Stream &s,
|
||||||
|
const SymbolContext *sc,
|
||||||
|
const ExecutionContext *exe_ctx,
|
||||||
|
const Address *addr,
|
||||||
|
ValueObject* valobj,
|
||||||
|
bool function_changed,
|
||||||
|
bool initial_function);
|
||||||
|
|
||||||
|
static bool
|
||||||
|
FormatCString (const char *format,
|
||||||
|
Stream &s,
|
||||||
|
const SymbolContext *sc,
|
||||||
|
const ExecutionContext *exe_ctx,
|
||||||
|
const Address *addr,
|
||||||
|
ValueObject* valobj,
|
||||||
|
bool function_changed,
|
||||||
|
bool initial_function);
|
||||||
|
|
||||||
|
static Error
|
||||||
|
Parse (const llvm::StringRef &format, Entry &entry);
|
||||||
|
|
||||||
|
static Error
|
||||||
|
ExtractVariableInfo (llvm::StringRef &format_str,
|
||||||
|
llvm::StringRef &variable_name,
|
||||||
|
llvm::StringRef &variable_format);
|
||||||
|
|
||||||
|
static size_t
|
||||||
|
AutoComplete (const char *s,
|
||||||
|
int match_start_point,
|
||||||
|
int max_return_elements,
|
||||||
|
bool &word_complete,
|
||||||
|
StringList &matches);
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
// Format the current elements into the stream \a s.
|
||||||
|
//
|
||||||
|
// The root element will be stripped off and the format str passed in
|
||||||
|
// will be either an empty string (print a description of this object),
|
||||||
|
// or contain a . separated series like a domain name that identifies
|
||||||
|
// further sub elements to display.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
static bool
|
||||||
|
FormatFileSpec (const FileSpec &file, Stream &s, llvm::StringRef elements, llvm::StringRef element_format);
|
||||||
|
protected:
|
||||||
|
|
||||||
|
static Error
|
||||||
|
ParseInternal (llvm::StringRef &format, Entry &parent_entry, uint32_t depth);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // #if defined(__cplusplus)
|
||||||
|
#endif // liblldb_FormatEntity_h_
|
@ -67,18 +67,6 @@ namespace lldb_private {
|
|||||||
virtual void
|
virtual void
|
||||||
Run () = 0;
|
Run () = 0;
|
||||||
|
|
||||||
// Hide any characters that have been displayed so far so async
|
|
||||||
// output can be displayed. Refresh() will be called after the
|
|
||||||
// output has been displayed.
|
|
||||||
virtual void
|
|
||||||
Hide () = 0;
|
|
||||||
|
|
||||||
// Called when the async output has been received in order to update
|
|
||||||
// the input reader (refresh the prompt and redisplay any current
|
|
||||||
// line(s) that are being edited
|
|
||||||
virtual void
|
|
||||||
Refresh () = 0;
|
|
||||||
|
|
||||||
// Called when an input reader should relinquish its control so another
|
// Called when an input reader should relinquish its control so another
|
||||||
// can be pushed onto the IO handler stack, or so the current IO
|
// can be pushed onto the IO handler stack, or so the current IO
|
||||||
// handler can pop itself off the stack
|
// handler can pop itself off the stack
|
||||||
@ -246,7 +234,14 @@ namespace lldb_private {
|
|||||||
|
|
||||||
void
|
void
|
||||||
WaitForPop ();
|
WaitForPop ();
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
PrintAsync (Stream *stream, const char *s, size_t len)
|
||||||
|
{
|
||||||
|
stream->Write (s, len);
|
||||||
|
stream->Flush();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Debugger &m_debugger;
|
Debugger &m_debugger;
|
||||||
lldb::StreamFileSP m_input_sp;
|
lldb::StreamFileSP m_input_sp;
|
||||||
@ -318,7 +313,7 @@ namespace lldb_private {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Called when a new line is created or one of an identifed set of
|
/// Called when a new line is created or one of an identified set of
|
||||||
/// indentation characters is typed.
|
/// indentation characters is typed.
|
||||||
///
|
///
|
||||||
/// This function determines how much indentation should be added
|
/// This function determines how much indentation should be added
|
||||||
@ -332,7 +327,7 @@ namespace lldb_private {
|
|||||||
/// following the line containing the cursor are not included.
|
/// following the line containing the cursor are not included.
|
||||||
///
|
///
|
||||||
/// @param[in] cursor_position
|
/// @param[in] cursor_position
|
||||||
/// The number of characters preceeding the cursor on the final
|
/// The number of characters preceding the cursor on the final
|
||||||
/// line at the time.
|
/// line at the time.
|
||||||
///
|
///
|
||||||
/// @return
|
/// @return
|
||||||
@ -448,17 +443,17 @@ namespace lldb_private {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ConstString
|
ConstString
|
||||||
IOHandlerGetControlSequence (char ch)
|
IOHandlerGetControlSequence (char ch) override
|
||||||
{
|
{
|
||||||
if (ch == 'd')
|
if (ch == 'd')
|
||||||
return ConstString (m_end_line + "\n");
|
return ConstString (m_end_line + "\n");
|
||||||
return ConstString();
|
return ConstString();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool
|
bool
|
||||||
IOHandlerIsInputComplete (IOHandler &io_handler,
|
IOHandlerIsInputComplete (IOHandler &io_handler,
|
||||||
StringList &lines)
|
StringList &lines) override
|
||||||
{
|
{
|
||||||
// Determine whether the end of input signal has been entered
|
// Determine whether the end of input signal has been entered
|
||||||
const size_t num_lines = lines.GetSize();
|
const size_t num_lines = lines.GetSize();
|
||||||
@ -507,53 +502,47 @@ namespace lldb_private {
|
|||||||
virtual
|
virtual
|
||||||
~IOHandlerEditline ();
|
~IOHandlerEditline ();
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Run ();
|
Run () override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Hide ();
|
Cancel () override;
|
||||||
|
|
||||||
virtual void
|
bool
|
||||||
Refresh ();
|
Interrupt () override;
|
||||||
|
|
||||||
virtual void
|
|
||||||
Cancel ();
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Interrupt ();
|
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
GotEOF();
|
GotEOF() override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Activate ();
|
Activate () override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Deactivate ();
|
Deactivate () override;
|
||||||
|
|
||||||
virtual ConstString
|
ConstString
|
||||||
GetControlSequence (char ch)
|
GetControlSequence (char ch) override
|
||||||
{
|
{
|
||||||
return m_delegate.IOHandlerGetControlSequence (ch);
|
return m_delegate.IOHandlerGetControlSequence (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char *
|
const char *
|
||||||
GetCommandPrefix ()
|
GetCommandPrefix () override
|
||||||
{
|
{
|
||||||
return m_delegate.IOHandlerGetCommandPrefix ();
|
return m_delegate.IOHandlerGetCommandPrefix ();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char *
|
const char *
|
||||||
GetHelpPrologue ()
|
GetHelpPrologue () override
|
||||||
{
|
{
|
||||||
return m_delegate.IOHandlerGetHelpPrologue ();
|
return m_delegate.IOHandlerGetHelpPrologue ();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char *
|
const char *
|
||||||
GetPrompt ();
|
GetPrompt () override;
|
||||||
|
|
||||||
virtual bool
|
bool
|
||||||
SetPrompt (const char *prompt);
|
SetPrompt (const char *prompt) override;
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
GetContinuationPrompt ();
|
GetContinuationPrompt ();
|
||||||
@ -591,6 +580,9 @@ namespace lldb_private {
|
|||||||
uint32_t
|
uint32_t
|
||||||
GetCurrentLineIndex () const;
|
GetCurrentLineIndex () const;
|
||||||
|
|
||||||
|
void
|
||||||
|
PrintAsync (Stream *stream, const char *s, size_t len) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef LLDB_DISABLE_LIBEDIT
|
#ifndef LLDB_DISABLE_LIBEDIT
|
||||||
static bool
|
static bool
|
||||||
@ -626,6 +618,7 @@ namespace lldb_private {
|
|||||||
bool m_multi_line;
|
bool m_multi_line;
|
||||||
bool m_color_prompts;
|
bool m_color_prompts;
|
||||||
bool m_interrupt_exits;
|
bool m_interrupt_exits;
|
||||||
|
bool m_editing; // Set to true when fetching a line manually (not using libedit)
|
||||||
};
|
};
|
||||||
|
|
||||||
// The order of base classes is important. Look at the constructor of IOHandlerConfirm
|
// The order of base classes is important. Look at the constructor of IOHandlerConfirm
|
||||||
@ -648,17 +641,17 @@ namespace lldb_private {
|
|||||||
return m_user_response;
|
return m_user_response;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int
|
int
|
||||||
IOHandlerComplete (IOHandler &io_handler,
|
IOHandlerComplete (IOHandler &io_handler,
|
||||||
const char *current_line,
|
const char *current_line,
|
||||||
const char *cursor,
|
const char *cursor,
|
||||||
const char *last_char,
|
const char *last_char,
|
||||||
int skip_first_n_matches,
|
int skip_first_n_matches,
|
||||||
int max_matches,
|
int max_matches,
|
||||||
StringList &matches);
|
StringList &matches) override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
IOHandlerInputComplete (IOHandler &io_handler, std::string &data);
|
IOHandlerInputComplete (IOHandler &io_handler, std::string &data) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const bool m_default_response;
|
const bool m_default_response;
|
||||||
@ -671,32 +664,25 @@ namespace lldb_private {
|
|||||||
public:
|
public:
|
||||||
IOHandlerCursesGUI (Debugger &debugger);
|
IOHandlerCursesGUI (Debugger &debugger);
|
||||||
|
|
||||||
virtual
|
~IOHandlerCursesGUI () override;
|
||||||
~IOHandlerCursesGUI ();
|
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Run ();
|
Run () override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Hide ();
|
Cancel () override;
|
||||||
|
|
||||||
virtual void
|
|
||||||
Refresh ();
|
|
||||||
|
|
||||||
virtual void
|
bool
|
||||||
Cancel ();
|
Interrupt () override;
|
||||||
|
|
||||||
virtual bool
|
|
||||||
Interrupt ();
|
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
GotEOF();
|
GotEOF() override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Activate ();
|
Activate () override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Deactivate ();
|
Deactivate () override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
curses::ApplicationAP m_app_ap;
|
curses::ApplicationAP m_app_ap;
|
||||||
@ -711,20 +697,11 @@ namespace lldb_private {
|
|||||||
virtual
|
virtual
|
||||||
~IOHandlerCursesValueObjectList ();
|
~IOHandlerCursesValueObjectList ();
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Run ();
|
Run () override;
|
||||||
|
|
||||||
virtual void
|
void
|
||||||
Hide ();
|
GotEOF() override;
|
||||||
|
|
||||||
virtual void
|
|
||||||
Refresh ();
|
|
||||||
|
|
||||||
virtual bool
|
|
||||||
HandleInterrupt ();
|
|
||||||
|
|
||||||
virtual void
|
|
||||||
GotEOF();
|
|
||||||
protected:
|
protected:
|
||||||
ValueObjectList m_valobj_list;
|
ValueObjectList m_valobj_list;
|
||||||
};
|
};
|
||||||
@ -849,7 +826,10 @@ namespace lldb_private {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
void
|
||||||
|
PrintAsync (Stream *stream, const char *s, size_t len);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
typedef std::vector<lldb::IOHandlerSP> collection;
|
typedef std::vector<lldb::IOHandlerSP> collection;
|
||||||
collection m_stack;
|
collection m_stack;
|
||||||
|
@ -22,19 +22,9 @@
|
|||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-private.h"
|
||||||
#include "lldb/Core/ConstString.h"
|
#include "lldb/Core/ConstString.h"
|
||||||
#include "lldb/Core/Flags.h"
|
#include "lldb/Core/Flags.h"
|
||||||
|
#include "lldb/Core/Logging.h"
|
||||||
#include "lldb/Core/PluginInterface.h"
|
#include "lldb/Core/PluginInterface.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
// Logging types
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
#define LLDB_LOG_FLAG_STDOUT (1u << 0)
|
|
||||||
#define LLDB_LOG_FLAG_STDERR (1u << 1)
|
|
||||||
#define LLDB_LOG_FLAG_FATAL (1u << 2)
|
|
||||||
#define LLDB_LOG_FLAG_ERROR (1u << 3)
|
|
||||||
#define LLDB_LOG_FLAG_WARNING (1u << 4)
|
|
||||||
#define LLDB_LOG_FLAG_DEBUG (1u << 5)
|
|
||||||
#define LLDB_LOG_FLAG_VERBOSE (1u << 6)
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Logging Options
|
// Logging Options
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -46,6 +36,7 @@
|
|||||||
#define LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5)
|
#define LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5)
|
||||||
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME (1U << 6)
|
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME (1U << 6)
|
||||||
#define LLDB_LOG_OPTION_BACKTRACE (1U << 7)
|
#define LLDB_LOG_OPTION_BACKTRACE (1U << 7)
|
||||||
|
#define LLDB_LOG_OPTION_APPEND (1U << 8)
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Logging Functions
|
// Logging Functions
|
||||||
@ -59,12 +50,10 @@ class Log
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Callback definitions for abstracted plug-in log access.
|
// Callback definitions for abstracted plug-in log access.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
typedef void (*DisableCallback) (const char **categories, Stream *feedback_strm);
|
typedef void (*DisableCallback)(const char **categories, Stream *feedback_strm);
|
||||||
typedef Log * (*EnableCallback) (lldb::StreamSP &log_stream_sp,
|
typedef Log *(*EnableCallback)(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories,
|
||||||
uint32_t log_options,
|
Stream *feedback_strm);
|
||||||
const char **categories,
|
typedef void (*ListCategoriesCallback)(Stream *strm);
|
||||||
Stream *feedback_strm);
|
|
||||||
typedef void (*ListCategoriesCallback) (Stream *strm);
|
|
||||||
|
|
||||||
struct Callbacks
|
struct Callbacks
|
||||||
{
|
{
|
||||||
@ -77,86 +66,85 @@ class Log
|
|||||||
// Static accessors for logging channels
|
// Static accessors for logging channels
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
static void
|
static void
|
||||||
RegisterLogChannel (const ConstString &channel,
|
RegisterLogChannel(const ConstString &channel, const Log::Callbacks &log_callbacks);
|
||||||
const Log::Callbacks &log_callbacks);
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
UnregisterLogChannel (const ConstString &channel);
|
UnregisterLogChannel(const ConstString &channel);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
GetLogChannelCallbacks (const ConstString &channel,
|
GetLogChannelCallbacks(const ConstString &channel, Log::Callbacks &log_callbacks);
|
||||||
Log::Callbacks &log_callbacks);
|
|
||||||
|
|
||||||
|
static bool
|
||||||
|
EnableLogChannel(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char *channel,
|
||||||
|
const char **categories, Stream &error_stream);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
EnableAllLogChannels (lldb::StreamSP &log_stream_sp,
|
EnableAllLogChannels(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories,
|
||||||
uint32_t log_options,
|
Stream *feedback_strm);
|
||||||
const char **categories,
|
|
||||||
Stream *feedback_strm);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DisableAllLogChannels (Stream *feedback_strm);
|
DisableAllLogChannels(Stream *feedback_strm);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ListAllLogChannels (Stream *strm);
|
ListAllLogChannels(Stream *strm);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Initialize ();
|
Initialize();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Terminate ();
|
Terminate();
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Auto completion
|
// Auto completion
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
static void
|
static void
|
||||||
AutoCompleteChannelName (const char *channel_name,
|
AutoCompleteChannelName(const char *channel_name, StringList &matches);
|
||||||
StringList &matches);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Member functions
|
// Member functions
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
Log ();
|
Log();
|
||||||
|
|
||||||
Log (const lldb::StreamSP &stream_sp);
|
Log(const lldb::StreamSP &stream_sp);
|
||||||
|
|
||||||
~Log ();
|
virtual
|
||||||
|
~Log();
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
PutCString (const char *cstr);
|
PutCString(const char *cstr);
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
|
Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
VAPrintf (const char *format, va_list args);
|
VAPrintf(const char *format, va_list args);
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
PrintfWithFlags( uint32_t flags, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
|
LogIf(uint32_t mask, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
LogIf (uint32_t mask, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
Debug(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
Debug (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
DebugVerbose(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
DebugVerbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
Error(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
Error (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
VAError(const char *format, va_list args);
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
FatalError (int err, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
FatalError(int err, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
Verbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
Verbose(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
Warning (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
Warning(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
void
|
virtual void
|
||||||
WarningVerbose (const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));
|
WarningVerbose(const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
Flags &
|
Flags &
|
||||||
GetOptions();
|
GetOptions();
|
||||||
@ -177,7 +165,7 @@ class Log
|
|||||||
GetDebug() const;
|
GetDebug() const;
|
||||||
|
|
||||||
void
|
void
|
||||||
SetStream (const lldb::StreamSP &stream_sp)
|
SetStream(const lldb::StreamSP &stream_sp)
|
||||||
{
|
{
|
||||||
m_stream_sp = stream_sp;
|
m_stream_sp = stream_sp;
|
||||||
}
|
}
|
||||||
@ -190,43 +178,35 @@ class Log
|
|||||||
Flags m_options;
|
Flags m_options;
|
||||||
Flags m_mask_bits;
|
Flags m_mask_bits;
|
||||||
|
|
||||||
void
|
|
||||||
PrintfWithFlagsVarArg (uint32_t flags, const char *format, va_list args);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN (Log);
|
DISALLOW_COPY_AND_ASSIGN(Log);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class LogChannel : public PluginInterface
|
class LogChannel : public PluginInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LogChannel ();
|
LogChannel();
|
||||||
|
|
||||||
virtual
|
virtual ~LogChannel();
|
||||||
~LogChannel ();
|
|
||||||
|
|
||||||
static lldb::LogChannelSP
|
static lldb::LogChannelSP FindPlugin(const char *plugin_name);
|
||||||
FindPlugin (const char *plugin_name);
|
|
||||||
|
|
||||||
// categories is a an array of chars that ends with a NULL element.
|
// categories is a an array of chars that ends with a NULL element.
|
||||||
virtual void
|
virtual void Disable(const char **categories, Stream *feedback_strm) = 0;
|
||||||
Disable (const char **categories, Stream *feedback_strm) = 0;
|
|
||||||
|
|
||||||
virtual bool
|
virtual bool Enable(
|
||||||
Enable (lldb::StreamSP &log_stream_sp,
|
lldb::StreamSP &log_stream_sp, uint32_t log_options,
|
||||||
uint32_t log_options,
|
Stream *feedback_strm, // Feedback stream for argument errors etc
|
||||||
Stream *feedback_strm, // Feedback stream for argument errors etc
|
const char **categories) = 0; // The categories to enable within this logging stream, if empty, enable default set
|
||||||
const char **categories) = 0;// The categories to enable within this logging stream, if empty, enable default set
|
|
||||||
|
|
||||||
virtual void
|
virtual void ListCategories(Stream *strm) = 0;
|
||||||
ListCategories (Stream *strm) = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::unique_ptr<Log> m_log_ap;
|
std::unique_ptr<Log> m_log_ap;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN (LogChannel);
|
DISALLOW_COPY_AND_ASSIGN(LogChannel);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//===-- lldb-private-log.h --------------------------------------*- C++ -*-===//
|
//===-- Logging.h -----------------------------------------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
// The LLVM Compiler Infrastructure
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -7,8 +7,8 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifndef liblldb_lldb_private_log_h_
|
#ifndef liblldb_Core_Logging_h_
|
||||||
#define liblldb_lldb_private_log_h_
|
#define liblldb_Core_Logging_h_
|
||||||
|
|
||||||
// C Includes
|
// C Includes
|
||||||
// C++ Includes
|
// C++ Includes
|
||||||
@ -47,6 +47,7 @@
|
|||||||
#define LIBLLDB_LOG_PLATFORM (1u << 25)
|
#define LIBLLDB_LOG_PLATFORM (1u << 25)
|
||||||
#define LIBLLDB_LOG_SYSTEM_RUNTIME (1u << 26)
|
#define LIBLLDB_LOG_SYSTEM_RUNTIME (1u << 26)
|
||||||
#define LIBLLDB_LOG_JIT_LOADER (1u << 27)
|
#define LIBLLDB_LOG_JIT_LOADER (1u << 27)
|
||||||
|
#define LIBLLDB_LOG_LANGUAGE (1u << 28)
|
||||||
#define LIBLLDB_LOG_ALL (UINT32_MAX)
|
#define LIBLLDB_LOG_ALL (UINT32_MAX)
|
||||||
#define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS |\
|
#define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS |\
|
||||||
LIBLLDB_LOG_THREAD |\
|
LIBLLDB_LOG_THREAD |\
|
||||||
@ -90,4 +91,4 @@ ListLogCategories (Stream *strm);
|
|||||||
|
|
||||||
} // namespace lldb_private
|
} // namespace lldb_private
|
||||||
|
|
||||||
#endif // liblldb_lldb_private_log_h_
|
#endif // liblldb_Core_Logging_h_
|
@ -41,6 +41,13 @@ class Mangled
|
|||||||
ePreferDemangledWithoutArguments
|
ePreferDemangledWithoutArguments
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ManglingScheme
|
||||||
|
{
|
||||||
|
eManglingSchemeNone = 0,
|
||||||
|
eManglingSchemeMSVC,
|
||||||
|
eManglingSchemeItanium
|
||||||
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
///
|
///
|
||||||
@ -290,6 +297,25 @@ class Mangled
|
|||||||
void
|
void
|
||||||
SetValue (const ConstString &name);
|
SetValue (const ConstString &name);
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/// Try to guess the language from the mangling.
|
||||||
|
///
|
||||||
|
/// For a mangled name to have a language it must have both a mangled
|
||||||
|
/// and a demangled name and it can be guessed from the mangling what
|
||||||
|
/// the language is. Note: this will return C++ for any language that
|
||||||
|
/// uses Itanium ABI mangling.
|
||||||
|
///
|
||||||
|
/// Standard C function names will return eLanguageTypeUnknown because
|
||||||
|
/// they aren't mangled and it isn't clear what language the name
|
||||||
|
/// represents (there will be no mangled name).
|
||||||
|
///
|
||||||
|
/// @return
|
||||||
|
/// The language for the mangled/demangled name, eLanguageTypeUnknown
|
||||||
|
/// if there is no mangled or demangled counterpart.
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
lldb::LanguageType
|
||||||
|
GuessLanguage () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
/// Mangled member variables.
|
/// Mangled member variables.
|
||||||
|
@ -10,12 +10,12 @@
|
|||||||
#ifndef liblldb_Module_h_
|
#ifndef liblldb_Module_h_
|
||||||
#define liblldb_Module_h_
|
#define liblldb_Module_h_
|
||||||
|
|
||||||
|
#include "lldb/lldb-forward.h"
|
||||||
#include "lldb/Core/ArchSpec.h"
|
#include "lldb/Core/ArchSpec.h"
|
||||||
#include "lldb/Core/UUID.h"
|
#include "lldb/Core/UUID.h"
|
||||||
#include "lldb/Host/FileSpec.h"
|
#include "lldb/Host/FileSpec.h"
|
||||||
#include "lldb/Host/Mutex.h"
|
#include "lldb/Host/Mutex.h"
|
||||||
#include "lldb/Host/TimeValue.h"
|
#include "lldb/Host/TimeValue.h"
|
||||||
#include "lldb/Symbol/ClangASTContext.h"
|
|
||||||
#include "lldb/Symbol/SymbolContextScope.h"
|
#include "lldb/Symbol/SymbolContextScope.h"
|
||||||
#include "lldb/Target/PathMappingList.h"
|
#include "lldb/Target/PathMappingList.h"
|
||||||
|
|
||||||
@ -941,17 +941,8 @@ class Module :
|
|||||||
const ConstString &object_name);
|
const ConstString &object_name);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
GetIsDynamicLinkEditor () const
|
GetIsDynamicLinkEditor ();
|
||||||
{
|
|
||||||
return m_is_dynamic_loader_module;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
SetIsDynamicLinkEditor (bool b)
|
|
||||||
{
|
|
||||||
m_is_dynamic_loader_module = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClangASTContext &
|
ClangASTContext &
|
||||||
GetClangASTContext ();
|
GetClangASTContext ();
|
||||||
|
|
||||||
@ -1107,7 +1098,7 @@ class Module :
|
|||||||
mutable Mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments.
|
mutable Mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments.
|
||||||
TimeValue m_mod_time; ///< The modification time for this module when it was created.
|
TimeValue m_mod_time; ///< The modification time for this module when it was created.
|
||||||
ArchSpec m_arch; ///< The architecture for this module.
|
ArchSpec m_arch; ///< The architecture for this module.
|
||||||
lldb_private::UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols.
|
UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols.
|
||||||
FileSpec m_file; ///< The file representation on disk for this module (if there is one).
|
FileSpec m_file; ///< The file representation on disk for this module (if there is one).
|
||||||
FileSpec m_platform_file;///< The path to the module on the platform on which it is being debugged
|
FileSpec m_platform_file;///< The path to the module on the platform on which it is being debugged
|
||||||
FileSpec m_remote_install_file; ///< If set when debugging on remote platforms, this module will be installed at this location
|
FileSpec m_remote_install_file; ///< If set when debugging on remote platforms, this module will be installed at this location
|
||||||
@ -1116,16 +1107,17 @@ class Module :
|
|||||||
uint64_t m_object_offset;
|
uint64_t m_object_offset;
|
||||||
TimeValue m_object_mod_time;
|
TimeValue m_object_mod_time;
|
||||||
lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile
|
lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile
|
||||||
std::unique_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module.
|
lldb::SymbolVendorUP m_symfile_ap; ///< A pointer to the symbol vendor for this module.
|
||||||
ClangASTContext m_ast; ///< The AST context for this module.
|
std::vector<lldb::SymbolVendorUP> m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file,
|
||||||
|
///< we need to keep all old symbol files around in case anyone has type references to them
|
||||||
|
lldb::ClangASTContextUP m_ast; ///< The AST context for this module.
|
||||||
PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are
|
PathMappingList m_source_mappings; ///< Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are
|
||||||
std::unique_ptr<lldb_private::SectionList> m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info
|
lldb::SectionListUP m_sections_ap; ///< Unified section list for module that is used by the ObjectFile and and ObjectFile instances for the debug info
|
||||||
|
|
||||||
bool m_did_load_objfile:1,
|
bool m_did_load_objfile:1,
|
||||||
m_did_load_symbol_vendor:1,
|
m_did_load_symbol_vendor:1,
|
||||||
m_did_parse_uuid:1,
|
m_did_parse_uuid:1,
|
||||||
m_did_init_ast:1,
|
m_did_init_ast:1;
|
||||||
m_is_dynamic_loader_module:1;
|
|
||||||
mutable bool m_file_has_changed:1,
|
mutable bool m_file_has_changed:1,
|
||||||
m_first_file_changed_log:1; /// See if the module was modified after it was initially opened.
|
m_first_file_changed_log:1; /// See if the module was modified after it was initially opened.
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include "lldb/lldb-private.h"
|
#include "lldb/lldb-private.h"
|
||||||
#include "lldb/Host/Mutex.h"
|
#include "lldb/Host/Mutex.h"
|
||||||
@ -562,6 +563,9 @@ class ModuleList
|
|||||||
static bool
|
static bool
|
||||||
RemoveSharedModuleIfOrphaned (const Module *module_ptr);
|
RemoveSharedModuleIfOrphaned (const Module *module_ptr);
|
||||||
|
|
||||||
|
void
|
||||||
|
ForEach (std::function <bool (const lldb::ModuleSP &module_sp)> const &callback) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
// Class typedefs.
|
// Class typedefs.
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "lldb/Core/Stream.h"
|
#include "lldb/Core/Stream.h"
|
||||||
#include "lldb/Core/UUID.h"
|
#include "lldb/Core/UUID.h"
|
||||||
#include "lldb/Host/FileSpec.h"
|
#include "lldb/Host/FileSpec.h"
|
||||||
|
#include "lldb/Host/Mutex.h"
|
||||||
#include "lldb/Target/PathMappingList.h"
|
#include "lldb/Target/PathMappingList.h"
|
||||||
|
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
@ -29,6 +30,7 @@ class ModuleSpec
|
|||||||
m_uuid (),
|
m_uuid (),
|
||||||
m_object_name (),
|
m_object_name (),
|
||||||
m_object_offset (0),
|
m_object_offset (0),
|
||||||
|
m_object_size (0),
|
||||||
m_object_mod_time (),
|
m_object_mod_time (),
|
||||||
m_source_mappings ()
|
m_source_mappings ()
|
||||||
{
|
{
|
||||||
@ -42,6 +44,7 @@ class ModuleSpec
|
|||||||
m_uuid (),
|
m_uuid (),
|
||||||
m_object_name (),
|
m_object_name (),
|
||||||
m_object_offset (0),
|
m_object_offset (0),
|
||||||
|
m_object_size (file_spec.GetByteSize ()),
|
||||||
m_object_mod_time (),
|
m_object_mod_time (),
|
||||||
m_source_mappings ()
|
m_source_mappings ()
|
||||||
{
|
{
|
||||||
@ -55,6 +58,7 @@ class ModuleSpec
|
|||||||
m_uuid (),
|
m_uuid (),
|
||||||
m_object_name (),
|
m_object_name (),
|
||||||
m_object_offset (0),
|
m_object_offset (0),
|
||||||
|
m_object_size (file_spec.GetByteSize ()),
|
||||||
m_object_mod_time (),
|
m_object_mod_time (),
|
||||||
m_source_mappings ()
|
m_source_mappings ()
|
||||||
{
|
{
|
||||||
@ -68,6 +72,7 @@ class ModuleSpec
|
|||||||
m_uuid (rhs.m_uuid),
|
m_uuid (rhs.m_uuid),
|
||||||
m_object_name (rhs.m_object_name),
|
m_object_name (rhs.m_object_name),
|
||||||
m_object_offset (rhs.m_object_offset),
|
m_object_offset (rhs.m_object_offset),
|
||||||
|
m_object_size (rhs.m_object_size),
|
||||||
m_object_mod_time (rhs.m_object_mod_time),
|
m_object_mod_time (rhs.m_object_mod_time),
|
||||||
m_source_mappings (rhs.m_source_mappings)
|
m_source_mappings (rhs.m_source_mappings)
|
||||||
{
|
{
|
||||||
@ -85,6 +90,7 @@ class ModuleSpec
|
|||||||
m_uuid = rhs.m_uuid;
|
m_uuid = rhs.m_uuid;
|
||||||
m_object_name = rhs.m_object_name;
|
m_object_name = rhs.m_object_name;
|
||||||
m_object_offset = rhs.m_object_offset;
|
m_object_offset = rhs.m_object_offset;
|
||||||
|
m_object_size = rhs.m_object_size;
|
||||||
m_object_mod_time = rhs.m_object_mod_time;
|
m_object_mod_time = rhs.m_object_mod_time;
|
||||||
m_source_mappings = rhs.m_source_mappings;
|
m_source_mappings = rhs.m_source_mappings;
|
||||||
}
|
}
|
||||||
@ -254,7 +260,19 @@ class ModuleSpec
|
|||||||
{
|
{
|
||||||
m_object_offset = object_offset;
|
m_object_offset = object_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
GetObjectSize () const
|
||||||
|
{
|
||||||
|
return m_object_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetObjectSize (uint64_t object_size)
|
||||||
|
{
|
||||||
|
m_object_size = object_size;
|
||||||
|
}
|
||||||
|
|
||||||
TimeValue &
|
TimeValue &
|
||||||
GetObjectModificationTime ()
|
GetObjectModificationTime ()
|
||||||
{
|
{
|
||||||
@ -283,6 +301,7 @@ class ModuleSpec
|
|||||||
m_uuid.Clear();
|
m_uuid.Clear();
|
||||||
m_object_name.Clear();
|
m_object_name.Clear();
|
||||||
m_object_offset = 0;
|
m_object_offset = 0;
|
||||||
|
m_object_size = 0;
|
||||||
m_source_mappings.Clear(false);
|
m_source_mappings.Clear(false);
|
||||||
m_object_mod_time.Clear();
|
m_object_mod_time.Clear();
|
||||||
}
|
}
|
||||||
@ -302,6 +321,8 @@ class ModuleSpec
|
|||||||
return true;
|
return true;
|
||||||
if (m_object_name)
|
if (m_object_name)
|
||||||
return true;
|
return true;
|
||||||
|
if (m_object_size)
|
||||||
|
return true;
|
||||||
if (m_object_mod_time.IsValid())
|
if (m_object_mod_time.IsValid())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -362,7 +383,14 @@ class ModuleSpec
|
|||||||
{
|
{
|
||||||
if (dumped_something)
|
if (dumped_something)
|
||||||
strm.PutCString(", ");
|
strm.PutCString(", ");
|
||||||
strm.Printf("object_offset = 0x%" PRIx64, m_object_offset);
|
strm.Printf("object_offset = %" PRIu64, m_object_offset);
|
||||||
|
dumped_something = true;
|
||||||
|
}
|
||||||
|
if (m_object_size > 0)
|
||||||
|
{
|
||||||
|
if (dumped_something)
|
||||||
|
strm.PutCString(", ");
|
||||||
|
strm.Printf("object size = %" PRIu64, m_object_size);
|
||||||
dumped_something = true;
|
dumped_something = true;
|
||||||
}
|
}
|
||||||
if (m_object_mod_time.IsValid())
|
if (m_object_mod_time.IsValid())
|
||||||
@ -425,6 +453,7 @@ class ModuleSpec
|
|||||||
UUID m_uuid;
|
UUID m_uuid;
|
||||||
ConstString m_object_name;
|
ConstString m_object_name;
|
||||||
uint64_t m_object_offset;
|
uint64_t m_object_offset;
|
||||||
|
uint64_t m_object_size;
|
||||||
TimeValue m_object_mod_time;
|
TimeValue m_object_mod_time;
|
||||||
mutable PathMappingList m_source_mappings;
|
mutable PathMappingList m_source_mappings;
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,8 @@ class PluginManager
|
|||||||
static bool
|
static bool
|
||||||
RegisterPlugin (const ConstString &name,
|
RegisterPlugin (const ConstString &name,
|
||||||
const char *description,
|
const char *description,
|
||||||
LanguageRuntimeCreateInstance create_callback);
|
LanguageRuntimeCreateInstance create_callback,
|
||||||
|
LanguageRuntimeGetCommandObject command_callback = nullptr);
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
UnregisterPlugin (LanguageRuntimeCreateInstance create_callback);
|
UnregisterPlugin (LanguageRuntimeCreateInstance create_callback);
|
||||||
@ -145,6 +146,9 @@ class PluginManager
|
|||||||
static LanguageRuntimeCreateInstance
|
static LanguageRuntimeCreateInstance
|
||||||
GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx);
|
GetLanguageRuntimeCreateCallbackAtIndex (uint32_t idx);
|
||||||
|
|
||||||
|
static LanguageRuntimeGetCommandObject
|
||||||
|
GetLanguageRuntimeGetCommandObjectAtIndex (uint32_t idx);
|
||||||
|
|
||||||
static LanguageRuntimeCreateInstance
|
static LanguageRuntimeCreateInstance
|
||||||
GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name);
|
GetLanguageRuntimeCreateCallbackForPluginName (const ConstString &name);
|
||||||
|
|
||||||
|
@ -128,9 +128,10 @@ namespace lldb_private {
|
|||||||
{
|
{
|
||||||
return Contains(range.GetRangeBase()) && ContainsEndInclusive(range.GetRangeEnd());
|
return Contains(range.GetRangeBase()) && ContainsEndInclusive(range.GetRangeEnd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if the two ranges adjoing or intersect
|
||||||
bool
|
bool
|
||||||
Overlap (const Range &rhs) const
|
DoesAdjoinOrIntersect (const Range &rhs) const
|
||||||
{
|
{
|
||||||
const BaseType lhs_base = this->GetRangeBase();
|
const BaseType lhs_base = this->GetRangeBase();
|
||||||
const BaseType rhs_base = rhs.GetRangeBase();
|
const BaseType rhs_base = rhs.GetRangeBase();
|
||||||
@ -139,7 +140,19 @@ namespace lldb_private {
|
|||||||
bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base);
|
bool result = (lhs_base <= rhs_end) && (lhs_end >= rhs_base);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if the two ranges intersect
|
||||||
|
bool
|
||||||
|
DoesIntersect (const Range &rhs) const
|
||||||
|
{
|
||||||
|
const BaseType lhs_base = this->GetRangeBase();
|
||||||
|
const BaseType rhs_base = rhs.GetRangeBase();
|
||||||
|
const BaseType lhs_end = this->GetRangeEnd();
|
||||||
|
const BaseType rhs_end = rhs.GetRangeEnd();
|
||||||
|
bool result = (lhs_base < rhs_end) && (lhs_end > rhs_base);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
operator < (const Range &rhs) const
|
operator < (const Range &rhs) const
|
||||||
{
|
{
|
||||||
@ -241,7 +254,7 @@ namespace lldb_private {
|
|||||||
// don't end up allocating and making a new collection for no reason
|
// don't end up allocating and making a new collection for no reason
|
||||||
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
||||||
{
|
{
|
||||||
if (prev != end && prev->Overlap(*pos))
|
if (prev != end && prev->DoesAdjoinOrIntersect(*pos))
|
||||||
{
|
{
|
||||||
can_combine = true;
|
can_combine = true;
|
||||||
break;
|
break;
|
||||||
@ -255,7 +268,7 @@ namespace lldb_private {
|
|||||||
Collection minimal_ranges;
|
Collection minimal_ranges;
|
||||||
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
||||||
{
|
{
|
||||||
if (prev != end && prev->Overlap(*pos))
|
if (prev != end && prev->DoesAdjoinOrIntersect(*pos))
|
||||||
minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));
|
minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));
|
||||||
else
|
else
|
||||||
minimal_ranges.push_back (*pos);
|
minimal_ranges.push_back (*pos);
|
||||||
@ -521,7 +534,7 @@ namespace lldb_private {
|
|||||||
// don't end up allocating and making a new collection for no reason
|
// don't end up allocating and making a new collection for no reason
|
||||||
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
||||||
{
|
{
|
||||||
if (prev != end && prev->Overlap(*pos))
|
if (prev != end && prev->DoesAdjoinOrIntersect(*pos))
|
||||||
{
|
{
|
||||||
can_combine = true;
|
can_combine = true;
|
||||||
break;
|
break;
|
||||||
@ -535,7 +548,7 @@ namespace lldb_private {
|
|||||||
Collection minimal_ranges;
|
Collection minimal_ranges;
|
||||||
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
for (pos = m_entries.begin(), end = m_entries.end(), prev = end; pos != end; prev = pos++)
|
||||||
{
|
{
|
||||||
if (prev != end && prev->Overlap(*pos))
|
if (prev != end && prev->DoesAdjoinOrIntersect(*pos))
|
||||||
minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));
|
minimal_ranges.back().SetRangeEnd (std::max<BaseType>(prev->GetRangeEnd(), pos->GetRangeEnd()));
|
||||||
else
|
else
|
||||||
minimal_ranges.push_back (*pos);
|
minimal_ranges.push_back (*pos);
|
||||||
|
@ -121,23 +121,6 @@ class RegularExpression
|
|||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
RegularExpression ();
|
RegularExpression ();
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
/// Constructor that takes a regular expression with flags.
|
|
||||||
///
|
|
||||||
/// Constructor that compiles \a re using \a flags and stores the
|
|
||||||
/// resulting compiled regular expression into this object.
|
|
||||||
///
|
|
||||||
/// @param[in] re
|
|
||||||
/// A c string that represents the regular expression to
|
|
||||||
/// compile.
|
|
||||||
///
|
|
||||||
/// @param[in] flags
|
|
||||||
/// Flags that are passed to the \c regcomp() function.
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
explicit
|
|
||||||
RegularExpression (const char* re, int flags);
|
|
||||||
|
|
||||||
// This one uses flags = REG_EXTENDED.
|
|
||||||
explicit
|
explicit
|
||||||
RegularExpression (const char* re);
|
RegularExpression (const char* re);
|
||||||
|
|
||||||
@ -157,7 +140,7 @@ class RegularExpression
|
|||||||
/// Compile a regular expression.
|
/// Compile a regular expression.
|
||||||
///
|
///
|
||||||
/// Compile a regular expression using the supplied regular
|
/// Compile a regular expression using the supplied regular
|
||||||
/// expression text and flags. The compiled regular expression lives
|
/// expression text. The compiled regular expression lives
|
||||||
/// in this object so that it can be readily used for regular
|
/// in this object so that it can be readily used for regular
|
||||||
/// expression matches. Execute() can be called after the regular
|
/// expression matches. Execute() can be called after the regular
|
||||||
/// expression is compiled. Any previously compiled regular
|
/// expression is compiled. Any previously compiled regular
|
||||||
@ -167,9 +150,6 @@ class RegularExpression
|
|||||||
/// A NULL terminated C string that represents the regular
|
/// A NULL terminated C string that represents the regular
|
||||||
/// expression to compile.
|
/// expression to compile.
|
||||||
///
|
///
|
||||||
/// @param[in] flags
|
|
||||||
/// Flags that are passed to the \c regcomp() function.
|
|
||||||
///
|
|
||||||
/// @return
|
/// @return
|
||||||
/// \b true if the regular expression compiles successfully,
|
/// \b true if the regular expression compiles successfully,
|
||||||
/// \b false otherwise.
|
/// \b false otherwise.
|
||||||
@ -177,9 +157,6 @@ class RegularExpression
|
|||||||
bool
|
bool
|
||||||
Compile (const char* re);
|
Compile (const char* re);
|
||||||
|
|
||||||
bool
|
|
||||||
Compile (const char* re, int flags);
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Executes a regular expression.
|
/// Executes a regular expression.
|
||||||
///
|
///
|
||||||
@ -187,8 +164,7 @@ class RegularExpression
|
|||||||
/// expression that is already in this object against the match
|
/// expression that is already in this object against the match
|
||||||
/// string \a s. If any parens are used for regular expression
|
/// string \a s. If any parens are used for regular expression
|
||||||
/// matches \a match_count should indicate the number of regmatch_t
|
/// matches \a match_count should indicate the number of regmatch_t
|
||||||
/// values that are present in \a match_ptr. The regular expression
|
/// values that are present in \a match_ptr.
|
||||||
/// will be executed using the \a execute_flags
|
|
||||||
///
|
///
|
||||||
/// @param[in] string
|
/// @param[in] string
|
||||||
/// The string to match against the compile regular expression.
|
/// The string to match against the compile regular expression.
|
||||||
@ -198,15 +174,12 @@ class RegularExpression
|
|||||||
/// properly initialized with the desired number of maximum
|
/// properly initialized with the desired number of maximum
|
||||||
/// matches, or NULL if no parenthesized matching is needed.
|
/// matches, or NULL if no parenthesized matching is needed.
|
||||||
///
|
///
|
||||||
/// @param[in] execute_flags
|
|
||||||
/// Flags to pass to the \c regexec() function.
|
|
||||||
///
|
|
||||||
/// @return
|
/// @return
|
||||||
/// \b true if \a string matches the compiled regular
|
/// \b true if \a string matches the compiled regular
|
||||||
/// expression, \b false otherwise.
|
/// expression, \b false otherwise.
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
Execute (const char* string, Match *match = NULL, int execute_flags = 0) const;
|
Execute (const char* string, Match *match = NULL) const;
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
GetErrorAsCString (char *err_str, size_t err_str_max_len) const;
|
GetErrorAsCString (char *err_str, size_t err_str_max_len) const;
|
||||||
@ -233,12 +206,6 @@ class RegularExpression
|
|||||||
const char*
|
const char*
|
||||||
GetText () const;
|
GetText () const;
|
||||||
|
|
||||||
int
|
|
||||||
GetCompileFlags () const
|
|
||||||
{
|
|
||||||
return m_compile_flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
/// Test if valid.
|
/// Test if valid.
|
||||||
///
|
///
|
||||||
@ -256,7 +223,6 @@ class RegularExpression
|
|||||||
{
|
{
|
||||||
Free();
|
Free();
|
||||||
m_re.clear();
|
m_re.clear();
|
||||||
m_compile_flags = 0;
|
|
||||||
m_comp_err = 1;
|
m_comp_err = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +242,6 @@ class RegularExpression
|
|||||||
std::string m_re; ///< A copy of the original regular expression text
|
std::string m_re; ///< A copy of the original regular expression text
|
||||||
int m_comp_err; ///< Error code for the regular expression compilation
|
int m_comp_err; ///< Error code for the regular expression compilation
|
||||||
regex_t m_preg; ///< The compiled regular expression
|
regex_t m_preg; ///< The compiled regular expression
|
||||||
int m_compile_flags; ///< Stores the flags from the last compile.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace lldb_private
|
} // namespace lldb_private
|
||||||
|
@ -20,7 +20,7 @@ class StreamAsynchronousIO :
|
|||||||
public Stream
|
public Stream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
StreamAsynchronousIO (Broadcaster &broadcaster, uint32_t broadcast_event_type);
|
StreamAsynchronousIO (Debugger &debugger, bool for_stdout);
|
||||||
|
|
||||||
virtual ~StreamAsynchronousIO ();
|
virtual ~StreamAsynchronousIO ();
|
||||||
|
|
||||||
@ -32,9 +32,9 @@ class StreamAsynchronousIO :
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Broadcaster &m_broadcaster;
|
Debugger &m_debugger;
|
||||||
uint32_t m_broadcast_event_type;
|
std::string m_data;
|
||||||
std::string m_accumulated_data;
|
bool m_for_stdout;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace lldb_private
|
} // namespace lldb_private
|
||||||
|
@ -37,6 +37,10 @@ class StreamFile : public Stream
|
|||||||
|
|
||||||
StreamFile (const char *path);
|
StreamFile (const char *path);
|
||||||
|
|
||||||
|
StreamFile (const char *path,
|
||||||
|
uint32_t options,
|
||||||
|
uint32_t permissions = lldb::eFilePermissionsFileDefault);
|
||||||
|
|
||||||
StreamFile (FILE *fh, bool transfer_ownership);
|
StreamFile (FILE *fh, bool transfer_ownership);
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "lldb/Core/STLUtils.h"
|
#include "lldb/Core/STLUtils.h"
|
||||||
#include "lldb/lldb-forward.h"
|
#include "lldb/lldb-forward.h"
|
||||||
|
#include "llvm/ADT/StringRef.h"
|
||||||
|
|
||||||
namespace lldb_private {
|
namespace lldb_private {
|
||||||
|
|
||||||
@ -42,6 +43,9 @@ class StringList
|
|||||||
void
|
void
|
||||||
AppendString (const char *str, size_t str_len);
|
AppendString (const char *str, size_t str_len);
|
||||||
|
|
||||||
|
void
|
||||||
|
AppendString(llvm::StringRef str);
|
||||||
|
|
||||||
void
|
void
|
||||||
AppendList (const char ** strv, int strc);
|
AppendList (const char ** strv, int strc);
|
||||||
|
|
||||||
|
@ -13,10 +13,11 @@
|
|||||||
// C Includes
|
// C Includes
|
||||||
// C++ Includes
|
// C++ Includes
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
|
|
||||||
@ -54,14 +55,22 @@ class StructuredData
|
|||||||
class Boolean;
|
class Boolean;
|
||||||
class String;
|
class String;
|
||||||
class Dictionary;
|
class Dictionary;
|
||||||
|
class Generic;
|
||||||
|
|
||||||
typedef std::shared_ptr<Object> ObjectSP;
|
typedef std::shared_ptr<Object> ObjectSP;
|
||||||
typedef std::shared_ptr<Array> ArraySP;
|
typedef std::shared_ptr<Array> ArraySP;
|
||||||
|
typedef std::shared_ptr<Integer> IntegerSP;
|
||||||
|
typedef std::shared_ptr<Float> FloatSP;
|
||||||
|
typedef std::shared_ptr<Boolean> BooleanSP;
|
||||||
|
typedef std::shared_ptr<String> StringSP;
|
||||||
typedef std::shared_ptr<Dictionary> DictionarySP;
|
typedef std::shared_ptr<Dictionary> DictionarySP;
|
||||||
|
typedef std::shared_ptr<Generic> GenericSP;
|
||||||
|
|
||||||
enum class Type {
|
enum class Type
|
||||||
|
{
|
||||||
eTypeInvalid = -1,
|
eTypeInvalid = -1,
|
||||||
eTypeNull = 0,
|
eTypeNull = 0,
|
||||||
|
eTypeGeneric,
|
||||||
eTypeArray,
|
eTypeArray,
|
||||||
eTypeInteger,
|
eTypeInteger,
|
||||||
eTypeFloat,
|
eTypeFloat,
|
||||||
@ -84,6 +93,12 @@ class StructuredData
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool
|
||||||
|
IsValid() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
Clear ()
|
Clear ()
|
||||||
{
|
{
|
||||||
@ -126,6 +141,15 @@ class StructuredData
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
GetIntegerValue (uint64_t fail_value = 0)
|
||||||
|
{
|
||||||
|
Integer *integer = GetAsInteger ();
|
||||||
|
if (integer)
|
||||||
|
return integer->GetValue();
|
||||||
|
return fail_value;
|
||||||
|
}
|
||||||
|
|
||||||
Float *
|
Float *
|
||||||
GetAsFloat ()
|
GetAsFloat ()
|
||||||
{
|
{
|
||||||
@ -134,6 +158,15 @@ class StructuredData
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double
|
||||||
|
GetFloatValue (double fail_value = 0.0)
|
||||||
|
{
|
||||||
|
Float *f = GetAsFloat ();
|
||||||
|
if (f)
|
||||||
|
return f->GetValue();
|
||||||
|
return fail_value;
|
||||||
|
}
|
||||||
|
|
||||||
Boolean *
|
Boolean *
|
||||||
GetAsBoolean ()
|
GetAsBoolean ()
|
||||||
{
|
{
|
||||||
@ -142,6 +175,15 @@ class StructuredData
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetBooleanValue (bool fail_value = false)
|
||||||
|
{
|
||||||
|
Boolean *b = GetAsBoolean ();
|
||||||
|
if (b)
|
||||||
|
return b->GetValue();
|
||||||
|
return fail_value;
|
||||||
|
}
|
||||||
|
|
||||||
String *
|
String *
|
||||||
GetAsString ()
|
GetAsString ()
|
||||||
{
|
{
|
||||||
@ -150,9 +192,32 @@ class StructuredData
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
GetStringValue(const char *fail_value = NULL)
|
||||||
|
{
|
||||||
|
String *s = GetAsString ();
|
||||||
|
if (s)
|
||||||
|
return s->GetValue();
|
||||||
|
|
||||||
|
if (fail_value && fail_value[0])
|
||||||
|
return std::string(fail_value);
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
Generic *
|
||||||
|
GetAsGeneric()
|
||||||
|
{
|
||||||
|
if (m_type == Type::eTypeGeneric)
|
||||||
|
return (Generic *)this;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ObjectSP
|
ObjectSP
|
||||||
GetObjectForDotSeparatedPath (llvm::StringRef path);
|
GetObjectForDotSeparatedPath (llvm::StringRef path);
|
||||||
|
|
||||||
|
void DumpToStdout() const;
|
||||||
|
|
||||||
virtual void
|
virtual void
|
||||||
Dump (Stream &s) const = 0;
|
Dump (Stream &s) const = 0;
|
||||||
|
|
||||||
@ -173,8 +238,19 @@ class StructuredData
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ForEach (std::function <bool(Object* object)> const &foreach_callback) const
|
||||||
|
{
|
||||||
|
for (const auto &object_sp : m_items)
|
||||||
|
{
|
||||||
|
if (foreach_callback(object_sp.get()) == false)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
GetSize()
|
GetSize() const
|
||||||
{
|
{
|
||||||
return m_items.size();
|
return m_items.size();
|
||||||
}
|
}
|
||||||
@ -188,13 +264,97 @@ class StructuredData
|
|||||||
}
|
}
|
||||||
|
|
||||||
ObjectSP
|
ObjectSP
|
||||||
GetItemAtIndex (size_t idx)
|
GetItemAtIndex(size_t idx) const
|
||||||
{
|
{
|
||||||
|
assert(idx < GetSize());
|
||||||
if (idx < m_items.size())
|
if (idx < m_items.size())
|
||||||
return m_items[idx];
|
return m_items[idx];
|
||||||
return ObjectSP();
|
return ObjectSP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class IntType>
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsInteger(size_t idx, IntType &result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetItemAtIndex(idx);
|
||||||
|
if (auto int_value = value->GetAsInteger())
|
||||||
|
{
|
||||||
|
result = static_cast<IntType>(int_value->GetValue());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class IntType>
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsInteger(size_t idx, IntType &result, IntType default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetItemAtIndexAsInteger(idx, result);
|
||||||
|
if (!success)
|
||||||
|
result = default_val;
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsString(size_t idx, std::string &result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetItemAtIndex(idx);
|
||||||
|
if (auto string_value = value->GetAsString())
|
||||||
|
{
|
||||||
|
result = string_value->GetValue();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsString(size_t idx, std::string &result, const std::string &default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetItemAtIndexAsString(idx, result);
|
||||||
|
if (!success)
|
||||||
|
result = default_val;
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsString(size_t idx, ConstString &result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetItemAtIndex(idx);
|
||||||
|
if (!value)
|
||||||
|
return false;
|
||||||
|
if (auto string_value = value->GetAsString())
|
||||||
|
{
|
||||||
|
result = ConstString(string_value->GetValue());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsString(size_t idx, ConstString &result, const char *default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetItemAtIndexAsString(idx, result);
|
||||||
|
if (!success)
|
||||||
|
result.SetCString(default_val);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsDictionary(size_t idx, Dictionary *&result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetItemAtIndex(idx);
|
||||||
|
result = value->GetAsDictionary();
|
||||||
|
return (result != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetItemAtIndexAsArray(size_t idx, Array *&result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetItemAtIndex(idx);
|
||||||
|
result = value->GetAsArray();
|
||||||
|
return (result != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Push(ObjectSP item)
|
Push(ObjectSP item)
|
||||||
{
|
{
|
||||||
@ -207,8 +367,7 @@ class StructuredData
|
|||||||
m_items.push_back(item);
|
m_items.push_back(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef std::vector<ObjectSP> collection;
|
typedef std::vector<ObjectSP> collection;
|
||||||
@ -219,9 +378,9 @@ class StructuredData
|
|||||||
class Integer : public Object
|
class Integer : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Integer () :
|
Integer (uint64_t i = 0) :
|
||||||
Object (Type::eTypeInteger),
|
Object (Type::eTypeInteger),
|
||||||
m_value ()
|
m_value (i)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,8 +400,7 @@ class StructuredData
|
|||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t m_value;
|
uint64_t m_value;
|
||||||
@ -251,9 +409,9 @@ class StructuredData
|
|||||||
class Float : public Object
|
class Float : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Float () :
|
Float (double d = 0.0) :
|
||||||
Object (Type::eTypeFloat),
|
Object (Type::eTypeFloat),
|
||||||
m_value ()
|
m_value (d)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,8 +431,7 @@ class StructuredData
|
|||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
double m_value;
|
double m_value;
|
||||||
@ -283,9 +440,9 @@ class StructuredData
|
|||||||
class Boolean : public Object
|
class Boolean : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Boolean () :
|
Boolean (bool b = false) :
|
||||||
Object (Type::eTypeBoolean),
|
Object (Type::eTypeBoolean),
|
||||||
m_value ()
|
m_value (b)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,8 +462,7 @@ class StructuredData
|
|||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_value;
|
bool m_value;
|
||||||
@ -317,26 +473,39 @@ class StructuredData
|
|||||||
class String : public Object
|
class String : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
String () :
|
String (const char *cstr = NULL) :
|
||||||
Object (Type::eTypeString),
|
Object (Type::eTypeString),
|
||||||
m_value ()
|
m_value ()
|
||||||
|
{
|
||||||
|
if (cstr)
|
||||||
|
m_value = cstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
String (const std::string &s) :
|
||||||
|
Object (Type::eTypeString),
|
||||||
|
m_value (s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
String (const std::string &&s) :
|
||||||
|
Object (Type::eTypeString),
|
||||||
|
m_value (s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SetValue (std::string string)
|
SetValue (const std::string &string)
|
||||||
{
|
{
|
||||||
m_value = string;
|
m_value = string;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
const std::string &
|
||||||
GetValue ()
|
GetValue ()
|
||||||
{
|
{
|
||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string m_value;
|
std::string m_value;
|
||||||
@ -345,6 +514,7 @@ class StructuredData
|
|||||||
class Dictionary : public Object
|
class Dictionary : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Dictionary () :
|
Dictionary () :
|
||||||
Object (Type::eTypeDictionary),
|
Object (Type::eTypeDictionary),
|
||||||
m_dict ()
|
m_dict ()
|
||||||
@ -354,14 +524,25 @@ class StructuredData
|
|||||||
virtual ~Dictionary()
|
virtual ~Dictionary()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
GetSize()
|
GetSize() const
|
||||||
{
|
{
|
||||||
return m_dict.size();
|
return m_dict.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ForEach (std::function <bool(ConstString key, Object* object)> const &callback) const
|
||||||
|
{
|
||||||
|
for (const auto &pair : m_dict)
|
||||||
|
{
|
||||||
|
if (callback (pair.first, pair.second.get()) == false)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ObjectSP
|
ObjectSP
|
||||||
GetKeys()
|
GetKeys() const
|
||||||
{
|
{
|
||||||
ObjectSP object_sp(new Array ());
|
ObjectSP object_sp(new Array ());
|
||||||
Array *array = object_sp->GetAsArray();
|
Array *array = object_sp->GetAsArray();
|
||||||
@ -376,10 +557,10 @@ class StructuredData
|
|||||||
}
|
}
|
||||||
|
|
||||||
ObjectSP
|
ObjectSP
|
||||||
GetValueForKey (const char *key)
|
GetValueForKey(llvm::StringRef key) const
|
||||||
{
|
{
|
||||||
ObjectSP value_sp;
|
ObjectSP value_sp;
|
||||||
if (key)
|
if (!key.empty())
|
||||||
{
|
{
|
||||||
ConstString key_cs(key);
|
ConstString key_cs(key);
|
||||||
for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter)
|
for (collection::const_iterator iter = m_dict.begin(); iter != m_dict.end(); ++iter)
|
||||||
@ -394,62 +575,144 @@ class StructuredData
|
|||||||
return value_sp;
|
return value_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class IntType>
|
||||||
bool
|
bool
|
||||||
HasKey (const char *key)
|
GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
|
||||||
{
|
{
|
||||||
ConstString key_cs (key);
|
ObjectSP value = GetValueForKey(key);
|
||||||
collection::const_iterator search = m_dict.find(key_cs);
|
if (!value)
|
||||||
if (search != m_dict.end())
|
return false;
|
||||||
|
if (auto int_value = value->GetAsInteger())
|
||||||
{
|
{
|
||||||
|
result = static_cast<IntType>(int_value->GetValue());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
return false;
|
||||||
{
|
}
|
||||||
|
|
||||||
|
template <class IntType>
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsInteger(llvm::StringRef key, IntType &result, IntType default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetValueForKeyAsInteger<IntType>(key, result);
|
||||||
|
if (!success)
|
||||||
|
result = default_val;
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsString(llvm::StringRef key, std::string &result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetValueForKey(key);
|
||||||
|
if (!value)
|
||||||
return false;
|
return false;
|
||||||
|
if (auto string_value = value->GetAsString())
|
||||||
|
{
|
||||||
|
result = string_value->GetValue();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsString(llvm::StringRef key, std::string &result, const char *default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetValueForKeyAsString(key, result);
|
||||||
|
if (!success)
|
||||||
|
{
|
||||||
|
if (default_val)
|
||||||
|
result = default_val;
|
||||||
|
else
|
||||||
|
result.clear();
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsString(llvm::StringRef key, ConstString &result) const
|
||||||
|
{
|
||||||
|
ObjectSP value = GetValueForKey(key);
|
||||||
|
if (!value)
|
||||||
|
return false;
|
||||||
|
if (auto string_value = value->GetAsString())
|
||||||
|
{
|
||||||
|
result = ConstString(string_value->GetValue());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsString(llvm::StringRef key, ConstString &result, const char *default_val) const
|
||||||
|
{
|
||||||
|
bool success = GetValueForKeyAsString(key, result);
|
||||||
|
if (!success)
|
||||||
|
result.SetCString(default_val);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsDictionary(llvm::StringRef key, Dictionary *&result) const
|
||||||
|
{
|
||||||
|
result = nullptr;
|
||||||
|
ObjectSP value = GetValueForKey(key);
|
||||||
|
if (!value)
|
||||||
|
return false;
|
||||||
|
result = value->GetAsDictionary();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
|
||||||
|
{
|
||||||
|
result = nullptr;
|
||||||
|
ObjectSP value = GetValueForKey(key);
|
||||||
|
if (!value)
|
||||||
|
return false;
|
||||||
|
result = value->GetAsArray();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
HasKey(llvm::StringRef key) const
|
||||||
|
{
|
||||||
|
ConstString key_cs(key);
|
||||||
|
collection::const_iterator search = m_dict.find(key_cs);
|
||||||
|
return search != m_dict.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddItem (const char *key, ObjectSP value)
|
AddItem (llvm::StringRef key, ObjectSP value)
|
||||||
{
|
{
|
||||||
ConstString key_cs(key);
|
ConstString key_cs(key);
|
||||||
m_dict[key_cs] = value;
|
m_dict[key_cs] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddIntegerItem (const char *key, uint64_t value)
|
AddIntegerItem (llvm::StringRef key, uint64_t value)
|
||||||
{
|
{
|
||||||
ObjectSP val_obj (new Integer());
|
AddItem (key, ObjectSP (new Integer(value)));
|
||||||
val_obj->GetAsInteger()->SetValue (value);
|
|
||||||
AddItem (key, val_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddFloatItem (const char *key, double value)
|
AddFloatItem (llvm::StringRef key, double value)
|
||||||
{
|
{
|
||||||
ObjectSP val_obj (new Float());
|
AddItem (key, ObjectSP (new Float(value)));
|
||||||
val_obj->GetAsFloat()->SetValue (value);
|
|
||||||
AddItem (key, val_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddStringItem (const char *key, std::string value)
|
AddStringItem (llvm::StringRef key, std::string value)
|
||||||
{
|
{
|
||||||
ObjectSP val_obj (new String());
|
AddItem (key, ObjectSP (new String(std::move(value))));
|
||||||
val_obj->GetAsString()->SetValue (value);
|
|
||||||
AddItem (key, val_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddBooleanItem (const char *key, bool value)
|
AddBooleanItem (llvm::StringRef key, bool value)
|
||||||
{
|
{
|
||||||
ObjectSP val_obj (new Boolean());
|
AddItem (key, ObjectSP (new Boolean(value)));
|
||||||
val_obj->GetAsBoolean()->SetValue (value);
|
|
||||||
AddItem (key, val_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
void Dump(Stream &s) const override;
|
||||||
Dump (Stream &s) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef std::map<ConstString, ObjectSP> collection;
|
typedef std::map<ConstString, ObjectSP> collection;
|
||||||
@ -468,12 +731,49 @@ class StructuredData
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void
|
bool
|
||||||
Dump (Stream &s) const;
|
IsValid() const override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Dump(Stream &s) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Generic : public Object
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit Generic(void *object = nullptr) :
|
||||||
|
Object (Type::eTypeGeneric),
|
||||||
|
m_object (object)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SetValue(void *value)
|
||||||
|
{
|
||||||
|
m_object = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void *
|
||||||
|
GetValue() const
|
||||||
|
{
|
||||||
|
return m_object;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
IsValid() const override
|
||||||
|
{
|
||||||
|
return m_object != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Dump(Stream &s) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void *m_object;
|
||||||
|
};
|
||||||
|
|
||||||
static ObjectSP
|
static ObjectSP
|
||||||
ParseJSON (std::string json_text);
|
ParseJSON (std::string json_text);
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
//===-- ThreadSafeDenseSet.h ------------------------------------------*- C++ -*-===//
|
||||||
|
//
|
||||||
|
// The LLVM Compiler Infrastructure
|
||||||
|
//
|
||||||
|
// This file is distributed under the University of Illinois Open Source
|
||||||
|
// License. See LICENSE.TXT for details.
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#ifndef liblldb_ThreadSafeDenseSet_h_
|
||||||
|
#define liblldb_ThreadSafeDenseSet_h_
|
||||||
|
|
||||||
|
// C Includes
|
||||||
|
// C++ Includes
|
||||||
|
|
||||||
|
// Other libraries and framework includes
|
||||||
|
#include "llvm/ADT/DenseSet.h"
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include "lldb/Host/Mutex.h"
|
||||||
|
|
||||||
|
namespace lldb_private {
|
||||||
|
|
||||||
|
template <typename _ElementType>
|
||||||
|
class ThreadSafeDenseSet
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef llvm::DenseSet<_ElementType> LLVMSetType;
|
||||||
|
|
||||||
|
ThreadSafeDenseSet(unsigned set_initial_capacity = 0,
|
||||||
|
Mutex::Type mutex_type = Mutex::eMutexTypeNormal) :
|
||||||
|
m_set(set_initial_capacity),
|
||||||
|
m_mutex(mutex_type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Insert (_ElementType e)
|
||||||
|
{
|
||||||
|
Mutex::Locker locker(m_mutex);
|
||||||
|
m_set.insert(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Erase (_ElementType e)
|
||||||
|
{
|
||||||
|
Mutex::Locker locker(m_mutex);
|
||||||
|
m_set.erase(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Lookup (_ElementType e)
|
||||||
|
{
|
||||||
|
Mutex::Locker locker(m_mutex);
|
||||||
|
return (m_set.count(e) > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LLVMSetType m_set;
|
||||||
|
Mutex m_mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace lldb_private
|
||||||
|
|
||||||
|
#endif // liblldb_ThreadSafeDenseSet_h_
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user