[Lldb-commits] [lldb] r288122 - Remove ConnectionSharedMemory

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 29 01:42:36 PST 2016


Author: labath
Date: Tue Nov 29 03:42:35 2016
New Revision: 288122

URL: http://llvm.org/viewvc/llvm-project?rev=288122&view=rev
Log:
Remove ConnectionSharedMemory

This class is unused.

Removed:
    lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h
    lldb/trunk/source/Core/ConnectionSharedMemory.cpp
Modified:
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Core/CMakeLists.txt

Removed: lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h?rev=288121&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h (original)
+++ lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h (removed)
@@ -1,61 +0,0 @@
-//===-- ConnectionSharedMemory.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_ConnectionSharedMemory_h_
-#define liblldb_ConnectionSharedMemory_h_
-
-// C Includes
-// C++ Includes
-#include <string>
-
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/Connection.h"
-#include "lldb/Core/DataBufferMemoryMap.h"
-
-namespace lldb_private {
-
-class ConnectionSharedMemory : public Connection {
-public:
-  ConnectionSharedMemory();
-
-  ~ConnectionSharedMemory() override;
-
-  bool IsConnected() const override;
-
-  virtual lldb::ConnectionStatus BytesAvailable(uint32_t timeout_usec,
-                                                Error *error_ptr);
-
-  lldb::ConnectionStatus Connect(llvm::StringRef s, Error *error_ptr) override;
-
-  lldb::ConnectionStatus Disconnect(Error *error_ptr) override;
-
-  size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout,
-              lldb::ConnectionStatus &status, Error *error_ptr) override;
-
-  size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status,
-               Error *error_ptr) override;
-
-  std::string GetURI() override;
-
-  lldb::ConnectionStatus Open(bool create, const char *name, size_t size,
-                              Error *error_ptr);
-
-protected:
-  std::string m_name;
-  int m_fd; // One buffer that contains all we need
-  DataBufferMemoryMap m_mmap;
-
-private:
-  DISALLOW_COPY_AND_ASSIGN(ConnectionSharedMemory);
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_ConnectionSharedMemory_h_

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=288122&r1=288121&r2=288122&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov 29 03:42:35 2016
@@ -215,7 +215,6 @@
 		2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */; };
 		2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; settings = {COMPILER_FLAGS = "-Dregister="; }; };
 		26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; };
-		266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */; };
 		2666ADC61B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC11B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp */; };
 		2666ADC81B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC31B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp */; };
 		2668020E115FD12C008E1FE4 /* lldb-defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1665,8 +1664,6 @@
 		26651A15133BF9CC005B64B7 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Opcode.h; path = include/lldb/Core/Opcode.h; sourceTree = "<group>"; };
 		26651A17133BF9DF005B64B7 /* Opcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Opcode.cpp; path = source/Core/Opcode.cpp; sourceTree = "<group>"; };
 		2665CD0D15080846002C8FAE /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
-		266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConnectionSharedMemory.cpp; path = source/Core/ConnectionSharedMemory.cpp; sourceTree = "<group>"; };
-		266603CC1345B5C0004DA8B6 /* ConnectionSharedMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConnectionSharedMemory.h; path = include/lldb/Core/ConnectionSharedMemory.h; sourceTree = "<group>"; };
 		2666ADC11B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderHexagonDYLD.cpp; sourceTree = "<group>"; };
 		2666ADC21B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderHexagonDYLD.h; sourceTree = "<group>"; };
 		2666ADC31B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HexagonDYLDRendezvous.cpp; sourceTree = "<group>"; };
@@ -4657,8 +4654,6 @@
 				26BC7E6E10F1B85900F91463 /* Communication.cpp */,
 				26BC7D5710F1B77400F91463 /* Connection.h */,
 				26BC7E6F10F1B85900F91463 /* Connection.cpp */,
-				266603CC1345B5C0004DA8B6 /* ConnectionSharedMemory.h */,
-				266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */,
 				26BC7D7C10F1B77400F91463 /* ConstString.h */,
 				26BC7E9410F1B85900F91463 /* ConstString.cpp */,
 				26BC7D5910F1B77400F91463 /* DataBuffer.h */,
@@ -7463,7 +7458,6 @@
 				23D065911D4A7BEE0008EDE6 /* RenderScriptx86ABIFixups.cpp in Sources */,
 				26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */,
 				3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm in Sources */,
-				266603CA1345B5A8004DA8B6 /* ConnectionSharedMemory.cpp in Sources */,
 				4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */,
 				4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */,
 				946216C21A97C080006E19CC /* OptionValueLanguage.cpp in Sources */,

Modified: lldb/trunk/source/Core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CMakeLists.txt?rev=288122&r1=288121&r2=288122&view=diff
==============================================================================
--- lldb/trunk/source/Core/CMakeLists.txt (original)
+++ lldb/trunk/source/Core/CMakeLists.txt Tue Nov 29 03:42:35 2016
@@ -9,7 +9,6 @@ add_lldb_library(lldbCore
   Broadcaster.cpp
   Communication.cpp
   Connection.cpp
-  ConnectionSharedMemory.cpp
   ConstString.cpp
   DataBufferHeap.cpp
   DataBufferMemoryMap.cpp

Removed: lldb/trunk/source/Core/ConnectionSharedMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionSharedMemory.cpp?rev=288121&view=auto
==============================================================================
--- lldb/trunk/source/Core/ConnectionSharedMemory.cpp (original)
+++ lldb/trunk/source/Core/ConnectionSharedMemory.cpp (removed)
@@ -1,146 +0,0 @@
-//===-- ConnectionSharedMemory.cpp ------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef __ANDROID_NDK__
-
-#include "lldb/Core/ConnectionSharedMemory.h"
-
-// C Includes
-#ifdef _WIN32
-#include "lldb/Host/windows/windows.h"
-#else
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#endif
-
-// C++ Includes
-#include <cerrno>
-#include <cstdlib>
-
-// Other libraries and framework includes
-#include "llvm/Support/ConvertUTF.h"
-#include "llvm/Support/MathExtras.h"
-
-// Project includes
-#include "lldb/Core/Communication.h"
-#include "lldb/Core/Log.h"
-#include "lldb/Host/PosixApi.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-ConnectionSharedMemory::ConnectionSharedMemory()
-    : Connection(), m_name(), m_fd(-1), m_mmap() {}
-
-ConnectionSharedMemory::~ConnectionSharedMemory() { Disconnect(nullptr); }
-
-bool ConnectionSharedMemory::IsConnected() const { return m_fd >= 0; }
-
-ConnectionStatus ConnectionSharedMemory::Connect(llvm::StringRef s,
-                                                 Error *error_ptr) {
-  //    if (s && s[0])
-  //    {
-  //        if (strstr(s, "shm-create://"))
-  //        {
-  //        }
-  //        else if (strstr(s, "shm-connect://"))
-  //        {
-  //        }
-  //        if (error_ptr)
-  //            error_ptr->SetErrorStringWithFormat ("unsupported connection
-  //            URL: '%s'", s);
-  //        return eConnectionStatusError;
-  //    }
-  if (error_ptr)
-    error_ptr->SetErrorString("invalid connect arguments");
-  return eConnectionStatusError;
-}
-
-ConnectionStatus ConnectionSharedMemory::Disconnect(Error *error_ptr) {
-  m_mmap.Clear();
-  if (!m_name.empty()) {
-#ifdef _WIN32
-    close(m_fd);
-    m_fd = -1;
-#else
-    shm_unlink(m_name.c_str());
-#endif
-    m_name.clear();
-  }
-  return eConnectionStatusSuccess;
-}
-
-size_t ConnectionSharedMemory::Read(void *dst, size_t dst_len,
-                                    const Timeout<std::micro> &timeout,
-                                    ConnectionStatus &status,
-                                    Error *error_ptr) {
-  status = eConnectionStatusSuccess;
-  return 0;
-}
-
-size_t ConnectionSharedMemory::Write(const void *src, size_t src_len,
-                                     ConnectionStatus &status,
-                                     Error *error_ptr) {
-  status = eConnectionStatusSuccess;
-  return 0;
-}
-
-std::string ConnectionSharedMemory::GetURI() {
-  // TODO: fix when Connect is fixed?
-  return "";
-}
-
-ConnectionStatus ConnectionSharedMemory::BytesAvailable(uint32_t timeout_usec,
-                                                        Error *error_ptr) {
-  return eConnectionStatusLostConnection;
-}
-
-ConnectionStatus ConnectionSharedMemory::Open(bool create, const char *name,
-                                              size_t size, Error *error_ptr) {
-  if (m_fd != -1) {
-    if (error_ptr)
-      error_ptr->SetErrorString("already open");
-    return eConnectionStatusError;
-  }
-
-  m_name.assign(name);
-
-#ifdef _WIN32
-  HANDLE handle = INVALID_HANDLE_VALUE;
-  std::wstring wname;
-  if (llvm::ConvertUTF8toWide(name, wname)) {
-    if (create) {
-      handle = CreateFileMappingW(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE,
-                                  llvm::Hi_32(size), llvm::Lo_32(size),
-                                  wname.c_str());
-    } else
-      handle = OpenFileMappingW(FILE_MAP_ALL_ACCESS, FALSE, wname.c_str());
-  }
-
-  m_fd = _open_osfhandle((intptr_t)handle, 0);
-#else
-  int oflag = O_RDWR;
-  if (create)
-    oflag |= O_CREAT;
-  m_fd = ::shm_open(m_name.c_str(), oflag, S_IRUSR | S_IWUSR);
-
-  if (create)
-    ::ftruncate(m_fd, size);
-#endif
-
-  if (m_mmap.MemoryMapFromFileDescriptor(m_fd, 0, size, true, false) == size)
-    return eConnectionStatusSuccess;
-
-  Disconnect(nullptr);
-  return eConnectionStatusError;
-}
-
-#endif // __ANDROID_NDK__




More information about the lldb-commits mailing list