Skip to content

Clarify error messages on corefiles that no plugin handles (#72559) #7808

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lldb/source/Commands/CommandObjectTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,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 false;
} else {
result.AppendMessageWithFormatv(
Expand All @@ -445,9 +444,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(
Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Core/IOHandlerCursesGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3179,13 +3179,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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/commands/target/basic/TestTargetCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down