Move GetFileName() to platform.cpp
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Tue, 18 Jul 2017 17:00:00 +0000 (20:00 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 13 Nov 2017 19:22:40 +0000 (22:22 +0300)
src/debug/netcoredbg/frames.cpp
src/debug/netcoredbg/jmc.cpp
src/debug/netcoredbg/modules.cpp
src/debug/netcoredbg/platform.cpp
src/debug/netcoredbg/platform.h

index 94ec5f9..ff491b4 100644 (file)
@@ -7,11 +7,11 @@
 #include <iomanip>
 
 #include "typeprinter.h"
+#include "platform.h"
 
 std::string EscapeMIValue(const std::string &str);
 
 HRESULT GetModuleId(ICorDebugModule *pModule, std::string &id);
-std::string GetFileName(const std::string &path);
 
 HRESULT GetFrameLocation(ICorDebugFrame *pFrame,
                          ULONG32 &ilOffset,
index 2643f67..ecd6563 100644 (file)
@@ -5,9 +5,7 @@
 #include <list>
 
 #include "typeprinter.h"
-
-std::string GetFileName(const std::string &path);
-
+#include "platform.h"
 
 static const char *g_nonUserCode = "System.Diagnostics.DebuggerNonUserCodeAttribute..ctor";
 
index 57341f4..2b31778 100644 (file)
@@ -248,12 +248,6 @@ HRESULT GetModuleId(ICorDebugModule *pModule, std::string &id)
     return S_OK;
 }
 
-std::string GetFileName(const std::string &path)
-{
-    std::size_t i = path.find_last_of("/\\");
-    return i == std::string::npos ? path : path.substr(i + 1);
-}
-
 HRESULT TryLoadModuleSymbols(ICorDebugModule *pModule,
                              std::string &id,
                              std::string &name,
index ecd1116..de4dc56 100644 (file)
@@ -28,6 +28,12 @@ unsigned long OSPageSize()
     return pageSize;
 }
 
+std::string GetFileName(const std::string &path)
+{
+    std::size_t i = path.find_last_of("/\\");
+    return i == std::string::npos ? path : path.substr(i + 1);
+}
+
 void AddFilesFromDirectoryToTpaList(const std::string &directory, std::string &tpaList)
 {
     const char * const tpaExtensions[] = {
index a89c85b..9c2e86e 100644 (file)
@@ -2,3 +2,4 @@ unsigned long OSPageSize();
 void AddFilesFromDirectoryToTpaList(const std::string &directory, std::string &tpaList);
 std::string GetExeAbsPath();
 std::string GetCoreCLRPath(int pid);
+std::string GetFileName(const std::string &path);