Author: ovyalov Date: Sun Feb 15 18:04:19 2015 New Revision: 229346 URL: http://llvm.org/viewvc/llvm-project?rev=229346&view=rev Log: Extract SBAttachInfo into own set of files - SBAttachInfo.h, SBAttachInfo.cpp and SBAttachInfo.i.
Added: lldb/trunk/include/lldb/API/SBAttachInfo.h lldb/trunk/scripts/Python/interface/SBAttachInfo.i lldb/trunk/source/API/SBAttachInfo.cpp Modified: lldb/trunk/include/lldb/API/SBTarget.h lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/scripts/Python/build-swig-Python.sh lldb/trunk/scripts/Python/buildSwigPython.py lldb/trunk/scripts/Python/interface/SBTarget.i lldb/trunk/scripts/lldb.swig lldb/trunk/source/API/CMakeLists.txt lldb/trunk/source/API/SBTarget.cpp lldb/trunk/source/CMakeLists.txt Added: lldb/trunk/include/lldb/API/SBAttachInfo.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBAttachInfo.h?rev=229346&view=auto ============================================================================== --- lldb/trunk/include/lldb/API/SBAttachInfo.h (added) +++ lldb/trunk/include/lldb/API/SBAttachInfo.h Sun Feb 15 18:04:19 2015 @@ -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 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_ Modified: lldb/trunk/include/lldb/API/SBTarget.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBTarget.h (original) +++ lldb/trunk/include/lldb/API/SBTarget.h Sun Feb 15 18:04:19 2015 @@ -12,6 +12,7 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBAddress.h" +#include "lldb/API/SBAttachInfo.h" #include "lldb/API/SBBroadcaster.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBFileSpecList.h" @@ -25,134 +26,6 @@ namespace lldb { class SBPlatform; -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: Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Sun Feb 15 18:04:19 2015 @@ -94,6 +94,8 @@ 25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; }; 254FBB951A81AA7F00BD6378 /* SBLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */; }; 254FBB971A81B03100BD6378 /* SBLaunchInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 254FBBA31A9166F100BD6378 /* SBAttachInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 254FBBA51A91670E00BD6378 /* SBAttachInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */; }; 260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; }; 260157C71885F52500F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; }; 260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; }; @@ -1224,6 +1226,9 @@ 254FBB921A81AA5200BD6378 /* SBLaunchInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLaunchInfo.i; sourceTree = "<group>"; }; 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLaunchInfo.cpp; path = source/API/SBLaunchInfo.cpp; sourceTree = "<group>"; }; 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLaunchInfo.h; path = include/lldb/API/SBLaunchInfo.h; sourceTree = "<group>"; }; + 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAttachInfo.h; path = include/lldb/API/SBAttachInfo.h; sourceTree = "<group>"; }; + 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBAttachInfo.cpp; path = source/API/SBAttachInfo.cpp; sourceTree = "<group>"; }; + 254FBBA61A91672800BD6378 /* SBAttachInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAttachInfo.i; sourceTree = "<group>"; }; 260157C41885F4FF00F875CF /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = /usr/lib/libpanel.dylib; sourceTree = "<absolute>"; }; 260223E7115F06D500A601A2 /* SBCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommunication.h; path = include/lldb/API/SBCommunication.h; sourceTree = "<group>"; }; 260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; }; @@ -3129,6 +3134,7 @@ 2611FEEE142D83060017FEA3 /* interface */ = { isa = PBXGroup; children = ( + 254FBBA61A91672800BD6378 /* SBAttachInfo.i */, 254FBB921A81AA5200BD6378 /* SBLaunchInfo.i */, 2611FEEF142D83060017FEA3 /* SBAddress.i */, 2611FEF0142D83060017FEA3 /* SBBlock.i */, @@ -3200,6 +3206,8 @@ 262D3190111B4341004E6F88 /* API */ = { isa = PBXGroup; children = ( + 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */, + 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */, 2611FEEE142D83060017FEA3 /* interface */, 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */, 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */, @@ -5177,6 +5185,7 @@ 9443B123140C26AB0013457C /* SBData.h in Headers */, 26680220115FD13D008E1FE4 /* SBDebugger.h in Headers */, 490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */, + 254FBBA31A9166F100BD6378 /* SBAttachInfo.h in Headers */, 26680221115FD13D008E1FE4 /* SBDefines.h in Headers */, 8CCB018219BA4E270009FD44 /* SBThreadCollection.h in Headers */, AF0EBBEC185941360059E52F /* SBQueue.h in Headers */, @@ -5827,6 +5836,7 @@ 9443B122140C18C40013457C /* SBData.cpp in Sources */, 4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */, 23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */, + 254FBBA51A91670E00BD6378 /* SBAttachInfo.cpp in Sources */, 4C56543719D22B32002E9C44 /* SBThreadPlan.cpp in Sources */, 8CCB018319BA51BF0009FD44 /* SBThreadCollection.cpp in Sources */, 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */, Modified: lldb/trunk/scripts/Python/build-swig-Python.sh URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/build-swig-Python.sh?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/scripts/Python/build-swig-Python.sh (original) +++ lldb/trunk/scripts/Python/build-swig-Python.sh Sun Feb 15 18:04:19 2015 @@ -79,6 +79,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/l " ${SRC_ROOT}/include/lldb/lldb-forward-rtti.h"\ " ${SRC_ROOT}/include/lldb/lldb-types.h"\ " ${SRC_ROOT}/include/lldb/API/SBAddress.h"\ +" ${SRC_ROOT}/include/lldb/API/SBAttachInfo.h"\ " ${SRC_ROOT}/include/lldb/API/SBBlock.h"\ " ${SRC_ROOT}/include/lldb/API/SBBreakpoint.h"\ " ${SRC_ROOT}/include/lldb/API/SBBreakpointLocation.h"\ @@ -131,6 +132,7 @@ HEADER_FILES="${SRC_ROOT}/include/lldb/l " ${SRC_ROOT}/include/lldb/API/SBUnixSignals.h" INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\ +" ${SRC_ROOT}/scripts/Python/interface/SBAttachInfo.i"\ " ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\ " ${SRC_ROOT}/scripts/Python/interface/SBBreakpoint.i"\ " ${SRC_ROOT}/scripts/Python/interface/SBBreakpointLocation.i"\ Modified: lldb/trunk/scripts/Python/buildSwigPython.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/buildSwigPython.py?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/scripts/Python/buildSwigPython.py (original) +++ lldb/trunk/scripts/Python/buildSwigPython.py Sun Feb 15 18:04:19 2015 @@ -81,6 +81,7 @@ def get_header_files( vDictArgs ): "/include/lldb/lldb-forward-rtti.h", "/include/lldb/lldb-types.h", "/include/lldb/API/SBAddress.h", + "/include/lldb/API/SBAttachInfo.h", "/include/lldb/API/SBBlock.h", "/include/lldb/API/SBBreakpoint.h", "/include/lldb/API/SBBreakpointLocation.h", @@ -157,6 +158,7 @@ def get_header_files( vDictArgs ): def get_interface_files( vDictArgs ): dbg = utilsDebug.CDebugFnVerbose( "Python script get_interface_files()" ); listIFaceFiles = [ "/scripts/Python/interface/SBAddress.i", + "/scripts/Python/interface/SBAttachInfo.i", "/scripts/Python/interface/SBBlock.i", "/scripts/Python/interface/SBBreakpoint.i", "/scripts/Python/interface/SBBreakpointLocation.i", Added: lldb/trunk/scripts/Python/interface/SBAttachInfo.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBAttachInfo.i?rev=229346&view=auto ============================================================================== --- lldb/trunk/scripts/Python/interface/SBAttachInfo.i (added) +++ lldb/trunk/scripts/Python/interface/SBAttachInfo.i Sun Feb 15 18:04:19 2015 @@ -0,0 +1,111 @@ +//===-- SWIG Interface for SBAttachInfo--------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +namespace lldb { + +class SBAttachInfo +{ +public: + SBAttachInfo (); + + SBAttachInfo (lldb::pid_t pid); + + SBAttachInfo (const char *path, bool wait_for); + + SBAttachInfo (const lldb::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(); + + lldb::SBListener + GetListener (); + + void + SetListener (lldb::SBListener &listener); +}; + +} // namespace lldb Modified: lldb/trunk/scripts/Python/interface/SBTarget.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTarget.i?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/scripts/Python/interface/SBTarget.i (original) +++ lldb/trunk/scripts/Python/interface/SBTarget.i Sun Feb 15 18:04:19 2015 @@ -9,106 +9,7 @@ namespace lldb { -class SBAttachInfo -{ -public: - SBAttachInfo (); - - SBAttachInfo (lldb::pid_t pid); - - SBAttachInfo (const char *path, bool wait_for); - - SBAttachInfo (const lldb::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(); - - lldb::SBListener - GetListener (); - - void - SetListener (lldb::SBListener &listener); -}; - - %feature("docstring", "Represents the target program running under the debugger. Modified: lldb/trunk/scripts/lldb.swig URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/lldb.swig?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/scripts/lldb.swig (original) +++ lldb/trunk/scripts/lldb.swig Sun Feb 15 18:04:19 2015 @@ -53,6 +53,7 @@ import os %{ #include "lldb/lldb-public.h" #include "lldb/API/SBAddress.h" +#include "lldb/API/SBAttachInfo.h" #include "lldb/API/SBBlock.h" #include "lldb/API/SBBreakpoint.h" #include "lldb/API/SBBreakpointLocation.h" @@ -129,6 +130,7 @@ import os /* Python interface files with docstrings. */ %include "./Python/interface/SBAddress.i" +%include "./Python/interface/SBAttachInfo.i" %include "./Python/interface/SBBlock.i" %include "./Python/interface/SBBreakpoint.i" %include "./Python/interface/SBBreakpointLocation.i" Modified: lldb/trunk/source/API/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/source/API/CMakeLists.txt (original) +++ lldb/trunk/source/API/CMakeLists.txt Sun Feb 15 18:04:19 2015 @@ -5,6 +5,7 @@ set(LLVM_NO_RTTI 1) # well (where appropriate). add_lldb_library(lldbAPI SBAddress.cpp + SBAttachInfo.cpp SBBlock.cpp SBBreakpoint.cpp SBBreakpointLocation.cpp Added: lldb/trunk/source/API/SBAttachInfo.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAttachInfo.cpp?rev=229346&view=auto ============================================================================== --- lldb/trunk/source/API/SBAttachInfo.cpp (added) +++ lldb/trunk/source/API/SBAttachInfo.cpp Sun Feb 15 18:04:19 2015 @@ -0,0 +1,244 @@ +//===-- SBAttachInfo.cpp ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/lldb-python.h" + +#include "lldb/API/SBAttachInfo.h" + +#include "lldb/API/SBFileSpec.h" +#include "lldb/API/SBListener.h" +#include "lldb/Target/Process.h" + +using namespace lldb; +using namespace lldb_private; + + +SBAttachInfo::SBAttachInfo () : + m_opaque_sp (new ProcessAttachInfo()) +{ +} + +SBAttachInfo::SBAttachInfo (lldb::pid_t pid) : + m_opaque_sp (new ProcessAttachInfo()) +{ + m_opaque_sp->SetProcessID (pid); +} + +SBAttachInfo::SBAttachInfo (const char *path, bool wait_for) : + m_opaque_sp (new ProcessAttachInfo()) +{ + if (path && path[0]) + m_opaque_sp->GetExecutableFile().SetFile(path, false); + m_opaque_sp->SetWaitForLaunch (wait_for); +} + +SBAttachInfo::SBAttachInfo (const SBAttachInfo &rhs) : + m_opaque_sp (new ProcessAttachInfo()) +{ + *m_opaque_sp = *rhs.m_opaque_sp; +} + +SBAttachInfo::~SBAttachInfo() +{ +} + +lldb_private::ProcessAttachInfo & +SBAttachInfo::ref () +{ + return *m_opaque_sp; +} + +SBAttachInfo & +SBAttachInfo::operator = (const SBAttachInfo &rhs) +{ + if (this != &rhs) + *m_opaque_sp = *rhs.m_opaque_sp; + return *this; +} + +lldb::pid_t +SBAttachInfo::GetProcessID () +{ + return m_opaque_sp->GetProcessID(); +} + +void +SBAttachInfo::SetProcessID (lldb::pid_t pid) +{ + m_opaque_sp->SetProcessID (pid); +} + + +uint32_t +SBAttachInfo::GetResumeCount () +{ + return m_opaque_sp->GetResumeCount(); +} + +void +SBAttachInfo::SetResumeCount (uint32_t c) +{ + m_opaque_sp->SetResumeCount (c); +} + +const char * +SBAttachInfo::GetProcessPluginName () +{ + return m_opaque_sp->GetProcessPluginName(); +} + +void +SBAttachInfo::SetProcessPluginName (const char *plugin_name) +{ + return m_opaque_sp->SetProcessPluginName (plugin_name); +} + +void +SBAttachInfo::SetExecutable (const char *path) +{ + if (path && path[0]) + m_opaque_sp->GetExecutableFile().SetFile(path, false); + else + m_opaque_sp->GetExecutableFile().Clear(); +} + +void +SBAttachInfo::SetExecutable (SBFileSpec exe_file) +{ + if (exe_file.IsValid()) + m_opaque_sp->GetExecutableFile() = exe_file.ref(); + else + m_opaque_sp->GetExecutableFile().Clear(); +} + +bool +SBAttachInfo::GetWaitForLaunch () +{ + return m_opaque_sp->GetWaitForLaunch(); +} + +void +SBAttachInfo::SetWaitForLaunch (bool b) +{ + m_opaque_sp->SetWaitForLaunch (b); +} + +bool +SBAttachInfo::GetIgnoreExisting () +{ + return m_opaque_sp->GetIgnoreExisting(); +} + +void +SBAttachInfo::SetIgnoreExisting (bool b) +{ + m_opaque_sp->SetIgnoreExisting (b); +} + +uint32_t +SBAttachInfo::GetUserID() +{ + return m_opaque_sp->GetUserID(); +} + +uint32_t +SBAttachInfo::GetGroupID() +{ + return m_opaque_sp->GetGroupID(); +} + +bool +SBAttachInfo::UserIDIsValid () +{ + return m_opaque_sp->UserIDIsValid(); +} + +bool +SBAttachInfo::GroupIDIsValid () +{ + return m_opaque_sp->GroupIDIsValid(); +} + +void +SBAttachInfo::SetUserID (uint32_t uid) +{ + m_opaque_sp->SetUserID (uid); +} + +void +SBAttachInfo::SetGroupID (uint32_t gid) +{ + m_opaque_sp->SetGroupID (gid); +} + +uint32_t +SBAttachInfo::GetEffectiveUserID() +{ + return m_opaque_sp->GetEffectiveUserID(); +} + +uint32_t +SBAttachInfo::GetEffectiveGroupID() +{ + return m_opaque_sp->GetEffectiveGroupID(); +} + +bool +SBAttachInfo::EffectiveUserIDIsValid () +{ + return m_opaque_sp->EffectiveUserIDIsValid(); +} + +bool +SBAttachInfo::EffectiveGroupIDIsValid () +{ + return m_opaque_sp->EffectiveGroupIDIsValid (); +} + +void +SBAttachInfo::SetEffectiveUserID (uint32_t uid) +{ + m_opaque_sp->SetEffectiveUserID(uid); +} + +void +SBAttachInfo::SetEffectiveGroupID (uint32_t gid) +{ + m_opaque_sp->SetEffectiveGroupID(gid); +} + +lldb::pid_t +SBAttachInfo::GetParentProcessID () +{ + return m_opaque_sp->GetParentProcessID(); +} + +void +SBAttachInfo::SetParentProcessID (lldb::pid_t pid) +{ + m_opaque_sp->SetParentProcessID (pid); +} + +bool +SBAttachInfo::ParentProcessIDIsValid() +{ + return m_opaque_sp->ParentProcessIDIsValid(); +} + +SBListener +SBAttachInfo::GetListener () +{ + return SBListener(m_opaque_sp->GetListener()); +} + +void +SBAttachInfo::SetListener (SBListener &listener) +{ + m_opaque_sp->SetListener(listener.GetSP()); +} Modified: lldb/trunk/source/API/SBTarget.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/source/API/SBTarget.cpp (original) +++ lldb/trunk/source/API/SBTarget.cpp Sun Feb 15 18:04:19 2015 @@ -66,231 +66,6 @@ using namespace lldb_private; #define DEFAULT_DISASM_BYTE_SIZE 32 - -SBAttachInfo::SBAttachInfo () : - m_opaque_sp (new ProcessAttachInfo()) -{ -} - -SBAttachInfo::SBAttachInfo (lldb::pid_t pid) : - m_opaque_sp (new ProcessAttachInfo()) -{ - m_opaque_sp->SetProcessID (pid); -} - -SBAttachInfo::SBAttachInfo (const char *path, bool wait_for) : - m_opaque_sp (new ProcessAttachInfo()) -{ - if (path && path[0]) - m_opaque_sp->GetExecutableFile().SetFile(path, false); - m_opaque_sp->SetWaitForLaunch (wait_for); -} - -SBAttachInfo::SBAttachInfo (const SBAttachInfo &rhs) : - m_opaque_sp (new ProcessAttachInfo()) -{ - *m_opaque_sp = *rhs.m_opaque_sp; -} - -SBAttachInfo::~SBAttachInfo() -{ -} - -lldb_private::ProcessAttachInfo & -SBAttachInfo::ref () -{ - return *m_opaque_sp; -} - -SBAttachInfo & -SBAttachInfo::operator = (const SBAttachInfo &rhs) -{ - if (this != &rhs) - *m_opaque_sp = *rhs.m_opaque_sp; - return *this; -} - -lldb::pid_t -SBAttachInfo::GetProcessID () -{ - return m_opaque_sp->GetProcessID(); -} - -void -SBAttachInfo::SetProcessID (lldb::pid_t pid) -{ - m_opaque_sp->SetProcessID (pid); -} - - -uint32_t -SBAttachInfo::GetResumeCount () -{ - return m_opaque_sp->GetResumeCount(); -} - -void -SBAttachInfo::SetResumeCount (uint32_t c) -{ - m_opaque_sp->SetResumeCount (c); -} - -const char * -SBAttachInfo::GetProcessPluginName () -{ - return m_opaque_sp->GetProcessPluginName(); -} - -void -SBAttachInfo::SetProcessPluginName (const char *plugin_name) -{ - return m_opaque_sp->SetProcessPluginName (plugin_name); -} - -void -SBAttachInfo::SetExecutable (const char *path) -{ - if (path && path[0]) - m_opaque_sp->GetExecutableFile().SetFile(path, false); - else - m_opaque_sp->GetExecutableFile().Clear(); -} - -void -SBAttachInfo::SetExecutable (SBFileSpec exe_file) -{ - if (exe_file.IsValid()) - m_opaque_sp->GetExecutableFile() = exe_file.ref(); - else - m_opaque_sp->GetExecutableFile().Clear(); -} - -bool -SBAttachInfo::GetWaitForLaunch () -{ - return m_opaque_sp->GetWaitForLaunch(); -} - -void -SBAttachInfo::SetWaitForLaunch (bool b) -{ - m_opaque_sp->SetWaitForLaunch (b); -} - -bool -SBAttachInfo::GetIgnoreExisting () -{ - return m_opaque_sp->GetIgnoreExisting(); -} - -void -SBAttachInfo::SetIgnoreExisting (bool b) -{ - m_opaque_sp->SetIgnoreExisting (b); -} - -uint32_t -SBAttachInfo::GetUserID() -{ - return m_opaque_sp->GetUserID(); -} - -uint32_t -SBAttachInfo::GetGroupID() -{ - return m_opaque_sp->GetGroupID(); -} - -bool -SBAttachInfo::UserIDIsValid () -{ - return m_opaque_sp->UserIDIsValid(); -} - -bool -SBAttachInfo::GroupIDIsValid () -{ - return m_opaque_sp->GroupIDIsValid(); -} - -void -SBAttachInfo::SetUserID (uint32_t uid) -{ - m_opaque_sp->SetUserID (uid); -} - -void -SBAttachInfo::SetGroupID (uint32_t gid) -{ - m_opaque_sp->SetGroupID (gid); -} - -uint32_t -SBAttachInfo::GetEffectiveUserID() -{ - return m_opaque_sp->GetEffectiveUserID(); -} - -uint32_t -SBAttachInfo::GetEffectiveGroupID() -{ - return m_opaque_sp->GetEffectiveGroupID(); -} - -bool -SBAttachInfo::EffectiveUserIDIsValid () -{ - return m_opaque_sp->EffectiveUserIDIsValid(); -} - -bool -SBAttachInfo::EffectiveGroupIDIsValid () -{ - return m_opaque_sp->EffectiveGroupIDIsValid (); -} - -void -SBAttachInfo::SetEffectiveUserID (uint32_t uid) -{ - m_opaque_sp->SetEffectiveUserID(uid); -} - -void -SBAttachInfo::SetEffectiveGroupID (uint32_t gid) -{ - m_opaque_sp->SetEffectiveGroupID(gid); -} - -lldb::pid_t -SBAttachInfo::GetParentProcessID () -{ - return m_opaque_sp->GetParentProcessID(); -} - -void -SBAttachInfo::SetParentProcessID (lldb::pid_t pid) -{ - m_opaque_sp->SetParentProcessID (pid); -} - -bool -SBAttachInfo::ParentProcessIDIsValid() -{ - return m_opaque_sp->ParentProcessIDIsValid(); -} - -SBListener -SBAttachInfo::GetListener () -{ - return SBListener(m_opaque_sp->GetListener()); -} - -void -SBAttachInfo::SetListener (SBListener &listener) -{ - m_opaque_sp->SetListener(listener.GetSP()); -} - namespace { Error Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=229346&r1=229345&r2=229346&view=diff ============================================================================== --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Sun Feb 15 18:04:19 2015 @@ -59,6 +59,7 @@ add_lldb_library(liblldb SHARED lldb.cpp lldb-log.cpp API/SBAddress.cpp + API/SBAttachInfo.cpp API/SBBlock.cpp API/SBBreakpoint.cpp API/SBBreakpointLocation.cpp _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits