[Lldb-commits] [lldb] r284114 - [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-13 Thread Richard Chamberlain via lldb-commits
Author: rnchamberlain
Date: Thu Oct 13 07:11:00 2016
New Revision: 284114

URL: http://llvm.org/viewvc/llvm-project?rev=284114=rev
Log:
[lldb] Improve identification of Linux core dumps. Fix for bug #30485.

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.

Reviewers: ted, hhellyer, clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D25179

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=284114=284113=284114=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Thu Oct 13 
07:11:00 2016
@@ -1405,8 +1405,7 @@ ObjectFileELF::RefineModuleDetailsFromNo
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.contains("/lib/x86_64-linux-gnu") || 
path.contains("/lib/i386-linux-gnu")) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-11 Thread Richard Chamberlain via lldb-commits
rnchamberlain added a comment.

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


https://reviews.llvm.org/D25179



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-11 Thread Richard Chamberlain via lldb-commits
rnchamberlain updated this revision to Diff 74248.
rnchamberlain added a comment.

Updating as suggested to use StringRef.contains()


https://reviews.llvm.org/D25179

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,7 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.contains("/lib/x86_64-linux-gnu") || 
path.contains("/lib/i386-linux-gnu")) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,7 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.contains("/lib/x86_64-linux-gnu") || path.contains("/lib/i386-linux-gnu")) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-03 Thread Richard Chamberlain via lldb-commits
rnchamberlain added a comment.

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


https://reviews.llvm.org/D25179



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25179: [lldb] Improve identification of Linux core dumps. Fix for bug #30485.

2016-10-03 Thread Richard Chamberlain via lldb-commits
rnchamberlain created this revision.
rnchamberlain added reviewers: clayborg, ted, hhellyer.
rnchamberlain added a subscriber: lldb-commits.

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.


https://reviews.llvm.org/D25179

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,8 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.find("/lib/x86_64-linux-gnu") != llvm::StringRef::npos ||
+  path.find("/lib/i386-linux-gnu") != llvm::StringRef::npos) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1405,8 +1405,8 @@
 return error;
   }
   llvm::StringRef path(cstr);
-  if (path.startswith("/lib/x86_64-linux-gnu") ||
-  path.startswith("/lib/i386-linux-gnu")) {
+  if (path.find("/lib/x86_64-linux-gnu") != llvm::StringRef::npos ||
+  path.find("/lib/i386-linux-gnu") != llvm::StringRef::npos) {
 arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
 break;
   }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits