[Lldb-commits] [PATCH] D31461: Add NetBSD path for Debugging Information in Separate Files

Kamil Rytarowski via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 29 07:09:38 PDT 2017


krytarowski created this revision.
krytarowski added a project: LLDB.
Herald added a subscriber: aprantl.

NetBSD stores debug information files in the `/usr/libdata/debug` path.

This change fixes debugging distribution executables, e.g. `look`(1):

  $ lldb /usr/bin/look                                                                                                                                
  (lldb) target create "/usr/bin/look"
  Current executable set to '/usr/bin/look' (x86_64).
  (lldb) b main
  Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0000000000000da6
  (lldb) r
  Process 23473 launched: '/usr/bin/look' (x86_64)
  Process 23473 stopped
  * thread #1, stop reason = breakpoint 1.1
      frame #0: 0x0000000186600da6 look`main(argc=1, argv=0x00007f7fffc7c488) at look.c:107
     104  
     105          string = NULL;
     106          file = _PATH_WORDS;
  -> 107          termchar = '\0';
     108          while ((ch = getopt(argc, argv, "dft:")) != -1)
     109                  switch(ch) {
     110                  case 'd':
  (lldb)

There is no `/usr/lib/debug` path on NeBSD, so remove it from search.

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D31461

Files:
  source/Host/common/Symbols.cpp


Index: source/Host/common/Symbols.cpp
===================================================================
--- source/Host/common/Symbols.cpp
+++ source/Host/common/Symbols.cpp
@@ -212,8 +212,13 @@
     debug_file_search_paths.AppendIfUnique(FileSpec(".", true));
 
 #ifndef LLVM_ON_WIN32
+#if defined(__NetBSD__)
+    // Add /usr/libdata/debug directory.
+    debug_file_search_paths.AppendIfUnique(FileSpec("/usr/libdata/debug", true));
+#else
     // Add /usr/lib/debug directory.
     debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true));
+#endif
 #endif // LLVM_ON_WIN32
 
     std::string uuid_str;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31461.93371.patch
Type: text/x-patch
Size: 624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170329/918355d8/attachment.bin>


More information about the lldb-commits mailing list