This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add a note to the core file loading error message that mentions archives
Needs ReviewPublic

Authored by teemperor on Feb 17 2021, 11:59 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Core files are frequently compressed in some compressed archive and users aren't aware that LLDB can't
extract the core file for them. Because of this there is usually one question every day on why
LLDB is giving them a cryptic error message when they open their compressed core file:

error: Unable to find process plug-in for core file '/tmp/core.gz

This just adds a note that compressed core files need to be decompressed first before LLDB can do anything
with them.

Diff Detail

Event Timeline

teemperor created this revision.Feb 17 2021, 11:59 PM
teemperor requested review of this revision.Feb 17 2021, 11:59 PM
JDevlieghere added inline comments.Feb 18 2021, 12:09 AM
lldb/source/Commands/CommandObjectTarget.cpp
431

For consistency with warning and error, Note should be lowercase.

[begin potential yak shaving]
It would be nice to extend CommandReturnObject with the notion of notes. That way they could be colored in the same way that error and warning are. LLVM's WithColor already has a dedicated note color.
[end potential yak shaving]

  • Made note: lower case
teemperor added inline comments.Feb 18 2021, 12:14 AM
lldb/source/Commands/CommandObjectTarget.cpp
431

Fixed the typo.

+1 to the 'note' variation. I'll see if we can make that happen but not as a dependency of this commit (we anyway already have some other places where this should be done).

Thanks for taking time to deal with this annoying error message. Should we just remove the "Unable to find process plug-in for core file" text altogether? It means nothing unless you work on lldb and understand the plugin system. "Unrecognized core file format" is equivalent and more helpful to the user I think.

JDevlieghere added inline comments.Feb 18 2021, 12:14 AM
lldb/source/Commands/CommandObjectTarget.cpp
431

Yep, definitely something for a separate patch.

I mean, I'm also fine with suggesting that the file might be compressed, because this is a REAL common source of an unrecognized core file format. But also we can more clearly say "Doesn't look like a core file to me" and also noting that compression is something to look at is cool.

I mean, I'm also fine with suggesting that the file might be compressed, because this is a REAL common source of an unrecognized core file format. But also we can more clearly say "Doesn't look like a core file to me" and also noting that compression is something to look at is cool.

What about:

error: Couldn't recognise core file format of <PATH>.
note: If the file is a core file in a compressed file archive, it first needs to be manually extracted before it can be loaded.

What about:

error: Couldn't recognise core file format of <PATH>.
note: If the file is a core file in a compressed file archive, it first needs to be manually extracted before it can be loaded.

Looks good to me. Although I would write it with the freedom spelling of recognize. :)

What about:

error: Couldn't recognise core file format of <PATH>.
note: If the file is a core file in a compressed file archive, it first needs to be manually extracted before it can be loaded.

Looks good to me. Although I would write it with the freedom spelling of recognize. :)

We could compromise and spell it as recogniße (which combines s and z into one letter).

What about:

error: Couldn't recognise core file format of <PATH>.
note: If the file is a core file in a compressed file archive, it first needs to be manually extracted before it can be loaded.

Looks good to me. Although I would write it with the freedom spelling of recognize. :)

We could compromise and spell it as recogniße (which combines s and z into one letter).

im ded. :crabpls:

  • Also clarify error message.