From 25c910137abe33d02bf0d7b5c7a455eb2e4f3d2d Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Fri, 26 Jun 2015 02:16:48 +0000 Subject: [PATCH] When the user specifies a corefile that is not readable, give them a meaningful error message instead of "Unable to find process plug-in for core file ...". http://blog.ignoranthack.me/?p=204 llvm-svn: 240753 --- lldb/source/Commands/CommandObjectTarget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 7257ff36f4f8..448da0ede245 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -387,6 +387,12 @@ protected: core_file.GetPath(core_path, sizeof(core_path)); if (core_file.Exists()) { + if (!core_file.Readable()) + { + result.AppendMessageWithFormat ("Core file '%s' is not readable.\n", core_path); + result.SetStatus (eReturnStatusFailed); + return false; + } FileSpec core_file_dir; core_file_dir.GetDirectory() = core_file.GetDirectory(); target_sp->GetExecutableSearchPaths ().Append (core_file_dir);