This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Improve identification of Linux core dumps. Fix for bug #30485.
ClosedPublic

Authored by rnchamberlain on Oct 3 2016, 2:18 AM.

Details

Summary

ObjectFileELF::RefineModuleDetailsFromNote() identifies Linux core dumps by searching for
library paths starting with /lib/x86_64-linux-gnu or /lib/i386-linux-gnu. This change widens the
test to allow for linux installations which have addition directories in the path.

Event Timeline

rnchamberlain retitled this revision from to [lldb] Improve identification of Linux core dumps. Fix for bug #30485..
rnchamberlain updated this object.
rnchamberlain added reviewers: clayborg, ted, hhellyer.
rnchamberlain added a subscriber: lldb-commits.

More information, including readelf output from the dump, in the bugzilla here: https://llvm.org/bugs/show_bug.cgi?id=30485

hhellyer edited edge metadata.Oct 5 2016, 2:49 AM

The change seems unlikely to pick up many false positives and core dumps from the type of system described in the bug are only going to get more common.

clayborg requested changes to this revision.Oct 10 2016, 10:26 AM
clayborg edited edge metadata.

Use "llvm::StringRef::contains". See inline comment.

source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
1408–1409

I believe Zach Turner added a "contains" function to StringRef which we should use here:

if (path.contains("/lib/x86_64-linux-gnu") || path.contains("/lib/i386-linux-gnu")) {
This revision now requires changes to proceed.Oct 10 2016, 10:26 AM
rnchamberlain edited edge metadata.

Updating as suggested to use StringRef.contains()

Thanks, that's nicer. I did have a look for a 'contains()' method, but it has not made it into the docs yet.
http://llvm.org/docs/doxygen/html/classllvm_1_1StringRef.html

clayborg accepted this revision.Oct 11 2016, 11:15 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Oct 11 2016, 11:15 AM
rnchamberlain closed this revision.Oct 13 2016, 5:20 AM