[PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.

Caroline Tice via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 2 10:50:34 PST 2021


cmtice created this revision.
cmtice added a reviewer: jingham.
Herald added subscribers: cishida, hiraditya.
Herald added a reviewer: int3.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
cmtice requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, lldb-commits, sstefan1.
Herald added projects: LLDB, LLVM.

DWARF allows .dwo file paths to be relative rather than absolute.  When they are relative, DWARF uses DW_AT_comp_dir to find the .dwo file.  DW_AT_comp_dir can also be relative, making the entire search patch for the .dwo file relative.  In this case, LLDB currently searches relative to its current working directory, i.e. the directory from which the debugger was launched.  This is not right, as the compiler, which generated the relative paths, can have no idea where the debugger will be launched.  The correct thing is to search relative to the location of the executable binary.  That is what this patch does.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97786

Files:
  lld/MachO/Driver.h
  lld/MachO/InputFiles.cpp
  lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libReexportSystem.tbd
  lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
  lld/test/MachO/reexport-nested-lib.s
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  llvm/include/llvm/TextAPI/MachO/InterfaceFile.h
  llvm/lib/TextAPI/MachO/InterfaceFile.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97786.327515.patch
Type: text/x-patch
Size: 9052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210302/af58c990/attachment.bin>


More information about the llvm-commits mailing list