[Lldb-commits] [lldb] r227929 - Moving header files from source/Host/common to proper location.
Chaoren Lin
chaorenl at google.com
Mon Feb 2 17:51:39 PST 2015
Author: chaoren
Date: Mon Feb 2 19:51:38 2015
New Revision: 227929
URL: http://llvm.org/viewvc/llvm-project?rev=227929&view=rev
Log:
Moving header files from source/Host/common to proper location.
Added:
lldb/trunk/include/lldb/Host/common/
lldb/trunk/include/lldb/Host/common/NativeBreakpoint.h
- copied, changed from r227928, lldb/trunk/source/Host/common/NativeBreakpoint.h
lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h
- copied, changed from r227928, lldb/trunk/source/Host/common/NativeBreakpointList.h
lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h
- copied, changed from r227928, lldb/trunk/source/Host/common/NativeProcessProtocol.h
lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h
- copied, changed from r227928, lldb/trunk/include/lldb/Target/NativeRegisterContext.h
lldb/trunk/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h
- copied, changed from r227928, lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h
lldb/trunk/include/lldb/Host/common/NativeThreadProtocol.h
- copied, changed from r227928, lldb/trunk/source/Host/common/NativeThreadProtocol.h
lldb/trunk/include/lldb/Host/common/SoftwareBreakpoint.h
- copied, changed from r227928, lldb/trunk/source/Host/common/SoftwareBreakpoint.h
lldb/trunk/source/Host/common/NativeRegisterContext.cpp
- copied, changed from r227928, lldb/trunk/source/Target/NativeRegisterContext.cpp
lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp
- copied, changed from r227928, lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp
Removed:
lldb/trunk/include/lldb/Target/NativeRegisterContext.h
lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h
lldb/trunk/source/Host/common/NativeBreakpoint.h
lldb/trunk/source/Host/common/NativeBreakpointList.h
lldb/trunk/source/Host/common/NativeProcessProtocol.h
lldb/trunk/source/Host/common/NativeThreadProtocol.h
lldb/trunk/source/Host/common/SoftwareBreakpoint.h
lldb/trunk/source/Target/NativeRegisterContext.cpp
lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp
Modified:
lldb/trunk/include/lldb/Target/Platform.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Host/CMakeLists.txt
lldb/trunk/source/Host/common/NativeBreakpoint.cpp
lldb/trunk/source/Host/common/NativeBreakpointList.cpp
lldb/trunk/source/Host/common/NativeProcessProtocol.cpp
lldb/trunk/source/Host/common/NativeThreadProtocol.cpp
lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
lldb/trunk/source/Target/CMakeLists.txt
Copied: lldb/trunk/include/lldb/Host/common/NativeBreakpoint.h (from r227928, lldb/trunk/source/Host/common/NativeBreakpoint.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeBreakpoint.h?p2=lldb/trunk/include/lldb/Host/common/NativeBreakpoint.h&p1=lldb/trunk/source/Host/common/NativeBreakpoint.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h (from r227928, lldb/trunk/source/Host/common/NativeBreakpointList.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h?p2=lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h&p1=lldb/trunk/source/Host/common/NativeBreakpointList.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h (from r227928, lldb/trunk/source/Host/common/NativeProcessProtocol.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h?p2=lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h&p1=lldb/trunk/source/Host/common/NativeProcessProtocol.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h (from r227928, lldb/trunk/include/lldb/Target/NativeRegisterContext.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h?p2=lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h&p1=lldb/trunk/include/lldb/Target/NativeRegisterContext.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h (from r227928, lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h?p2=lldb/trunk/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h&p1=lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/NativeThreadProtocol.h (from r227928, lldb/trunk/source/Host/common/NativeThreadProtocol.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/NativeThreadProtocol.h?p2=lldb/trunk/include/lldb/Host/common/NativeThreadProtocol.h&p1=lldb/trunk/source/Host/common/NativeThreadProtocol.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Copied: lldb/trunk/include/lldb/Host/common/SoftwareBreakpoint.h (from r227928, lldb/trunk/source/Host/common/SoftwareBreakpoint.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/common/SoftwareBreakpoint.h?p2=lldb/trunk/include/lldb/Host/common/SoftwareBreakpoint.h&p1=lldb/trunk/source/Host/common/SoftwareBreakpoint.h&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
(empty)
Removed: lldb/trunk/include/lldb/Target/NativeRegisterContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/NativeRegisterContext.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Target/NativeRegisterContext.h (original)
+++ lldb/trunk/include/lldb/Target/NativeRegisterContext.h (removed)
@@ -1,193 +0,0 @@
-//===-- NativeRegisterContext.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_NativeRegisterContext_h_
-#define liblldb_NativeRegisterContext_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-class NativeThreadProtocol;
-
-class NativeRegisterContext:
- public std::enable_shared_from_this<NativeRegisterContext>
-{
-public:
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
- NativeRegisterContext (NativeThreadProtocol &thread, uint32_t concrete_frame_idx);
-
- virtual
- ~NativeRegisterContext ();
-
- // void
- // InvalidateIfNeeded (bool force);
-
- //------------------------------------------------------------------
- // Subclasses must override these functions
- //------------------------------------------------------------------
- // virtual void
- // InvalidateAllRegisters () = 0;
-
- virtual uint32_t
- GetRegisterCount () const = 0;
-
- virtual uint32_t
- GetUserRegisterCount () const = 0;
-
- virtual const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg) const = 0;
-
- const char *
- GetRegisterSetNameForRegisterAtIndex (uint32_t reg_index) const;
-
- virtual uint32_t
- GetRegisterSetCount () const = 0;
-
- virtual const RegisterSet *
- GetRegisterSet (uint32_t set_index) const = 0;
-
- virtual Error
- ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) = 0;
-
- virtual Error
- WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value) = 0;
-
- virtual Error
- ReadAllRegisterValues (lldb::DataBufferSP &data_sp) = 0;
-
- virtual Error
- WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) = 0;
-
- uint32_t
- ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) const;
-
- //------------------------------------------------------------------
- // Subclasses can override these functions if desired
- //------------------------------------------------------------------
- virtual uint32_t
- NumSupportedHardwareBreakpoints ();
-
- virtual uint32_t
- SetHardwareBreakpoint (lldb::addr_t addr, size_t size);
-
- virtual bool
- ClearHardwareBreakpoint (uint32_t hw_idx);
-
- virtual uint32_t
- NumSupportedHardwareWatchpoints ();
-
- virtual uint32_t
- SetHardwareWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags);
-
- virtual bool
- ClearHardwareWatchpoint (uint32_t hw_index);
-
- virtual bool
- HardwareSingleStep (bool enable);
-
- virtual Error
- ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, lldb::addr_t src_len, RegisterValue ®_value);
-
- virtual Error
- WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, lldb::addr_t dst_len, const RegisterValue ®_value);
-
- //------------------------------------------------------------------
- // Subclasses should not override these
- //------------------------------------------------------------------
- virtual lldb::tid_t
- GetThreadID() const;
-
- virtual NativeThreadProtocol &
- GetThread ()
- {
- return m_thread;
- }
-
- const RegisterInfo *
- GetRegisterInfoByName (const char *reg_name, uint32_t start_idx = 0);
-
- const RegisterInfo *
- GetRegisterInfo (uint32_t reg_kind, uint32_t reg_num);
-
- lldb::addr_t
- GetPC (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetPC (lldb::addr_t pc);
-
- lldb::addr_t
- GetSP (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetSP (lldb::addr_t sp);
-
- lldb::addr_t
- GetFP (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- Error
- SetFP (lldb::addr_t fp);
-
- const char *
- GetRegisterName (uint32_t reg);
-
- lldb::addr_t
- GetReturnAddress (lldb::addr_t fail_value = LLDB_INVALID_ADDRESS);
-
- lldb::addr_t
- GetFlags (lldb::addr_t fail_value = 0);
-
- lldb::addr_t
- ReadRegisterAsUnsigned (uint32_t reg, lldb::addr_t fail_value);
-
- lldb::addr_t
- ReadRegisterAsUnsigned (const RegisterInfo *reg_info, lldb::addr_t fail_value);
-
- Error
- WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval);
-
- Error
- WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval);
-
- // uint32_t
- // GetStopID () const
- // {
- // return m_stop_id;
- // }
-
- // void
- // SetStopID (uint32_t stop_id)
- // {
- // m_stop_id = stop_id;
- // }
-
-protected:
- //------------------------------------------------------------------
- // Classes that inherit from RegisterContext can see and modify these
- //------------------------------------------------------------------
- NativeThreadProtocol &m_thread; // The thread that this register context belongs to.
- uint32_t m_concrete_frame_idx; // The concrete frame index for this register context
- // uint32_t m_stop_id; // The stop ID that any data in this context is valid for
-
-private:
- //------------------------------------------------------------------
- // For RegisterContext only
- //------------------------------------------------------------------
- DISALLOW_COPY_AND_ASSIGN (NativeRegisterContext);
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_NativeRegisterContext_h_
Removed: lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h (original)
+++ lldb/trunk/include/lldb/Target/NativeRegisterContextRegisterInfo.h (removed)
@@ -1,47 +0,0 @@
-//===-- NativeRegisterContextRegisterInfo.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_NativeRegisterContextRegisterInfo_h
-#define lldb_NativeRegisterContextRegisterInfo_h
-
-#include <memory>
-
-#include "NativeRegisterContext.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-
-namespace lldb_private
-{
- class NativeRegisterContextRegisterInfo: public NativeRegisterContext
- {
- public:
- ///
- /// Construct a NativeRegisterContextRegisterInfo, taking ownership
- /// of the register_info_interface pointer.
- ///
- NativeRegisterContextRegisterInfo (NativeThreadProtocol &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info_interface);
-
- uint32_t
- GetRegisterCount () const override;
-
- uint32_t
- GetUserRegisterCount () const override;
-
- const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg_index) const override;
-
- const RegisterInfoInterface&
- GetRegisterInfoInterface () const;
-
- private:
- std::unique_ptr<RegisterInfoInterface> m_register_info_interface_up;
- };
-}
-#endif
Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Mon Feb 2 19:51:38 2015
@@ -28,7 +28,7 @@
// TODO pull NativeDelegate class out of NativeProcessProtocol so we
// can just forward ref the NativeDelegate rather than include it here.
-#include "../../../source/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
namespace lldb_private {
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Feb 2 19:51:38 2015
@@ -1155,13 +1155,13 @@
23B6FF4119D38D48004CC8C3 /* ThreadStateCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThreadStateCoordinator.h; sourceTree = "<group>"; };
23CDD8E819D3E13200461DDC /* ThreadStateCoordinator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadStateCoordinator.cpp; sourceTree = "<group>"; };
23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandOptionValidators.cpp; path = source/Interpreter/CommandOptionValidators.cpp; sourceTree = "<group>"; };
- 23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Target/NativeRegisterContext.cpp; sourceTree = "<group>"; };
- 23EDE3311926843600F6A132 /* NativeRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Target/NativeRegisterContext.h; sourceTree = "<group>"; };
+ 23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Host/common/NativeRegisterContext.cpp; sourceTree = "<group>"; };
+ 23EDE3311926843600F6A132 /* NativeRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Host/common/NativeRegisterContext.h; sourceTree = "<group>"; };
23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = "<group>"; };
23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = "<group>"; };
- 23F403471926C8D50046DC9B /* NativeRegisterContextRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContextRegisterInfo.h; path = include/lldb/Target/NativeRegisterContextRegisterInfo.h; sourceTree = "<group>"; };
- 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContextRegisterInfo.cpp; path = source/Target/NativeRegisterContextRegisterInfo.cpp; sourceTree = "<group>"; };
+ 23F403471926C8D50046DC9B /* NativeRegisterContextRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContextRegisterInfo.h; path = include/lldb/Host/common/NativeRegisterContextRegisterInfo.h; sourceTree = "<group>"; };
+ 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContextRegisterInfo.cpp; path = source/Host/common/NativeRegisterContextRegisterInfo.cpp; sourceTree = "<group>"; };
25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueChar.cpp; path = source/Interpreter/OptionValueChar.cpp; sourceTree = "<group>"; };
25420ECE1A64911B009ADBCB /* OptionValueChar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValueChar.h; path = include/lldb/Interpreter/OptionValueChar.h; sourceTree = "<group>"; };
25420ED11A649D88009ADBCB /* PipeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipeBase.cpp; sourceTree = "<group>"; };
Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Mon Feb 2 19:51:38 2015
@@ -19,6 +19,8 @@ add_host_subdirectory(common
common/NativeBreakpoint.cpp
common/NativeBreakpointList.cpp
common/NativeProcessProtocol.cpp
+ common/NativeRegisterContext.cpp
+ common/NativeRegisterContextRegisterInfo.cpp
common/NativeThreadProtocol.cpp
common/OptionParser.cpp
common/PipeBase.cpp
Modified: lldb/trunk/source/Host/common/NativeBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeBreakpoint.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/NativeBreakpoint.cpp (original)
+++ lldb/trunk/source/Host/common/NativeBreakpoint.cpp Mon Feb 2 19:51:38 2015
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#include "NativeBreakpoint.h"
+#include "lldb/Host/common/NativeBreakpoint.h"
#include "lldb/lldb-defines.h"
#include "lldb/Core/Error.h"
Removed: lldb/trunk/source/Host/common/NativeBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeBreakpoint.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Host/common/NativeBreakpoint.h (original)
+++ lldb/trunk/source/Host/common/NativeBreakpoint.h (removed)
@@ -1,66 +0,0 @@
-//===-- NativeBreakpoint.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_NativeBreakpoint_h_
-#define liblldb_NativeBreakpoint_h_
-
-#include "lldb/lldb-types.h"
-
-namespace lldb_private
-{
- class NativeBreakpointList;
-
- class NativeBreakpoint
- {
- friend class NativeBreakpointList;
-
- public:
- // The assumption is that derived breakpoints are enabled when created.
- NativeBreakpoint (lldb::addr_t addr);
-
- virtual
- ~NativeBreakpoint ();
-
- Error
- Enable ();
-
- Error
- Disable ();
-
- lldb::addr_t
- GetAddress () const { return m_addr; }
-
- bool
- IsEnabled () const { return m_enabled; }
-
- virtual bool
- IsSoftwareBreakpoint () const = 0;
-
- protected:
- const lldb::addr_t m_addr;
- int32_t m_ref_count;
-
- virtual Error
- DoEnable () = 0;
-
- virtual Error
- DoDisable () = 0;
-
- private:
- bool m_enabled;
-
- // -----------------------------------------------------------
- // interface for NativeBreakpointList
- // -----------------------------------------------------------
- void AddRef ();
- int32_t DecRef ();
- };
-}
-
-#endif // ifndef liblldb_NativeBreakpoint_h_
Modified: lldb/trunk/source/Host/common/NativeBreakpointList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeBreakpointList.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/NativeBreakpointList.cpp (original)
+++ lldb/trunk/source/Host/common/NativeBreakpointList.cpp Mon Feb 2 19:51:38 2015
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "NativeBreakpointList.h"
+#include "lldb/Host/common/NativeBreakpointList.h"
#include "lldb/Core/Log.h"
-#include "NativeBreakpoint.h"
+#include "lldb/Host/common/NativeBreakpoint.h"
using namespace lldb;
using namespace lldb_private;
Removed: lldb/trunk/source/Host/common/NativeBreakpointList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeBreakpointList.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Host/common/NativeBreakpointList.h (original)
+++ lldb/trunk/source/Host/common/NativeBreakpointList.h (removed)
@@ -1,53 +0,0 @@
-//===-- NativeBreakpointList.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_NativeBreakpointList_h_
-#define liblldb_NativeBreakpointList_h_
-
-#include "lldb/lldb-private-forward.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Host/Mutex.h"
-// #include "lldb/Host/NativeBreakpoint.h"
-
-#include <functional>
-#include <map>
-
-namespace lldb_private
-{
- class NativeBreakpointList
- {
- public:
- typedef std::function<Error (lldb::addr_t addr, size_t size_hint, bool hardware, NativeBreakpointSP &breakpoint_sp)> CreateBreakpointFunc;
-
- NativeBreakpointList ();
-
- Error
- AddRef (lldb::addr_t addr, size_t size_hint, bool hardware, CreateBreakpointFunc create_func);
-
- Error
- DecRef (lldb::addr_t addr);
-
- Error
- EnableBreakpoint (lldb::addr_t addr);
-
- Error
- DisableBreakpoint (lldb::addr_t addr);
-
- Error
- GetBreakpoint (lldb::addr_t addr, NativeBreakpointSP &breakpoint_sp);
-
- private:
- typedef std::map<lldb::addr_t, NativeBreakpointSP> BreakpointMap;
-
- Mutex m_mutex;
- BreakpointMap m_breakpoints;
- };
-}
-
-#endif // ifndef liblldb_NativeBreakpointList_h_
Modified: lldb/trunk/source/Host/common/NativeProcessProtocol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeProcessProtocol.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/NativeProcessProtocol.cpp (original)
+++ lldb/trunk/source/Host/common/NativeProcessProtocol.cpp Mon Feb 2 19:51:38 2015
@@ -7,17 +7,17 @@
//
//===----------------------------------------------------------------------===//
-#include "NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/State.h"
#include "lldb/Host/Host.h"
-#include "lldb/Target/NativeRegisterContext.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
-#include "NativeThreadProtocol.h"
-#include "SoftwareBreakpoint.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
+#include "lldb/Host/common/SoftwareBreakpoint.h"
using namespace lldb;
using namespace lldb_private;
Removed: lldb/trunk/source/Host/common/NativeProcessProtocol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeProcessProtocol.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Host/common/NativeProcessProtocol.h (original)
+++ lldb/trunk/source/Host/common/NativeProcessProtocol.h (removed)
@@ -1,344 +0,0 @@
-//===-- NativeProcessProtocol.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_NativeProcessProtocol_h_
-#define liblldb_NativeProcessProtocol_h_
-
-#include <vector>
-
-#include "lldb/lldb-private-forward.h"
-#include "lldb/lldb-types.h"
-#include "lldb/Core/Error.h"
-#include "lldb/Host/Mutex.h"
-
-#include "NativeBreakpointList.h"
-
-namespace lldb_private
-{
- class MemoryRegionInfo;
- class ResumeActionList;
-
- //------------------------------------------------------------------
- // NativeProcessProtocol
- //------------------------------------------------------------------
- class NativeProcessProtocol :
- public std::enable_shared_from_this<NativeProcessProtocol>
- {
- friend class SoftwareBreakpoint;
-
- public:
- static NativeProcessProtocol *
- CreateInstance (lldb::pid_t pid);
-
- // lldb_private::Host calls should be used to launch a process for debugging, and
- // then the process should be attached to. When attaching to a process
- // lldb_private::Host calls should be used to locate the process to attach to,
- // and then this function should be called.
- NativeProcessProtocol (lldb::pid_t pid);
-
- public:
- virtual ~NativeProcessProtocol ()
- {
- }
-
- virtual Error
- Resume (const ResumeActionList &resume_actions) = 0;
-
- virtual Error
- Halt () = 0;
-
- virtual Error
- Detach () = 0;
-
- //------------------------------------------------------------------
- /// Sends a process a UNIX signal \a signal.
- ///
- /// @return
- /// Returns an error object.
- //------------------------------------------------------------------
- virtual Error
- Signal (int signo) = 0;
-
- //------------------------------------------------------------------
- /// Tells a process to interrupt all operations as if by a Ctrl-C.
- ///
- /// The default implementation will send a local host's equivalent of
- /// a SIGSTOP to the process via the NativeProcessProtocol::Signal()
- /// operation.
- ///
- /// @return
- /// Returns an error object.
- //------------------------------------------------------------------
- virtual Error
- Interrupt ();
-
- virtual Error
- Kill () = 0;
-
- //----------------------------------------------------------------------
- // Memory and memory region functions
- //----------------------------------------------------------------------
-
- virtual Error
- GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info);
-
- virtual Error
- ReadMemory (lldb::addr_t addr, void *buf, lldb::addr_t size, lldb::addr_t &bytes_read) = 0;
-
- virtual Error
- WriteMemory (lldb::addr_t addr, const void *buf, lldb::addr_t size, lldb::addr_t &bytes_written) = 0;
-
- virtual Error
- AllocateMemory (lldb::addr_t size, uint32_t permissions, lldb::addr_t &addr) = 0;
-
- virtual Error
- DeallocateMemory (lldb::addr_t addr) = 0;
-
- virtual lldb::addr_t
- GetSharedLibraryInfoAddress () = 0;
-
- virtual bool
- IsAlive () const;
-
- virtual size_t
- UpdateThreads () = 0;
-
- virtual bool
- GetArchitecture (ArchSpec &arch) const = 0;
-
- //----------------------------------------------------------------------
- // Breakpoint functions
- //----------------------------------------------------------------------
- virtual Error
- SetBreakpoint (lldb::addr_t addr, uint32_t size, bool hardware) = 0;
-
- virtual Error
- RemoveBreakpoint (lldb::addr_t addr);
-
- virtual Error
- EnableBreakpoint (lldb::addr_t addr);
-
- virtual Error
- DisableBreakpoint (lldb::addr_t addr);
-
- //----------------------------------------------------------------------
- // Watchpoint functions
- //----------------------------------------------------------------------
- virtual uint32_t
- GetMaxWatchpoints () const;
-
- virtual Error
- SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware);
-
- virtual Error
- RemoveWatchpoint (lldb::addr_t addr);
-
- //----------------------------------------------------------------------
- // Accessors
- //----------------------------------------------------------------------
- lldb::pid_t
- GetID() const
- {
- return m_pid;
- }
-
- lldb::StateType
- GetState () const;
-
- bool
- IsRunning () const
- {
- return m_state == lldb::eStateRunning || IsStepping();
- }
-
- bool
- IsStepping () const
- {
- return m_state == lldb::eStateStepping;
- }
-
- bool
- CanResume () const
- {
- return m_state == lldb::eStateStopped;
- }
-
- bool
- GetByteOrder (lldb::ByteOrder &byte_order) const;
-
- //----------------------------------------------------------------------
- // Exit Status
- //----------------------------------------------------------------------
- virtual bool
- GetExitStatus (lldb_private::ExitType *exit_type, int *status, std::string &exit_description);
-
- virtual bool
- SetExitStatus (lldb_private::ExitType exit_type, int status, const char *exit_description, bool bNotifyStateChange);
-
- //----------------------------------------------------------------------
- // Access to threads
- //----------------------------------------------------------------------
- NativeThreadProtocolSP
- GetThreadAtIndex (uint32_t idx);
-
- NativeThreadProtocolSP
- GetThreadByID (lldb::tid_t tid);
-
- void
- SetCurrentThreadID (lldb::tid_t tid)
- {
- m_current_thread_id = tid;
- }
-
- lldb::tid_t
- GetCurrentThreadID ()
- {
- return m_current_thread_id;
- }
-
- NativeThreadProtocolSP
- GetCurrentThread ()
- {
- return GetThreadByID (m_current_thread_id);
- }
-
- //----------------------------------------------------------------------
- // Access to inferior stdio
- //----------------------------------------------------------------------
- virtual
- int GetTerminalFileDescriptor ()
- {
- return m_terminal_fd;
- }
-
- //----------------------------------------------------------------------
- // Stop id interface
- //----------------------------------------------------------------------
-
- uint32_t
- GetStopID () const;
-
- // ---------------------------------------------------------------------
- // Callbacks for low-level process state changes
- // ---------------------------------------------------------------------
- class NativeDelegate
- {
- public:
- virtual
- ~NativeDelegate () {}
-
- virtual void
- InitializeDelegate (NativeProcessProtocol *process) = 0;
-
- virtual void
- ProcessStateChanged (NativeProcessProtocol *process, lldb::StateType state) = 0;
-
- virtual void
- DidExec (NativeProcessProtocol *process) = 0;
- };
-
- //------------------------------------------------------------------
- /// Register a native delegate.
- ///
- /// Clients can register nofication callbacks by passing in a
- /// NativeDelegate impl and passing it into this function.
- ///
- /// Note: it is required that the lifetime of the
- /// native_delegate outlive the NativeProcessProtocol.
- ///
- /// @param[in] native_delegate
- /// A NativeDelegate impl to be called when certain events
- /// happen within the NativeProcessProtocol or related threads.
- ///
- /// @return
- /// true if the delegate was registered successfully;
- /// false if the delegate was already registered.
- ///
- /// @see NativeProcessProtocol::NativeDelegate.
- //------------------------------------------------------------------
- bool
- RegisterNativeDelegate (NativeDelegate &native_delegate);
-
- //------------------------------------------------------------------
- /// Unregister a native delegate previously registered.
- ///
- /// @param[in] native_delegate
- /// A NativeDelegate impl previously registered with this process.
- ///
- /// @return Returns \b true if the NativeDelegate was
- /// successfully removed from the process, \b false otherwise.
- ///
- /// @see NativeProcessProtocol::NativeDelegate
- //------------------------------------------------------------------
- bool
- UnregisterNativeDelegate (NativeDelegate &native_delegate);
-
- protected:
- lldb::pid_t m_pid;
-
- std::vector<NativeThreadProtocolSP> m_threads;
- lldb::tid_t m_current_thread_id;
- mutable Mutex m_threads_mutex;
-
- lldb::StateType m_state;
- mutable Mutex m_state_mutex;
-
- lldb_private::ExitType m_exit_type;
- int m_exit_status;
- std::string m_exit_description;
- Mutex m_delegates_mutex;
- std::vector<NativeDelegate*> m_delegates;
- NativeBreakpointList m_breakpoint_list;
- int m_terminal_fd;
- uint32_t m_stop_id;
-
- // -----------------------------------------------------------
- // Internal interface for state handling
- // -----------------------------------------------------------
- void
- SetState (lldb::StateType state, bool notify_delegates = true);
-
- // Derived classes need not implement this. It can be used as a
- // hook to clear internal caches that should be invalidated when
- // stop ids change.
- //
- // Note this function is called with the state mutex obtained
- // by the caller.
- virtual void
- DoStopIDBumped (uint32_t newBumpId);
-
- // -----------------------------------------------------------
- // Internal interface for software breakpoints
- // -----------------------------------------------------------
- Error
- SetSoftwareBreakpoint (lldb::addr_t addr, uint32_t size_hint);
-
- virtual Error
- GetSoftwareBreakpointTrapOpcode (size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) = 0;
-
- // -----------------------------------------------------------
- /// Notify the delegate that an exec occurred.
- ///
- /// Provide a mechanism for a delegate to clear out any exec-
- /// sensitive data.
- // -----------------------------------------------------------
- void
- NotifyDidExec ();
-
- NativeThreadProtocolSP
- GetThreadByIDUnlocked (lldb::tid_t tid);
-
- private:
-
- void
- SynchronouslyNotifyProcessStateChanged (lldb::StateType state);
- };
-}
-
-#endif // #ifndef liblldb_NativeProcessProtocol_h_
Copied: lldb/trunk/source/Host/common/NativeRegisterContext.cpp (from r227928, lldb/trunk/source/Target/NativeRegisterContext.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeRegisterContext.cpp?p2=lldb/trunk/source/Host/common/NativeRegisterContext.cpp&p1=lldb/trunk/source/Target/NativeRegisterContext.cpp&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
--- lldb/trunk/source/Target/NativeRegisterContext.cpp (original)
+++ lldb/trunk/source/Host/common/NativeRegisterContext.cpp Mon Feb 2 19:51:38 2015
@@ -7,15 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Target/NativeRegisterContext.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/lldb-private-log.h"
-#include "Host/common/NativeProcessProtocol.h"
-#include "Host/common/NativeThreadProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
using namespace lldb;
using namespace lldb_private;
Copied: lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp (from r227928, lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp?p2=lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp&p1=lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp&r1=227928&r2=227929&rev=227929&view=diff
==============================================================================
--- lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp (original)
+++ lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp Mon Feb 2 19:51:38 2015
@@ -9,7 +9,7 @@
#include "lldb/lldb-types.h"
#include "lldb/lldb-private-forward.h"
-#include "lldb/Target/NativeRegisterContextRegisterInfo.h"
+#include "lldb/Host/common/NativeRegisterContextRegisterInfo.h"
using namespace lldb_private;
Modified: lldb/trunk/source/Host/common/NativeThreadProtocol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeThreadProtocol.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/NativeThreadProtocol.cpp (original)
+++ lldb/trunk/source/Host/common/NativeThreadProtocol.cpp Mon Feb 2 19:51:38 2015
@@ -7,11 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "NativeThreadProtocol.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
-#include "NativeProcessProtocol.h"
-#include "lldb/Target/NativeRegisterContext.h"
-#include "SoftwareBreakpoint.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
+#include "lldb/Host/common/SoftwareBreakpoint.h"
using namespace lldb;
using namespace lldb_private;
Removed: lldb/trunk/source/Host/common/NativeThreadProtocol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeThreadProtocol.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Host/common/NativeThreadProtocol.h (original)
+++ lldb/trunk/source/Host/common/NativeThreadProtocol.h (removed)
@@ -1,82 +0,0 @@
-//===-- NativeThreadProtocol.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_NativeThreadProtocol_h_
-#define liblldb_NativeThreadProtocol_h_
-
-#include <memory>
-
-#include "lldb/lldb-private-forward.h"
-#include "lldb/lldb-types.h"
-#include "lldb/Host/Debug.h"
-
-namespace lldb_private
-{
- //------------------------------------------------------------------
- // NativeThreadProtocol
- //------------------------------------------------------------------
- class NativeThreadProtocol:
- public std::enable_shared_from_this<NativeThreadProtocol>
- {
- public:
- NativeThreadProtocol (NativeProcessProtocol *process, lldb::tid_t tid);
-
- virtual ~NativeThreadProtocol()
- {
- }
-
- virtual std::string
- GetName() = 0;
-
- virtual lldb::StateType
- GetState () = 0;
-
- virtual NativeRegisterContextSP
- GetRegisterContext () = 0;
-
- virtual Error
- ReadRegister (uint32_t reg, RegisterValue ®_value);
-
- virtual Error
- WriteRegister (uint32_t reg, const RegisterValue ®_value);
-
- virtual Error
- SaveAllRegisters (lldb::DataBufferSP &data_sp);
-
- virtual Error
- RestoreAllRegisters (lldb::DataBufferSP &data_sp);
-
- virtual bool
- GetStopReason (ThreadStopInfo &stop_info, std::string& description) = 0;
-
- lldb::tid_t
- GetID() const
- {
- return m_tid;
- }
-
- NativeProcessProtocolSP
- GetProcess ();
-
- // ---------------------------------------------------------------------
- // Thread-specific watchpoints
- // ---------------------------------------------------------------------
- virtual Error
- SetWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) = 0;
-
- virtual Error
- RemoveWatchpoint (lldb::addr_t addr) = 0;
-
- protected:
- NativeProcessProtocolWP m_process_wp;
- lldb::tid_t m_tid;
- };
-}
-
-#endif // #ifndef liblldb_NativeThreadProtocol_h_
Modified: lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp (original)
+++ lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp Mon Feb 2 19:51:38 2015
@@ -7,14 +7,14 @@
//
//===----------------------------------------------------------------------===//
-#include "SoftwareBreakpoint.h"
+#include "lldb/Host/common/SoftwareBreakpoint.h"
#include "lldb/Core/Error.h"
#include "lldb/Core/Log.h"
#include "lldb/Host/Debug.h"
#include "lldb/Host/Mutex.h"
-#include "NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
using namespace lldb_private;
Removed: lldb/trunk/source/Host/common/SoftwareBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SoftwareBreakpoint.h?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Host/common/SoftwareBreakpoint.h (original)
+++ lldb/trunk/source/Host/common/SoftwareBreakpoint.h (removed)
@@ -1,51 +0,0 @@
-//===-- SoftwareBreakpoint.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_SoftwareBreakpoint_h_
-#define liblldb_SoftwareBreakpoint_h_
-
-#include "lldb/lldb-private-forward.h"
-#include "NativeBreakpoint.h"
-
-namespace lldb_private
-{
- class SoftwareBreakpoint : public NativeBreakpoint
- {
- public:
- static Error
- CreateSoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, size_t size_hint, NativeBreakpointSP &breakpoint_spn);
-
- SoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, const uint8_t *saved_opcodes, const uint8_t *trap_opcodes, size_t opcode_size);
-
- protected:
- Error
- DoEnable () override;
-
- Error
- DoDisable () override;
-
- bool
- IsSoftwareBreakpoint () const override;
-
- private:
- /// Max number of bytes that a software trap opcode sequence can occupy.
- static const size_t MAX_TRAP_OPCODE_SIZE = 8;
-
- NativeProcessProtocol &m_process;
- uint8_t m_saved_opcodes [MAX_TRAP_OPCODE_SIZE];
- uint8_t m_trap_opcodes [MAX_TRAP_OPCODE_SIZE];
- const size_t m_opcode_size;
-
- static Error
- EnableSoftwareBreakpoint (NativeProcessProtocol &process, lldb::addr_t addr, size_t bp_opcode_size, const uint8_t *bp_opcode_bytes, uint8_t *saved_opcode_bytes);
-
- };
-}
-
-#endif // #ifndef liblldb_SoftwareBreakpoint_h_
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Mon Feb 2 19:51:38 2015
@@ -56,11 +56,11 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Target/NativeRegisterContext.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Utility/PseudoTerminal.h"
-#include "Host/common/NativeBreakpoint.h"
+#include "lldb/Host/common/NativeBreakpoint.h"
#include "Utility/StringExtractor.h"
#include "Plugins/Process/Utility/LinuxSignals.h"
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h Mon Feb 2 19:51:38 2015
@@ -25,7 +25,7 @@
#include "lldb/Host/Mutex.h"
#include "lldb/Target/MemoryRegionInfo.h"
-#include "Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
namespace lldb_private
{
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp Mon Feb 2 19:51:38 2015
@@ -13,8 +13,8 @@
#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/Error.h"
#include "lldb/Core/RegisterValue.h"
-#include "Host/common/NativeProcessProtocol.h"
-#include "Host/common/NativeThreadProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
#include "Plugins/Process/Linux/NativeProcessLinux.h"
using namespace lldb_private;
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h Mon Feb 2 19:51:38 2015
@@ -11,7 +11,7 @@
#ifndef lldb_NativeRegisterContextLinux_x86_64_h
#define lldb_NativeRegisterContextLinux_x86_64_h
-#include "lldb/Target/NativeRegisterContextRegisterInfo.h"
+#include "lldb/Host/common/NativeRegisterContextRegisterInfo.h"
#include "Plugins/Process/Utility/RegisterContext_x86.h"
#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h Mon Feb 2 19:51:38 2015
@@ -11,7 +11,7 @@
#define liblldb_NativeThreadLinux_H_
#include "lldb/lldb-private-forward.h"
-#include "../../../Host/common/NativeThreadProtocol.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
namespace lldb_private
{
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Mon Feb 2 19:51:38 2015
@@ -39,9 +39,9 @@
#include "lldb/Target/FileAction.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
-#include "lldb/Target/NativeRegisterContext.h"
-#include "Host/common/NativeProcessProtocol.h"
-#include "Host/common/NativeThreadProtocol.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeThreadProtocol.h"
// Project includes
#include "Utility/StringExtractorGDBRemote.h"
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h Mon Feb 2 19:51:38 2015
@@ -23,7 +23,7 @@
#include "lldb/Target/Process.h"
#include "GDBRemoteCommunication.h"
-#include "../../../Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeProcessProtocol.h"
class ProcessGDBRemote;
class StringExtractorGDBRemote;
Modified: lldb/trunk/source/Target/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/CMakeLists.txt?rev=227929&r1=227928&r2=227929&view=diff
==============================================================================
--- lldb/trunk/source/Target/CMakeLists.txt (original)
+++ lldb/trunk/source/Target/CMakeLists.txt Mon Feb 2 19:51:38 2015
@@ -14,8 +14,6 @@ add_lldb_library(lldbTarget
LanguageRuntime.cpp
Memory.cpp
MemoryHistory.cpp
- NativeRegisterContext.cpp
- NativeRegisterContextRegisterInfo.cpp
ObjCLanguageRuntime.cpp
OperatingSystem.cpp
PathMappingList.cpp
Removed: lldb/trunk/source/Target/NativeRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/NativeRegisterContext.cpp?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Target/NativeRegisterContext.cpp (original)
+++ lldb/trunk/source/Target/NativeRegisterContext.cpp (removed)
@@ -1,470 +0,0 @@
-//===-- NativeRegisterContext.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/Target/NativeRegisterContext.h"
-
-#include "lldb/Core/Log.h"
-#include "lldb/Core/RegisterValue.h"
-
-#include "lldb/lldb-private-log.h"
-
-#include "Host/common/NativeProcessProtocol.h"
-#include "Host/common/NativeThreadProtocol.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-NativeRegisterContext::NativeRegisterContext (NativeThreadProtocol &thread, uint32_t concrete_frame_idx) :
- m_thread (thread),
- m_concrete_frame_idx (concrete_frame_idx)
-{
-}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-NativeRegisterContext::~NativeRegisterContext()
-{
-}
-
-// FIXME revisit invalidation, process stop ids, etc. Right now we don't
-// support caching in NativeRegisterContext. We can do this later by
-// utilizing NativeProcessProtocol::GetStopID () and adding a stop id to
-// NativeRegisterContext.
-
-// void
-// NativeRegisterContext::InvalidateIfNeeded (bool force)
-// {
-// ProcessSP process_sp (m_thread.GetProcess());
-// bool invalidate = force;
-// uint32_t process_stop_id = UINT32_MAX;
-
-// if (process_sp)
-// process_stop_id = process_sp->GetStopID();
-// else
-// invalidate = true;
-
-// if (!invalidate)
-// invalidate = process_stop_id != GetStopID();
-
-// if (invalidate)
-// {
-// InvalidateAllRegisters ();
-// SetStopID (process_stop_id);
-// }
-// }
-
-
-const RegisterInfo *
-NativeRegisterContext::GetRegisterInfoByName (const char *reg_name, uint32_t start_idx)
-{
- if (reg_name && reg_name[0])
- {
- const uint32_t num_registers = GetRegisterCount();
- for (uint32_t reg = start_idx; reg < num_registers; ++reg)
- {
- const RegisterInfo * reg_info = GetRegisterInfoAtIndex(reg);
-
- if ((reg_info->name != nullptr && ::strcasecmp (reg_info->name, reg_name) == 0) ||
- (reg_info->alt_name != nullptr && ::strcasecmp (reg_info->alt_name, reg_name) == 0))
- {
- return reg_info;
- }
- }
- }
- return nullptr;
-}
-
-const RegisterInfo *
-NativeRegisterContext::GetRegisterInfo (uint32_t kind, uint32_t num)
-{
- const uint32_t reg_num = ConvertRegisterKindToRegisterNumber(kind, num);
- if (reg_num == LLDB_INVALID_REGNUM)
- return nullptr;
- return GetRegisterInfoAtIndex (reg_num);
-}
-
-const char *
-NativeRegisterContext::GetRegisterName (uint32_t reg)
-{
- const RegisterInfo * reg_info = GetRegisterInfoAtIndex(reg);
- if (reg_info)
- return reg_info->name;
- return nullptr;
-}
-
-const char*
-NativeRegisterContext::GetRegisterSetNameForRegisterAtIndex (uint32_t reg_index) const
-{
- const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(reg_index);
- if (!reg_info)
- return nullptr;
-
- for (uint32_t set_index = 0; set_index < GetRegisterSetCount (); ++set_index)
- {
- const RegisterSet *const reg_set = GetRegisterSet (set_index);
- if (!reg_set)
- continue;
-
- for (uint32_t reg_num_index = 0; reg_num_index < reg_set->num_registers; ++reg_num_index)
- {
- const uint32_t reg_num = reg_set->registers[reg_num_index];
- // FIXME double check we're checking the right register kind here.
- if (reg_info->kinds[RegisterKind::eRegisterKindLLDB] == reg_num)
- {
- // The given register is a member of this register set. Return the register set name.
- return reg_set->name;
- }
- }
- }
-
- // Didn't find it.
- return nullptr;
-}
-
-lldb::addr_t
-NativeRegisterContext::GetPC (lldb::addr_t fail_value)
-{
- Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
-
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
- if (log)
- log->Printf ("NativeRegisterContext::%s using reg index %" PRIu32 " (default %" PRIu64 ")", __FUNCTION__, reg, fail_value);
-
- const uint64_t retval = ReadRegisterAsUnsigned (reg, fail_value);
-
- if (log)
- log->Printf ("NativeRegisterContext::%s " PRIu32 " retval %" PRIu64, __FUNCTION__, retval);
-
- return retval;
-}
-
-Error
-NativeRegisterContext::SetPC (lldb::addr_t pc)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
- return WriteRegisterFromUnsigned (reg, pc);
-}
-
-lldb::addr_t
-NativeRegisterContext::GetSP (lldb::addr_t fail_value)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
- return ReadRegisterAsUnsigned (reg, fail_value);
-}
-
-Error
-NativeRegisterContext::SetSP (lldb::addr_t sp)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
- return WriteRegisterFromUnsigned (reg, sp);
-}
-
-lldb::addr_t
-NativeRegisterContext::GetFP (lldb::addr_t fail_value)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FP);
- return ReadRegisterAsUnsigned (reg, fail_value);
-}
-
-Error
-NativeRegisterContext::SetFP (lldb::addr_t fp)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FP);
- return WriteRegisterFromUnsigned (reg, fp);
-}
-
-lldb::addr_t
-NativeRegisterContext::GetReturnAddress (lldb::addr_t fail_value)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
- return ReadRegisterAsUnsigned (reg, fail_value);
-}
-
-lldb::addr_t
-NativeRegisterContext::GetFlags (lldb::addr_t fail_value)
-{
- uint32_t reg = ConvertRegisterKindToRegisterNumber (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS);
- return ReadRegisterAsUnsigned (reg, fail_value);
-}
-
-
-lldb::addr_t
-NativeRegisterContext::ReadRegisterAsUnsigned (uint32_t reg, lldb::addr_t fail_value)
-{
- if (reg != LLDB_INVALID_REGNUM)
- return ReadRegisterAsUnsigned (GetRegisterInfoAtIndex (reg), fail_value);
- return fail_value;
-}
-
-uint64_t
-NativeRegisterContext::ReadRegisterAsUnsigned (const RegisterInfo *reg_info, lldb::addr_t fail_value)
-{
- Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
-
- if (reg_info)
- {
- RegisterValue value;
- Error error = ReadRegister (reg_info, value);
- if (error.Success ())
- {
- if (log)
- log->Printf ("NativeRegisterContext::%s ReadRegister() succeeded, value %" PRIu64, __FUNCTION__, value.GetAsUInt64());
- return value.GetAsUInt64();
- }
- else
- {
- if (log)
- log->Printf ("NativeRegisterContext::%s ReadRegister() failed, error %s", __FUNCTION__, error.AsCString ());
- }
- }
- else
- {
- if (log)
- log->Printf ("NativeRegisterContext::%s ReadRegister() null reg_info", __FUNCTION__);
- }
- return fail_value;
-}
-
-Error
-NativeRegisterContext::WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval)
-{
- if (reg == LLDB_INVALID_REGNUM)
- return Error ("NativeRegisterContext::%s (): reg is invalid", __FUNCTION__);
- return WriteRegisterFromUnsigned (GetRegisterInfoAtIndex (reg), uval);
-}
-
-Error
-NativeRegisterContext::WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval)
-{
- assert (reg_info);
- if (!reg_info)
- return Error ("reg_info is nullptr");
-
- RegisterValue value;
- if (!value.SetUInt(uval, reg_info->byte_size))
- return Error ("RegisterValue::SetUInt () failed");
-
- return WriteRegister (reg_info, value);
-}
-
-lldb::tid_t
-NativeRegisterContext::GetThreadID() const
-{
- return m_thread.GetID();
-}
-
-uint32_t
-NativeRegisterContext::NumSupportedHardwareBreakpoints ()
-{
- return 0;
-}
-
-uint32_t
-NativeRegisterContext::SetHardwareBreakpoint (lldb::addr_t addr, size_t size)
-{
- return LLDB_INVALID_INDEX32;
-}
-
-bool
-NativeRegisterContext::ClearHardwareBreakpoint (uint32_t hw_idx)
-{
- return false;
-}
-
-
-uint32_t
-NativeRegisterContext::NumSupportedHardwareWatchpoints ()
-{
- return 0;
-}
-
-uint32_t
-NativeRegisterContext::SetHardwareWatchpoint (lldb::addr_t addr, size_t size, uint32_t watch_flags)
-{
- return LLDB_INVALID_INDEX32;
-}
-
-bool
-NativeRegisterContext::ClearHardwareWatchpoint (uint32_t hw_index)
-{
- return false;
-}
-
-bool
-NativeRegisterContext::HardwareSingleStep (bool enable)
-{
- return false;
-}
-
-Error
-NativeRegisterContext::ReadRegisterValueFromMemory (
- const RegisterInfo *reg_info,
- lldb::addr_t src_addr,
- lldb::addr_t src_len,
- RegisterValue ®_value)
-{
- Error error;
- if (reg_info == nullptr)
- {
- error.SetErrorString ("invalid register info argument.");
- return error;
- }
-
-
- // Moving from addr into a register
- //
- // Case 1: src_len == dst_len
- //
- // |AABBCCDD| Address contents
- // |AABBCCDD| Register contents
- //
- // Case 2: src_len > dst_len
- //
- // Error! (The register should always be big enough to hold the data)
- //
- // Case 3: src_len < dst_len
- //
- // |AABB| Address contents
- // |AABB0000| Register contents [on little-endian hardware]
- // |0000AABB| Register contents [on big-endian hardware]
- if (src_len > RegisterValue::kMaxRegisterByteSize)
- {
- error.SetErrorString ("register too small to receive memory data");
- return error;
- }
-
- const lldb::addr_t dst_len = reg_info->byte_size;
-
- if (src_len > dst_len)
- {
- error.SetErrorStringWithFormat("%" PRIu64 " bytes is too big to store in register %s (%" PRIu64 " bytes)", src_len, reg_info->name, dst_len);
- return error;
- }
-
- NativeProcessProtocolSP process_sp (m_thread.GetProcess ());
- if (!process_sp)
- {
- error.SetErrorString("invalid process");
- return error;
- }
-
- uint8_t src[RegisterValue::kMaxRegisterByteSize];
-
- // Read the memory
- lldb::addr_t bytes_read;
- error = process_sp->ReadMemory (src_addr, src, src_len, bytes_read);
- if (error.Fail ())
- return error;
-
- // Make sure the memory read succeeded...
- if (bytes_read != src_len)
- {
- // This might happen if we read _some_ bytes but not all
- error.SetErrorStringWithFormat("read %" PRIu64 " of %" PRIu64 " bytes", bytes_read, src_len);
- return error;
- }
-
- // We now have a memory buffer that contains the part or all of the register
- // value. Set the register value using this memory data.
- // TODO: we might need to add a parameter to this function in case the byte
- // order of the memory data doesn't match the process. For now we are assuming
- // they are the same.
- lldb::ByteOrder byte_order;
- if (!process_sp->GetByteOrder (byte_order))
- {
- error.SetErrorString ( "NativeProcessProtocol::GetByteOrder () failed");
- return error;
- }
-
- reg_value.SetFromMemoryData (
- reg_info,
- src,
- src_len,
- byte_order,
- error);
-
- return error;
-}
-
-Error
-NativeRegisterContext::WriteRegisterValueToMemory (
- const RegisterInfo *reg_info,
- lldb::addr_t dst_addr,
- lldb::addr_t dst_len,
- const RegisterValue ®_value)
-{
-
- uint8_t dst[RegisterValue::kMaxRegisterByteSize];
-
- Error error;
-
- NativeProcessProtocolSP process_sp (m_thread.GetProcess ());
- if (process_sp)
- {
-
- // TODO: we might need to add a parameter to this function in case the byte
- // order of the memory data doesn't match the process. For now we are assuming
- // they are the same.
- lldb::ByteOrder byte_order;
- if (!process_sp->GetByteOrder (byte_order))
- return Error ("NativeProcessProtocol::GetByteOrder () failed");
-
- const lldb::addr_t bytes_copied = reg_value.GetAsMemoryData (
- reg_info,
- dst,
- dst_len,
- byte_order,
- error);
-
- if (error.Success())
- {
- if (bytes_copied == 0)
- {
- error.SetErrorString("byte copy failed.");
- }
- else
- {
- lldb::addr_t bytes_written;
- error = process_sp->WriteMemory (dst_addr, dst, bytes_copied, bytes_written);
- if (error.Fail ())
- return error;
-
- if (bytes_written != bytes_copied)
- {
- // This might happen if we read _some_ bytes but not all
- error.SetErrorStringWithFormat("only wrote %" PRIu64 " of %" PRIu64 " bytes", bytes_written, bytes_copied);
- }
- }
- }
- }
- else
- error.SetErrorString("invalid process");
-
- return error;
-}
-
-uint32_t
-NativeRegisterContext::ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) const
-{
- const uint32_t num_regs = GetRegisterCount();
-
- assert (kind < kNumRegisterKinds);
- for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
- {
- const RegisterInfo *reg_info = GetRegisterInfoAtIndex (reg_idx);
-
- if (reg_info->kinds[kind] == num)
- return reg_idx;
- }
-
- return LLDB_INVALID_REGNUM;
-}
-
-
Removed: lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp?rev=227928&view=auto
==============================================================================
--- lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp (original)
+++ lldb/trunk/source/Target/NativeRegisterContextRegisterInfo.cpp (removed)
@@ -1,50 +0,0 @@
-//===-- NativeRegisterContex.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-types.h"
-#include "lldb/lldb-private-forward.h"
-#include "lldb/Target/NativeRegisterContextRegisterInfo.h"
-
-using namespace lldb_private;
-
-NativeRegisterContextRegisterInfo::NativeRegisterContextRegisterInfo (NativeThreadProtocol &thread,
- uint32_t concrete_frame_idx,
- RegisterInfoInterface *register_info_interface) :
- NativeRegisterContext (thread, concrete_frame_idx),
- m_register_info_interface_up (register_info_interface)
-{
- assert (register_info_interface && "null register_info_interface");
-}
-
-uint32_t
-NativeRegisterContextRegisterInfo::GetRegisterCount () const
-{
- return m_register_info_interface_up->GetRegisterCount ();
-}
-
-uint32_t
-NativeRegisterContextRegisterInfo::GetUserRegisterCount () const
-{
- return m_register_info_interface_up->GetUserRegisterCount ();
-}
-
-const RegisterInfo *
-NativeRegisterContextRegisterInfo::GetRegisterInfoAtIndex (uint32_t reg_index) const
-{
- if (reg_index <= GetRegisterCount ())
- return m_register_info_interface_up->GetRegisterInfo () + reg_index;
- else
- return nullptr;
-}
-
-const RegisterInfoInterface&
-NativeRegisterContextRegisterInfo::GetRegisterInfoInterface () const
-{
- return *m_register_info_interface_up;
-}
More information about the lldb-commits
mailing list