Skip to content

Commit 5f64b94

Browse files
authored
Clarify error messages on corefiles that no plugin handles (#72559)
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.
1 parent 102f7fc commit 5f64b94

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
436436
error = process_sp->LoadCore();
437437

438438
if (error.Fail()) {
439-
result.AppendError(
440-
error.AsCString("can't find plug-in for core file"));
439+
result.AppendError(error.AsCString("unknown core file format"));
441440
return;
442441
} else {
443442
result.AppendMessageWithFormatv(
@@ -447,9 +446,8 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
447446
on_error.release();
448447
}
449448
} else {
450-
result.AppendErrorWithFormatv(
451-
"Unable to find process plug-in for core file '{0}'\n",
452-
core_file.GetPath());
449+
result.AppendErrorWithFormatv("Unknown core file format '{0}'\n",
450+
core_file.GetPath());
453451
}
454452
} else {
455453
result.AppendMessageWithFormat(

lldb/source/Core/IOHandlerCursesGUI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,13 +3178,13 @@ class TargetCreateFormDelegate : public FormDelegate {
31783178
m_debugger.GetListener(), llvm::StringRef(), &core_file_spec, false));
31793179

31803180
if (!process_sp) {
3181-
SetError("Unable to find process plug-in for core file!");
3181+
SetError("Unknown core file format!");
31823182
return;
31833183
}
31843184

31853185
Status status = process_sp->LoadCore();
31863186
if (status.Fail()) {
3187-
SetError("Can't find plug-in for core file!");
3187+
SetError("Unknown core file format!");
31883188
return;
31893189
}
31903190
}

lldb/test/API/commands/target/basic/TestTargetCommand.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def test_target_create_invalid_core_file(self):
447447
self.expect(
448448
"target create -c '" + invalid_core_path + "'",
449449
error=True,
450-
substrs=["Unable to find process plug-in for core file '"],
450+
substrs=["Unknown core file format '"],
451451
)
452452

453453
# Write only files don't seem to be supported on Windows.

0 commit comments

Comments
 (0)