llvm-project/lldb
Jonas Devlieghere df8e291ef9 [FileSpec] Re-implmenet removeLastPathComponent
When reading DBGSourcePathRemapping from a dSYM, we remove the last two
path components to make the source lookup more general. However, when
dealing with a relative path that has less than 2 components, we ended
up with an invalid (empty) FileSpec.

This patch changes the behavior of removeLastPathComponent to remove the
last path component, if possible. It does this by checking whether a
parent path exists, and if so using that as the new path. We rely
entirely on LLVM's path implementation to do the heavy lifting.

We now also return a boolean which indicates whether the operator was
successful or not.

Differential revision: https://reviews.llvm.org/D47495

rdar://37791687

llvm-svn: 333540
2018-05-30 13:03:16 +00:00
..
cmake Fix typo in CMake comments 2018-05-25 18:59:21 +00:00
docs Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
examples Added a BSD archive tool. 2018-04-02 17:20:21 +00:00
include/lldb [FileSpec] Re-implmenet removeLastPathComponent 2018-05-30 13:03:16 +00:00
lit [lit] Add support for passing arguments to dotest.py via lit. 2018-05-29 16:49:07 +00:00
lldb.xcodeproj Fix Xcode build broken by SystemInitializerFull.h move 2018-05-25 23:21:07 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite @skipUnlessDarwin TestOrderedSet 2018-05-30 10:04:32 +00:00
resources
scripts build: use cmake to find the libedit content 2018-05-22 23:24:46 +00:00
source [FileSpec] Re-implmenet removeLastPathComponent 2018-05-30 13:03:16 +00:00
test [test] Fix --framework argument passed to dotest. 2018-05-29 12:30:27 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools Typo fixes. 2018-05-29 09:10:46 +00:00
unittests [FileSpec] Re-implmenet removeLastPathComponent 2018-05-30 13:03:16 +00:00
utils [CMake] Unify and relayer testing 2018-05-03 16:54:10 +00:00
www Typo fixes. 2018-05-29 09:10:46 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt [test] Fix --framework argument passed to dotest. 2018-05-29 12:30:27 +00:00
CODE_OWNERS.txt Remove Sean Callanan from the CODE_OWNERS, he won't have time 2017-11-01 01:38:42 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00