llvm-project/lldb
Zachary Turner d5bd3a1e6a Make file / directory completion work properly on Windows.
There were a couple of problems with this function on Windows. Different
separators and differences in how tilde expressions are resolved for
starters, but in addition there was no clear indication of what the
function's inputs or outputs were supposed to be, and there were no tests
to demonstrate its use.

To more easily paper over the differences between Windows paths,
non-Windows paths, and tilde expressions, I've ported this function to use
LLVM-based directory iteration (in fact, I would like to eliminate all of
LLDB's directory iteration code entirely since LLVM's is cleaner / more
efficient (i.e. it invokes fewer stat calls)). and llvm's portable path
manipulation library.

Since file and directory completion assumes you are referring to files and
directories on your local machine, it's safe to assume the path syntax
properties of the host in doing so, so LLVM's APIs are perfect for this.

I've also added a fairly robust set of unit tests. Since you can't really
predict what users will be on your machine, or what their home directories
will be, I added an interface called TildeExpressionResolver, and in the
unit test I've mocked up a fake implementation that acts like a unix
password database. This allows us to configure some fake users and home
directories in the test, so we can exercise all of those hard-to-test
codepaths that normally otherwise depend on the host.

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

llvm-svn: 297585
2017-03-12 18:18:50 +00:00
..
cmake [CMake] Final dependency cleanup patch! 2017-02-08 21:00:46 +00:00
docs Fix a race condition in FuncUnwinders where the mutex was being 2017-02-24 03:35:46 +00:00
examples Improve crashlog.py so it can handle more iOS crashlog files. 2016-12-08 00:22:45 +00:00
include/lldb Make file / directory completion work properly on Windows. 2017-03-12 18:18:50 +00:00
lit [test] Fix finding LLDB tools when building stand-alone 2017-02-19 22:11:38 +00:00
lldb.xcodeproj cleanup. 2017-03-07 00:00:35 +00:00
lldb.xcworkspace Revert r275223, which committed the wrong thing. 2016-07-12 23:31:42 +00:00
packages/Python/lldbsuite fix xunit attribute parsing 2017-03-11 00:58:41 +00:00
resources Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
scripts A few improvements to deps analysis scripts. 2017-03-06 17:41:00 +00:00
source Make file / directory completion work properly on Windows. 2017-03-12 18:18:50 +00:00
test test: pass correct objcopy and ar paths to the test runner 2017-03-01 10:08:44 +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 fix format specifier warnings 2017-03-07 21:26:04 +00:00
unittests Make file / directory completion work properly on Windows. 2017-03-12 18:18:50 +00:00
utils *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
www Python commands as first class citizens. 2017-03-02 22:24:01 +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 test infra: clear file-charged issues on rerun of file 2016-10-01 00:17:08 +00:00
CMakeLists.txt Install six.py conditionally 2017-02-04 00:20:24 +00:00
CODE_OWNERS.txt Greg Clayton is no longer working at Apple, he will continue to 2017-03-01 00:00:45 +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