Skip to content

Commit 614137b

Browse files
authored
Merge pull request #7808 from jasonmolenda/refine-unknown-corefile-error-messaGe
Clarify error messages on corefiles that no plugin handles (llvm#72559)
2 parents 4105a44 + e688a2a commit 614137b

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
@@ -434,8 +434,7 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
434434
error = process_sp->LoadCore();
435435

436436
if (error.Fail()) {
437-
result.AppendError(
438-
error.AsCString("can't find plug-in for core file"));
437+
result.AppendError(error.AsCString("unknown core file format"));
439438
return false;
440439
} else {
441440
result.AppendMessageWithFormatv(
@@ -445,9 +444,8 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
445444
on_error.release();
446445
}
447446
} else {
448-
result.AppendErrorWithFormatv(
449-
"Unable to find process plug-in for core file '{0}'\n",
450-
core_file.GetPath());
447+
result.AppendErrorWithFormatv("Unknown core file format '{0}'\n",
448+
core_file.GetPath());
451449
}
452450
} else {
453451
result.AppendMessageWithFormat(

lldb/source/Core/IOHandlerCursesGUI.cpp

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

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

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

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)