From 5e95aa85bb660d45e9905ef1d7180b2678280660 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Fri, 3 Jul 2015 16:57:06 +0000 Subject: Import LLDB as of upstream SVN 241361 (git 612c075f) --- tools/lldb-mi/MIUtilSystemWindows.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'tools/lldb-mi/MIUtilSystemWindows.cpp') diff --git a/tools/lldb-mi/MIUtilSystemWindows.cpp b/tools/lldb-mi/MIUtilSystemWindows.cpp index f03fa225cd908..19c6e9eb979f6 100644 --- a/tools/lldb-mi/MIUtilSystemWindows.cpp +++ b/tools/lldb-mi/MIUtilSystemWindows.cpp @@ -7,18 +7,6 @@ // //===----------------------------------------------------------------------===// -//++ -// File: MIUtilSystemWindows.cpp -// -// Overview: CMIUtilSystemWindows implementation. -// -// Environment: Compilers: Visual C++ 12. -// gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 -// Libraries: See MIReadmetxt. -// -// Copyright: None. -//-- - #if defined(_MSC_VER) // Third party headers @@ -29,6 +17,7 @@ // In-house headers: #include "MIUtilSystemWindows.h" #include "MICmnResources.h" +#include "MIUtilFileStd.h" //++ ------------------------------------------------------------------------------------ // Details: CMIUtilSystemWindows constructor. @@ -122,15 +111,13 @@ CMIUtilSystemWindows::GetExecutablesPath(CMIUtilString &vrwFileNamePath) const bool bOk = MIstatus::success; HMODULE hModule = ::GetModuleHandle(nullptr); char pPath[MAX_PATH]; - const DWORD nLen = ::GetModuleFileName(hModule, &pPath[0], MAX_PATH); - const CMIUtilString strLastErr(GetOSLastError()); - if ((nLen != 0) && (strLastErr == "Unknown OS error")) - vrwFileNamePath = &pPath[0]; - else + if (!::GetModuleFileName(hModule, &pPath[0], MAX_PATH)) { bOk = MIstatus::failure; - vrwFileNamePath = strLastErr; + vrwFileNamePath = GetOSLastError(); } + else + vrwFileNamePath = &pPath[0]; return bOk; } @@ -147,7 +134,8 @@ CMIUtilSystemWindows::GetExecutablesPath(CMIUtilString &vrwFileNamePath) const bool CMIUtilSystemWindows::GetLogFilesPath(CMIUtilString &vrwFileNamePath) const { - return GetExecutablesPath(vrwFileNamePath); + vrwFileNamePath = CMIUtilString("."); + return MIstatus::success; } #endif // #if defined( _MSC_VER ) -- cgit v1.2.3