llvm-project/lldb/source/Utility
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
..
ARM64_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM64_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ARM_DWARF_Registers.h Break some dependencies in lldbUtility. 2017-02-01 19:45:14 +00:00
ARM_ehframe_Registers.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ArchSpec.cpp Log to the process channel, not target twice. 2018-05-01 00:42:17 +00:00
Args.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Baton.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
CMakeLists.txt Move Args.cpp from Interpreter to Utility 2018-04-17 18:53:35 +00:00
Connection.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
ConstString.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataBufferHeap.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataBufferLLVM.cpp Make sure DataBufferLLVM contents are writable 2017-12-21 10:54:30 +00:00
DataEncoder.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
DataExtractor.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Environment.cpp Add Utility/Environment class for handling... environments 2018-01-10 11:57:31 +00:00
FastDemangle.cpp Enable AUTOBRIEF in doxygen configuration. 2018-05-02 16:55:16 +00:00
FileSpec.cpp [FileSpec] Re-implmenet removeLastPathComponent 2018-05-30 13:03:16 +00:00
History.cpp Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
IOObject.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
JSON.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
LLDBAssert.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
Log.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Logging.cpp Logging: Disable logging after fork() 2017-10-23 19:41:17 +00:00
NameMatches.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
PPC64LE_DWARF_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64LE_ehframe_Registers.h Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
PPC64_DWARF_Registers.h Add SysV Abi for PPC64le 2018-01-22 11:27:43 +00:00
Range.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
RegularExpression.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
SelectHelper.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
SharingPtr.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
Status.cpp Typo fixes. 2018-05-29 09:10:46 +00:00
Stream.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StreamCallback.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamGDBRemote.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StreamString.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StringExtractor.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringExtractorGDBRemote.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
StringLexer.cpp [Utility/StringLexer] Remove dead code. 2017-04-19 18:18:25 +00:00
StringList.cpp iwyu fixes on lldbUtility. 2017-04-06 18:12:24 +00:00
StructuredData.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
TildeExpressionResolver.cpp s/LLVM_ON_WIN32/_WIN32/, lldb 2018-04-10 13:33:45 +00:00
Timer.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
UUID.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
UriParser.cpp Fix some warnings found by ToT clang 2017-11-02 21:35:26 +00:00
UserID.cpp Move many other files from Core -> Utility. 2017-03-06 18:34:25 +00:00
UuidCompatibility.h
VASprintf.cpp Reflow paragraphs in comments. 2018-04-30 16:49:04 +00:00
VMRange.cpp [VMRange] Remove unused FindRangeIndexThatContainsValue(). 2017-06-09 21:01:55 +00:00