Skip to content

Clarify error messages on corefiles that no plugin handles #72559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jasonmolenda
Copy link
Collaborator

These error messages are written in a way that makes sense to an lldb developer, but not to an end user who asks lldb to run on a compressed corefile or whatever. Simplfy the messages.

These error messages are written in a way that makes sense
to an lldb developer, but not to an end user who asks lldb
to run on a compressed corefile or whatever.  Simplfy the
messages.
@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2023

@llvm/pr-subscribers-lldb

Author: Jason Molenda (jasonmolenda)

Changes

These error messages are written in a way that makes sense to an lldb developer, but not to an end user who asks lldb to run on a compressed corefile or whatever. Simplfy the messages.


Full diff: https://github.com/llvm/llvm-project/pull/72559.diff

3 Files Affected:

  • (modified) lldb/source/Commands/CommandObjectTarget.cpp (+3-5)
  • (modified) lldb/source/Core/IOHandlerCursesGUI.cpp (+2-2)
  • (modified) lldb/test/API/commands/target/basic/TestTargetCommand.py (+1-1)
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 8f052d0a7b837e2..58785cde3ec7c63 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -436,8 +436,7 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
           error = process_sp->LoadCore();
 
           if (error.Fail()) {
-            result.AppendError(
-                error.AsCString("can't find plug-in for core file"));
+            result.AppendError(error.AsCString("unknown core file format"));
             return;
           } else {
             result.AppendMessageWithFormatv(
@@ -447,9 +446,8 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
             on_error.release();
           }
         } else {
-          result.AppendErrorWithFormatv(
-              "Unable to find process plug-in for core file '{0}'\n",
-              core_file.GetPath());
+          result.AppendErrorWithFormatv("Unknown core file format '{0}'\n",
+                                        core_file.GetPath());
         }
       } else {
         result.AppendMessageWithFormat(
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index 22b8cc3582eae78..abf0b6b801f37fc 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -3178,13 +3178,13 @@ class TargetCreateFormDelegate : public FormDelegate {
         m_debugger.GetListener(), llvm::StringRef(), &core_file_spec, false));
 
     if (!process_sp) {
-      SetError("Unable to find process plug-in for core file!");
+      SetError("Unknown core file format!");
       return;
     }
 
     Status status = process_sp->LoadCore();
     if (status.Fail()) {
-      SetError("Can't find plug-in for core file!");
+      SetError("Unknown core file format!");
       return;
     }
   }
diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index 96e7fe86ac5aee5..cb7a5f33f6643e8 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -447,7 +447,7 @@ def test_target_create_invalid_core_file(self):
         self.expect(
             "target create -c '" + invalid_core_path + "'",
             error=True,
-            substrs=["Unable to find process plug-in for core file '"],
+            substrs=["Unknown core file format '"],
         )
 
     # Write only files don't seem to be supported on Windows.

Copy link
Member

@medismailben medismailben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. LGTM!

@jasonmolenda jasonmolenda merged commit 5f64b94 into llvm:main Nov 16, 2023
@jasonmolenda jasonmolenda deleted the simplify-unknown-corefile-format-error-message branch November 16, 2023 21:58
jasonmolenda added a commit to swiftlang/llvm-project that referenced this pull request Nov 17, 2023
These error messages are written in a way that makes sense to an lldb
developer, but not to an end user who asks lldb to run on a compressed
corefile or whatever. Simplfy the messages.

(cherry picked from commit 5f64b94)
jasonmolenda added a commit to swiftlang/llvm-project that referenced this pull request Nov 17, 2023
…ror-messaGe

Clarify error messages on corefiles that no plugin handles (llvm#72559)
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
These error messages are written in a way that makes sense to an lldb
developer, but not to an end user who asks lldb to run on a compressed
corefile or whatever. Simplfy the messages.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
These error messages are written in a way that makes sense to an lldb
developer, but not to an end user who asks lldb to run on a compressed
corefile or whatever. Simplfy the messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants