Commit Graph

20353 Commits

Author SHA1 Message Date
Raphael Isemann 250cef2c7d [lldb][NFC] Try fixing TestCompletion.py on Windows
llvm-svn: 370316
2019-08-29 09:57:02 +00:00
Raphael Isemann a884a06c92 [lldb][NFC] Also test operator new/new[]/delete/delete[]/comma/addr-of
llvm-svn: 370315
2019-08-29 09:39:33 +00:00
Sylvestre Ledru c6e825efc7 use https for llvm.org in the doc
llvm-svn: 370303
2019-08-29 07:20:08 +00:00
Sylvestre Ledru 2831d1aedd fix the bugzilla url
llvm-svn: 370302
2019-08-29 07:19:14 +00:00
Sylvestre Ledru d07de02291 Provide a real link to the doc and remove old information
llvm-svn: 370301
2019-08-29 07:14:09 +00:00
Davide Italiano 54b3aa91d0 [python] remove testsuite vestiges.
llvm-svn: 370287
2019-08-29 01:45:10 +00:00
Davide Italiano a633d29ba1 [TSanRuntime] Upstream thread swift race detector.
Summary:
This is self-contained, and doesn't need anything in the
compiler to work. Mainly to reduce the diff between upstream
and downstream.

Patch by Kuba Mracek!

Reviewers: kubamracek

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 370286
2019-08-29 01:39:26 +00:00
Jonas Devlieghere 5c04497217 [dotest] Make dotest.py invocation repeatable
This removes support for reading the LLDB_TEST_ARGUMENTS environment
variable and instead requires all arguments to be specified as part of
the invocation. This ensures that dotest.py invocations are easily
repeatable.

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

llvm-svn: 370278
2019-08-28 23:54:23 +00:00
Jonas Devlieghere 311ae45228 [dotest] Remove --event-add-entries
This argument was used by dosep.py to pass information around from the
workers. With dosep.py gone, I'm fairly sure we don't need this any
longer.

llvm-svn: 370266
2019-08-28 21:31:53 +00:00
Jonas Devlieghere 5970076466 [dotest] Remove --rerun-max-file-threshold
This variable corresponding to this argument is set but never read.

llvm-svn: 370264
2019-08-28 21:24:41 +00:00
Jonas Devlieghere 3331fd8228 [dotest] Centralize and simplify session dir logic (NFC)
I was looking at the session directory logic for unrelated reasons and
noticed that the logic spread out across dotest. This simplifies things
a bit by moving the logic together.

llvm-svn: 370259
2019-08-28 20:54:17 +00:00
Alex Langford 3e45e3ba95 [Core] Use GetAPInt instead of constructing APInts in place
GetAPInt should be able to handle all cases. I have plans to generalize
the float dumping logic and this makes it easier to do later.

llvm-svn: 370255
2019-08-28 20:15:57 +00:00
Jonas Devlieghere ff2e965ad0 [test] Temporarily disable two tests on Windows
Disable the two failing tests until Raphael has a chance to investigate:

Failing Tests (2):
    lldb-Suite :: functionalities/completion/TestCompletion.py
    lldb-Suite :: functionalities/target_command/TestTargetCommand.py

llvm-svn: 370237
2019-08-28 18:04:14 +00:00
Jonas Devlieghere b18f11eeea [dotest] Remove outdates TODO
The referenced function `find_test_files_in_dir_tree` no longer exists.

llvm-svn: 370235
2019-08-28 17:38:50 +00:00
Jonas Devlieghere dfc34efa6b [dotest] Don't try to guess the lldb binary & python dir.
Now that all supported build systems create a valid dotest.py
invocation, we no longer need to guess the location of the lldb binary
and Python directory.

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

llvm-svn: 370234
2019-08-28 17:38:48 +00:00
Jonas Devlieghere 165d47969a [dotest] Don't try to guess the llvm binary dir.
Now that all supported build systems create a valid dotest.py
invocation, we no longer need to guess the directory where any of the
llvm tools live. Additionally, the current logic is incomplete: it
doesn't try to find any other tools than FileCheck, such as dsymutil for
example.

If no FileCheck is provided, we should print a warning and skip the
tests that need it, but that's not part of this patch.

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

llvm-svn: 370232
2019-08-28 17:06:28 +00:00
Jonas Devlieghere 0a114b3571 [dotest] Don't spend time replacing spaces in print output.
Replacing all spaces with dashes seems like a lot of needless work for a
string that's just printed.

llvm-svn: 370231
2019-08-28 17:06:26 +00:00
Jonas Devlieghere f48ebacfcc [TestCppOperators] Enable TestCppOperators on Windows.
This test is passing on the Windows bot:

Unexpected Passing Tests (1):
    lldb-Suite :: lang/cpp/operators/TestCppOperators.py

llvm-svn: 370227
2019-08-28 16:29:00 +00:00
Jonas Devlieghere b543c16869 [dotest] Remove -q (quiet) flag.
This patch removes the -q (quiet) flag and changing the default
behavior. Currently the flag serves two purposes that are somewhat
contradictory, as illustrated by the difference between the argument
name (quiet) and the configuration flag (parsable). On the one hand it
reduces output, but on the other hand it prints more output, like the
result of individual tests. My proposal is to guard the extra output
behind the verbose flag and always print the individual test results.

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

llvm-svn: 370226
2019-08-28 16:28:58 +00:00
Raphael Isemann 2f323fc790 [lldb][NFC] Refactor and document ClangASTContext::IsOperator
Should make it clearer what actually is going on in there.

llvm-svn: 370201
2019-08-28 13:46:01 +00:00
Raphael Isemann 4046e1ee21 [lldb][NFC] Test named operators like new and function names that might confuse LLDB
llvm-svn: 370199
2019-08-28 13:33:52 +00:00
Raphael Isemann 95686fa898 [lldb][NFC] Actually run all expects in lang/cpp/operators
Apparently inline tests stop running anything after an empty line
behind an self.expect, which is a very good approach that could
never cause people to write tests that never run.

This patch removes all the empty lines so that all this test
is actually run. Also fixes the broken expects that only passed
because they weren't run before.

llvm-svn: 370195
2019-08-28 12:32:58 +00:00
Raphael Isemann 05e2e290c0 [lldb][NFC] Extend operator test case with conversion operators
llvm-svn: 370194
2019-08-28 12:14:39 +00:00
Raphael Isemann f0ad3e4093 [lldb][NFC] Test custom C++ operators
llvm-svn: 370186
2019-08-28 11:18:47 +00:00
Raphael Isemann efb8b7b1ec [lldb] Fix and test completion for ambiguous long options
The refactoring patch for the option completion broke the completion
for ambiguous long options. As this feature was also untested (as
testing ambiguous options with the current test methods is impossible),
I just noticed now. This patch restores the old behavior and adds a
test for this feature.

llvm-svn: 370185
2019-08-28 10:17:23 +00:00
Raphael Isemann ac5a475b53 [lldb][NFC] Get rid of C-strings in HandleOptionCompletion
llvm-svn: 370179
2019-08-28 09:32:30 +00:00
Raphael Isemann 9774a2ba27 [lldb][NFC] Update documentation of Handle[Argument]Completion
We no longer have return values or any of the mentioned arguments
in these functions since the introduction of CompletionRequest.

llvm-svn: 370174
2019-08-28 09:02:32 +00:00
Jason Molenda deeda85f3f Update name of objc runtime SPI function we call for class names.
A new SPI was added to the objc runtime to get class names without
any demangling; AppleObjCRuntimeV2::ParseClassInfoArray was using
the original prototype name but had not been updated for the final
name yet, so lldb was falling back to the old function and doing
extra work for classes that were demangled.  This commit fixes that.

llvm-svn: 370152
2019-08-28 02:14:07 +00:00
Jonas Devlieghere eb0df9b285 [lit] Fix the way we check if an environment var is set
The old method would throw a KeyError.

llvm-svn: 370138
2019-08-28 00:52:08 +00:00
Jonas Devlieghere de37c444ef [test] Disable TestConcurrentManySignals on Darwin.
This test is flaky on GreenDragon. Disable it until we figure out why.

llvm-svn: 370136
2019-08-28 00:35:37 +00:00
Jonas Devlieghere 1fcdcd09bc [lit] Don't set DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set.
Setting DYLD_INSERT_LIBRARIES to the Asan runtime and DYLD_LIBRARY_PATH
to the LLVM shared library dir causes the test suite to crash with a
segfault. We see this on the LLDB sanitized bot [1] on GreenDragon. I've
spent some time investigating, but I'm not sure what's going on (yet).

Originally I thought this was because we were building compiler-rt and
were loading an incompatible, just-built Asan library. However, the
issue persists even without compiler-rt. It doesn't look like the Asan
runtime is opening any other libraries that might be found in LLVM's
shared library dir and talking to the team confirms that. Another
possible explanation is that we're loading lldb form a place we don't
expect, but that doesn't make sense either, because DYLD_LIBRARY_PATH is
always set without the crash. I tried different Python versions and
interpreters but the issue persist.

As a (temporary?) workaround I propose not setting DYLD_LIBRARY_PATH
when DYLD_INSERT_LIBRARIES is set so we can turn the Asan bot on again
and get useful results.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-sanitized/

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

llvm-svn: 370135
2019-08-28 00:32:19 +00:00
Adrian Prantl 29db51dad4 Revert "[lldb] Move redundant persistent variable counter to ClangPersistentVariables"
This reverts commit r367842 since it wasn't quite as NFC as advertised
and broke Swift support.  See https://reviews.llvm.org/D46083 for the
rationale behind the original functionality.

rdar://problem/54619322

llvm-svn: 370126
2019-08-27 22:50:40 +00:00
Jonas Devlieghere 50c094a368 [dotest] Remove check for LLDB_TESTSUITE_FORCE_FINISH
llvm-svn: 370120
2019-08-27 21:59:24 +00:00
Nathan Lanza 0c01d92051 [Platform/Android] Read the adb server from an env variable if set
Summary:
The environment variable ANDROID_ADB_SERVER_PORT can be defined to have
adbd litsen on a different port. Teach lldb how to understand this via
simply checking the env var.

Reviewers: xiaobai, clayborg

Subscribers: srhines

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

llvm-svn: 370106
2019-08-27 20:00:02 +00:00
Jonas Devlieghere 2d247359cc [dotest] Remove results port
The results port was used by dosep.py to deal with test results coming
form different processes. With dosep.py gone, I don't think we need this
any longer.

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

llvm-svn: 370090
2019-08-27 18:18:46 +00:00
Tatyana Krasnukha 900f9ba217 [lldb] Fix x86 compilation
Differential Revision: https://reviews.llvm.org/D66655

Patch by Leonid Mashinskiy

llvm-svn: 370078
2019-08-27 17:22:03 +00:00
Raphael Isemann eb5a8afbdd [lldb][NFC] Add missing invalid_core_file to TestTargetCommand test
llvm-svn: 370057
2019-08-27 13:34:15 +00:00
Pavel Labath 4f91faa965 Stabilize TestIOHandlerCompletion
pexpect gives as raw data going to a terminal. This means that if the
completed line does not fit the emulated line, the returned data will
contain line breaks. On my machine these line breaks happened to be
inside the "iohandler/completion" string that the test was searching
for.

Work around this by telling pexpect to emulate a very wide terminal.

llvm-svn: 370054
2019-08-27 13:09:40 +00:00
Raphael Isemann 2bdbb6a046 [lldb][NFC] Add some tests for the target subcommands
llvm-svn: 370050
2019-08-27 11:57:26 +00:00
Raphael Isemann 73f01068a7 [lldb][NFC] Give added test method a unique name
Otherwise dotest doesn't run the test and just lets it always pass.
Also update the comment to explain that we do directory and not
file completion.

llvm-svn: 370047
2019-08-27 11:43:54 +00:00
Gabor Marton f035b75d8f [ASTImporter] Fix name conflict handling with different strategies
There are numorous flaws about the name conflict handling, this patch
attempts fixes them. Changes in details:

* HandleNameConflict return with a false DeclarationName

Hitherto we effectively never returned with a NameConflict error, even
if the preceding StructuralMatch indicated a conflict.
Because we just simply returned with the parameter `Name` in
HandleNameConflict and that name is almost always `true` when converted to
`bool`.

* Add tests which indicate wrong NameConflict handling

* Add to ConflictingDecls only if decl kind is different

Note, we might not indicate an ODR error when there is an existing record decl
and a enum is imported with same name.  But there are other cases. E.g. think
about the case when we import a FunctionTemplateDecl with name f and we found a
simple FunctionDecl with name f. They overload.  Or in case of a
ClassTemplateDecl and CXXRecordDecl, the CXXRecordDecl could be the 'templated'
class, so it would be false to report error.  So I think we should report a
name conflict error only when we are 100% sure of that.  That is why I think it
should be a general pattern to report the error only if the kind is the same.

* Fix failing ctu test with EnumConstandDecl

In ctu-main.c we have the enum class 'A' which brings in the enum
constant 'x' with value 0 into the global namespace.
In ctu-other.c we had the enum class 'B' which brought in the same name
('x') as an enum constant but with a different enum value (42). This is clearly
an ODR violation in the global namespace. The solution was to rename the
second enum constant.

 * Introduce ODR handling strategies

Reviewers: a_sidorin, shafik

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

llvm-svn: 370045
2019-08-27 11:36:10 +00:00
Raphael Isemann 5edee822d2 [lldb] Allow partial completions to fix directory completion.
On the command line we usually insert a space after a completion to indicate that
the completion was successful. After the completion API refactoring, this also
happens with directories which essentially breaks file path completion (as
adding a space terminates the path and starts a new arg). This patch restores the old
behavior by again allowing partial completions. Also extends the iohandler
and SB API tests as the implementation for this is different in Editline
and SB API.

llvm-svn: 370043
2019-08-27 11:32:22 +00:00
Pavel Labath e588b8b664 DWARFExpression: Simplify class interface
Summary:
The DWARFExpression methods have a lot of arguments. This removes two of
them by removing the ability to slice the expression via two offset+size
parameters. This is a functionality that it is not always needed, and
when it is, we already have a different handy way of slicing a data
extractor which we can use instead.

Reviewers: JDevlieghere, clayborg

Subscribers: aprantl, lldb-commits

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

llvm-svn: 370027
2019-08-27 07:49:41 +00:00
Pavel Labath 3131aed59b Fix an unused variable warning in no-assert builds
llvm-svn: 370026
2019-08-27 07:46:07 +00:00
Pavel Labath 8a915f6b2e Fix TestStdCXXDisassembly.py
missing decorator import.

llvm-svn: 370020
2019-08-27 06:43:45 +00:00
Pavel Labath 365b30a3fa CommandObjectExpression: Fix a misleading-indentation warning
llvm-svn: 370019
2019-08-27 06:42:42 +00:00
Jonas Devlieghere 828a3a974f [test] Disable two of the recently (re)enabled tests on Windows.
This disables two tests on Windows that I re-enabled in r369995.

llvm-svn: 370003
2019-08-27 01:34:19 +00:00
Jonas Devlieghere ece176e0f6 [ConnectionFileDescriptor] Add shutdown check in ::Write.
The disconnect method sets the shutdown flag to true. This currently
only prevents any reads from happening, but not writes, which is
incorrect. Presumably this was just an oversight when adding
synchronization to the class. This adds the same shutdown check to the
Write method.

Over-the-shoulder reviewed by Jim!

llvm-svn: 370002
2019-08-27 01:34:16 +00:00
Jonas Devlieghere 27cb29a596 [dotest] Remove long running test "decorator" and re-enable tests.
Today I discovered the skipLongRunningTest decorator and to my surprise
all the tests were passing without the decorator. They don't seem to be
that expensive either, they take a few seconds but we have tests that
take much longer than that. As such I propose to remove the decorator
and enable them by default.

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

llvm-svn: 369995
2019-08-27 00:18:22 +00:00
Jason Molenda fe64323fd5 Send error message on failed attach from debugerserver.
Instead of using a magic return error code from debugserver to
indicate that an attach failed because of SIP being enabled in
RNBRemote::HandlePacket_v, use the extended error reporting that
Pavel added to lldb/lldb-server in https://reviews.llvm.org/D45573


<rdar://problem/39398385> 

llvm-svn: 369990
2019-08-27 00:08:27 +00:00
Vedant Kumar ba7e191e43 [build_exception] Decode build failure messages
This is so that the test harness pretty-prints build error messages in
trace mode, instead of dumping a raw python bytes object.

llvm-svn: 369987
2019-08-26 23:24:45 +00:00
Alex Langford 5e777e1ed2 [Core] GetAPInt should return an Optional
The current implementation returns a bool for indicating success and
whether or not the APInt passed by reference was populated. Instead of
doing that, I think it makes more sense to return an Optional<APInt>.

llvm-svn: 369970
2019-08-26 21:09:57 +00:00
Raphael Isemann cb2380c9fa [lldb][NFC] Remove dead code that handles situations where LLDB has no dummy target
Summary:
We always have a dummy target, so any error handling regarding a missing dummy target is dead code now.
Also makes the CommandObject methods that return Target& to express this fact in the API.

This patch just for the CommandObject part of LLDB. I'll migrate the rest of LLDB in a follow-up patch that's WIP.

Reviewers: labath

Reviewed By: labath

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 369939
2019-08-26 18:12:44 +00:00
Frederic Riss 7305397a14 TestFunctionStarts.py: add synchronization
We have started to see the no_binary version of this test
fail. The reason is that the binary was being removed
before the spawn actually launched the inferior. Add a
simple filesystem based synchronization to avoid this race.

llvm-svn: 369930
2019-08-26 17:14:05 +00:00
Jonas Devlieghere a69992c8cb [dotest] Print invocation when encountering an error.
With this patch dotest.py will print the full invocation whenever it
fails to parse its arguments. The dotest invocation is usually build up
with different inputs, potentially coming from CMake, lldb-dotest, lit
or passed directly. This can make debugging hard, especially on CI,
where there might be another layer of indirection. This aims to make
that a bit easier.

llvm-svn: 369922
2019-08-26 16:08:53 +00:00
Pavel Labath 341df3f13a Really fix the type mismatch error in GDBRemoteCommunicationServerCommon
My previous attempt in attempt in r369904 actually broke the 32bit build
because File::Read expects to take a reference to size_t. Fix the
warning by using SIZE_MAX to denote failure instead.

llvm-svn: 369910
2019-08-26 13:56:33 +00:00
Tatyana Krasnukha 55aafa35ea [ProcessWindows] Remove equivalent macros
llvm-svn: 369908
2019-08-26 13:35:59 +00:00
Pavel Labath b54efd28c4 Move ProcessInstanceInfoTest to Utility
The class under test was moved in r355342. This moves the test code too.

llvm-svn: 369907
2019-08-26 13:07:02 +00:00
Pavel Labath 602f29fd7c ProcessInstanceInfo: Fix dumping of invalid user ids
Don't attempt to print invalid user ids. Previously, these would come
out as UINT32_MAX, or as an assertion failure.

llvm-svn: 369906
2019-08-26 13:03:21 +00:00
Pavel Labath f899bf135f Fix windows build after r369894
Constructing a std::vector from a llvm::map_range fails on windows,
apparently because std::vector expects the input iterator to have a
const operator* (map_range iterator has a non-const one).

This avoids the cleverness and unrolls the map-loop manually (which is
also slightly shorter).

llvm-svn: 369905
2019-08-26 12:42:32 +00:00
Pavel Labath 27f56c1200 Fix a type mismatch error in GDBRemoteCommunicationServerCommon
GetU64 returns a uint64_t. Don't store it in size_t as that is only
32-bit on 32-bit platforms.

llvm-svn: 369904
2019-08-26 12:42:28 +00:00
Pavel Labath c7deb7f808 Postfix: move more code out of the PDB plugin
Summary:
Previously we moved the code which parses a single expression out of the PDB
plugin, because that was useful for DWARF expressions in breakpad. However, FPO
programs are used in breakpad files too (when unwinding on windows), so this
completes the job, and moves the rest of the FPO parser too.

Reviewers: amccarth, aleksandr.urakov

Subscribers: aprantl, markmentovai, rnk, lldb-commits

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

llvm-svn: 369894
2019-08-26 11:44:14 +00:00
Pavel Labath 0a9f47d7cc Breakpad: Add support for parsing STACK WIN records
Summary: The fields that aren't useful for us right now are simply ignored.

Reviewers: amccarth, markmentovai

Subscribers: rnk, lldb-commits

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

llvm-svn: 369892
2019-08-26 11:25:28 +00:00
Raphael Isemann d43d912b4b [lldb] Construct the dummy target when the first Debugger object is constructed
Summary:
We should always have a dummy target, so we might as well construct it directly when we create a Debugger object.

The idea is that if this patch doesn't cause any problems that we can get rid of all the logic
that handles situations where we don't have a dummy target (as all that code is currently
untested as there seems to be no way to have no dummy target in LLDB).

Reviewers: labath, jingham

Reviewed By: labath, jingham

Subscribers: jingham, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 369885
2019-08-26 09:20:59 +00:00
Raphael Isemann 72ca5f3694 [lldb][NFC] Add ProcessInfo::GetNameAsStringRef to simplify some code
llvm-svn: 369880
2019-08-26 08:22:52 +00:00
Jonas Devlieghere 0a8a225f8e [NFC] Fix comments and formatting.
llvm-svn: 369827
2019-08-23 23:56:19 +00:00
Vedant Kumar 77017ad306 Skip tail call frame tests when dwarf_version < 4
rdar://problem/54656572

llvm-svn: 369821
2019-08-23 22:28:46 +00:00
Adrian Prantl f869ec8d49 Upstream support for macCatalyst Mach-O binaries.
On macOS one Mach-O slice can contain multiple load commands: One load
command for being loaded into a macOS process and one load command for
being loaded into a macCatalyst process. This patch adds support for
the new load command and makes sure ObjectFileMachO returns the
Architecture that matches the Module.

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

llvm-svn: 369814
2019-08-23 21:28:14 +00:00
Saleem Abdulrasool e7823a5316 Windows: explicitly cast constants to `DWORD`
STATUS_SINGLE_STEP and STATUS_BREAKPOINT are defined as 0x8------ which
is negative and thus can't be implicitly narrowed to a DWORD which is
unsigned.  The value is defined differently across winnt.h and ntstatus.h.

Patch by Gwen Mittertreiner!

llvm-svn: 369788
2019-08-23 17:58:53 +00:00
Alex Langford cb68bd726d [Symbol] Decouple clang from DeclVendor
Summary:
This removes DeclVendor's dependency on clang (and ClangASTContext).
DeclVendor has no need to know about specific TypeSystems.

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

llvm-svn: 369735
2019-08-23 06:11:32 +00:00
Jonas Devlieghere 6c9dc12caa [LLDB] Address post-commit code review feedback.
This patch addresses Adrian McCarthy's code review feedback in
https://reviews.llvm.org/D66447

llvm-svn: 369731
2019-08-23 04:11:38 +00:00
Adrian Prantl 40360407d8 Add missing dot.
llvm-svn: 369712
2019-08-22 22:28:18 +00:00
Adrian Prantl aa97a89d83 Extend FindTypes with CompilerContext to allow filtering by language.
This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch.

In multi-language projects it is extremely common to have, e.g., a
Clang type and a similarly-named rendition of that same type in
another language. When searching for a type It is much cheaper to pass
a set of supported languages to the SymbolFile than having it
materialize every result and then rejecting the materialized types
that have the wrong language.

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

<rdar://problem/54471165>

This reapplies r369690 with a previously missing constructor for LanguageSet.

llvm-svn: 369710
2019-08-22 21:45:58 +00:00
Frederic Riss f88dfd8309 TestAppleSimulatorOSType: Pass the --standalone argument to simctl
It looks like running without this argument was supported
for legacy reasons, but a Xcode 11 beta made the argument
mandatory for our usecase.

llvm-svn: 369709
2019-08-22 21:44:10 +00:00
Vedant Kumar 64adf7b6ae Revert [heap.py] Add missing declaration for malloc_get_all_zones
This reverts r369684 (git commit cc62e38d25)

Adding a declaration doesn't appear to be a sufficient fix.

llvm-svn: 369706
2019-08-22 21:01:45 +00:00
Adrian Prantl b041602e3f Revert Extend FindTypes with CompilerContext to allow filtering by language.
This reverts r369690 (git commit aa3a564efa)

llvm-svn: 369702
2019-08-22 20:41:16 +00:00
Adrian Prantl 83108e7556 Rename lldb/source/Interpreter/OptionValueFileSpecListTmp.cpp to
lldb/source/Interpreter/OptionValueFileSpecList.cpp (NFC)

llvm-svn: 369699
2019-08-22 20:10:24 +00:00
Adrian Prantl 06d778f00a Rename lldb/source/Interpreter/OptionValueFileSpecLIst.cpp to
lldb/source/Interpreter/OptionValueFileSpecListTmp.cpp (NFC)

llvm-svn: 369698
2019-08-22 20:08:46 +00:00
Adrian Prantl df5c04e1cd Add missing include
llvm-svn: 369692
2019-08-22 19:32:24 +00:00
Adrian Prantl a90eb1ee9f Add missing include
llvm-svn: 369691
2019-08-22 19:30:10 +00:00
Adrian Prantl aa3a564efa Extend FindTypes with CompilerContext to allow filtering by language.
This patch is also motivated by the Swift branch and is effectively NFC for the single-TypeSystem llvm.org branch.

In multi-language projects it is extremely common to have, e.g., a
Clang type and a similarly-named rendition of that same type in
another language. When searching for a type It is much cheaper to pass
a set of supported languages to the SymbolFile than having it
materialize every result and then rejecting the materialized types
that have the wrong language.

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

<rdar://problem/54471165>

llvm-svn: 369690
2019-08-22 19:24:55 +00:00
Vedant Kumar cc62e38d25 [heap.py] Add missing declaration for malloc_get_all_zones
The evaluation context isn't guaranteed to have this declaration.

Fixes "error: use of undeclared identifier 'malloc_get_all_zones'" bugs.

llvm-svn: 369684
2019-08-22 18:51:03 +00:00
Adrian Prantl 9a0f124f26 Remove redundant curly braces.
llvm-svn: 369670
2019-08-22 16:58:56 +00:00
Adrian Prantl 7be93589c4 Doxygenify comments.
llvm-svn: 369669
2019-08-22 16:52:37 +00:00
Raphael Isemann 4ae79199ed [lldb] Remove ')' to fix the build
That ')' slipped in by accident in the reformatting commit.

llvm-svn: 369660
2019-08-22 15:18:40 +00:00
Jan Kratochvil b17d6c52fd [lldb] Fix `TestDataFormatterStdList` regression
Since D66174 I see failures of TestDataFormatterStdList in about 50% of runs on
Fedora 30 x86_64 libstdc++. I have found out that LLDB internally expects these
RegularExpressions to be matched in their alphabetical order:
	^std::(__cxx11::)?list<.+>(( )?&)?$
	^std::__[[:alnum:]]+::list<.+>(( )?&)?$

But since D66174 they are sometimes matched in reverse order. In fact it was
only some luck it worked before as there is internally
std::map<lldb::RegularExpressionSP, FormatterImpl> (FormattersContainer).

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

llvm-svn: 369655
2019-08-22 14:29:52 +00:00
Raphael Isemann 00235e1b92 [lldb][NFC] Fix indentation in CommandObjectProcess
llvm-svn: 369652
2019-08-22 13:50:54 +00:00
Raphael Isemann 5215770e88 [lldb][NFC] Add test for target stop-hook disable/enable/delete
llvm-svn: 369646
2019-08-22 13:09:02 +00:00
Raphael Isemann 494370c101 [lldb][NFC] Remove unused return value from HandleOptionArgumentCompletion
llvm-svn: 369635
2019-08-22 09:14:42 +00:00
Raphael Isemann 1153dc9603 [lldb][NFC] NFC cleanup for the completion code
llvm-svn: 369632
2019-08-22 09:02:54 +00:00
Raphael Isemann 36162014c4 [lldb][NFC] Remove dead code that is supposed to handle invalid command options
Summary:
We currently have a bunch of code that is supposed to handle invalid command options, but
all this code is unreachable because invalid options are already handled in `Options::Parse`.
The only way we can reach this code is when we declare but then not implement an option
(which will be made impossible with D65386, which is also when we can completely remove
the `default` cases).

This patch replaces all this code with `llvm_unreachable` to make clear this is dead code
that can't be reached.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369625
2019-08-22 08:08:05 +00:00
Raphael Isemann ae34ed2c0d [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values
Summary:
We still have some leftovers of the old completion API in the internals of
LLDB that haven't been replaced by the new CompletionRequest. These leftovers
are:

* The return values (int/size_t) in all completion functions.
* Our result array that starts indexing at 1.
* `WordComplete` mode.

I didn't replace them back then because it's tricky to figure out what exactly they
are used for and the completion code is relatively untested. I finally got around
to writing more tests for the API and understanding the semantics, so I think it's
a good time to get rid of them.

A few words why those things should be removed/replaced:

* The return values are really cryptic, partly redundant and rarely documented.
  They are also completely ignored by Xcode, so whatever information they contain will end up
  breaking Xcode's completion mechanism. They are also partly impossible to even implement
  as we assign negative values special meaning and our completion API sometimes returns size_t.

  Completion functions are supposed to return -2 to rewrite the current line. We seem to use this
  in some untested code path to expand the history repeat character to the full command, but
  I haven't figured out why that doesn't work at the moment.
  Completion functions return -1 to 'insert the completion character', but that isn't implemented
  (even though we seem to activate this feature in LLDB sometimes).
  All positive values have to match the number of results. This is obviously just redundant information
  as the user can just look at the result list to get that information (which is what Xcode does).

* The result array that starts indexing at 1 is obviously unexpected. The first element of the array is
  reserved for the common prefix of all completions (e.g. "foobar" and "footar" -> "foo"). The idea is
  that we calculate this to make the life of the API caller easier, but obviously forcing people to have
  1-based indices is not helpful (or even worse, forces them to manually copy the results to make it
  0-based like Xcode has to do).

* The `WordComplete` mode indicates that LLDB should enter a space behind the completion. The
  idea is that we let the top-level API know that we just provided a full completion. Interestingly we
  `WordComplete` is just a single bool that somehow represents all N completions. And we always
  provide full completions in LLDB, so in theory it should always be true.
  The only use it currently serves is providing redundant information about whether we have a single
  definitive completion or not (which we already know from the number of results we get).

This patch essentially removes `WordComplete` mode and makes the result array indexed from 0.
It also removes all return values from all internal completion functions. The only non-redundant information
they contain is about rewriting the current line (which is broken), so that functionality was moved
to the CompletionRequest API. So you can now do `addCompletion("blub", "description", CompletionMode::RewriteLine)`
to do the same.

For the SB API we emulate the old behaviour by making the array indexed from 1 again with the common
prefix at index 0. I didn't keep the special negative return codes as we either never sent them before (e.g. -2) or we
didn't even implement them in the Editline handler (e.g. -1).

I tried to keep this patch minimal and I'm aware we can probably now even further simplify a bunch of related code,
but I would prefer doing this in follow-up NFC commits

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: arphaman, abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 369624
2019-08-22 07:41:23 +00:00
Jonas Devlieghere 83ee8d4463 [debugserver] Switch back to std::once_flag
We cannot use llvm::once_flag in debugserver because doesn't link
against llvm.

llvm-svn: 369621
2019-08-22 03:48:19 +00:00
Davide Italiano 0a8e634b3b [lldb] Replace std::once_flag with llvm::once_flag.
Summary:
The former seems like it's not working on some platforms.
All the other uses use `llvm::`, so, let's change for consistency.

Reviewers: jasonmolenda, friss

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369618
2019-08-22 03:12:49 +00:00
Jonas Devlieghere 2621f7bdb4 [FormatManage] Fix the format info order
The format info entries need to match the order of the enum entries.
This should fix the two failing data-formatter tests.

llvm-svn: 369617
2019-08-22 03:12:25 +00:00
Jonas Devlieghere 12002fbd21 [FormatManager] Add static_assert to keep formats in sync.
This adds a static assert that ensures that there's a format info entry
for every format enum value. This should prevent others from making the
same mistake I made and Jason kindly fixed in r369611. (Thanks!)

llvm-svn: 369614
2019-08-22 02:56:00 +00:00
Jason Molenda ca4409b4dc The g_format_infos table needs to be updated in concert with the
enum Format entries; else we can crash in a place like
FormatManager::GetFormatAsCString().  We should add  bounds checks
to prevent this more reliably, but for tonight I'm just adding this
entry to keep an address-sanitizer test run working.

llvm-svn: 369611
2019-08-22 02:06:03 +00:00
Jonas Devlieghere 71dc97b5bf [test] Update test so it matches the Windows output
llvm-svn: 369595
2019-08-21 22:32:21 +00:00
Jason Molenda f79f594bd2 When building file without debug info, include the architecture
setting in the cflags on Darwin systems.

llvm-svn: 369584
2019-08-21 21:34:17 +00:00
Jonas Devlieghere c46d39b9e8 Add char8_t support (C++20)
This patch adds support for the char8_t type introduced in C++20
char8_t. The original patch was submitted by James Blachly  on the LLDB
mailing list [1]. I modified the patch a bit and added a test.

[1] http://lists.llvm.org/pipermail/lldb-dev/2019-August/015393.html

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

llvm-svn: 369582
2019-08-21 21:30:55 +00:00
Adrian Prantl 330ae19a1a Generalize FindTypes with CompilerContext to support fuzzy lookup
This patch generalizes the FindTypes with CompilerContext interface to
support looking up a type of unknown kind by name, as well as looking
up a type inside an unspecified submodule. These features are
motivated by the Swift branch, but are fully tested via unit tests and
lldb-test on llvm.org.  Specifically, this patch adds an AnyModule and
an AnyType CompilerContext kind.

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

rdar://problem/54471165

llvm-svn: 369555
2019-08-21 18:06:56 +00:00
Raphael Isemann 717717b1ff [lldb][NFC] Merge multiple TestApropos.py
That's cleaner and makes lldb-dotest no longer fail due to conflicting names.

llvm-svn: 369530
2019-08-21 14:22:59 +00:00
Raphael Isemann 34a04e703d [lldb] Add tests for 'settings remove' and fix error message typos
llvm-svn: 369524
2019-08-21 13:24:21 +00:00
Pavel Labath d139e8838a Recommit "Minidump/Windows: Fix module lookup""
This recommits r368416, which was reverted in r368838 because of test
failures under ASAN. These have been dealt with by llvm r369370.

The original commit message was:
When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Reviewers: clayborg, amccarth

Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits

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

llvm-svn: 369523
2019-08-21 13:20:25 +00:00
Pavel Labath 65a376f091 Fix two compiler warnings
llvm-svn: 369522
2019-08-21 13:11:30 +00:00
Raphael Isemann 006d22de50 [lldb] Add tests for setting completions and enable 'settings remove' completion
llvm-svn: 369521
2019-08-21 12:57:06 +00:00
Raphael Isemann 68756a8c37 [lldb][NFC] Add tests for register command
llvm-svn: 369513
2019-08-21 10:40:05 +00:00
Raphael Isemann 4fc1eb55d1 [lldb][NFC] Add tests for invalid command invocations
llvm-svn: 369506
2019-08-21 09:15:44 +00:00
Pavel Labath 9cb317968a Fix an unused variable warning in ClangASTContext.cpp
llvm-svn: 369503
2019-08-21 08:22:19 +00:00
Pavel Labath dc5403d2dc Properly EXCLUDE_FROM_ALL the testing support library
The EXCLUDE_FROM_ALL variable is used by add_llvm_library, but lldb does
not use that function (it uses llvm_add_library :P). Instead, set the directory
property with the same name directly.

This should fix standalone builds against an llvm install tree.

llvm-svn: 369502
2019-08-21 08:21:51 +00:00
Alex Langford 7719495e2c [Symbol] Remove unused clang headers from Type
llvm-svn: 369494
2019-08-21 04:56:23 +00:00
Jonas Devlieghere d35b42f20a [NFC] Return llvm::StringRef from StringExtractor::GetStringRef.
This patch removes the two variant of StringExtractor::GetStringRef that
return (non-)const references to std::string. The non-const one was
being abused to reinitialize the StringExtractor and its uses are
replaced by calls to the copy asignment operator. The const variant was
refactored to return an actual llvm::StringRef.

llvm-svn: 369493
2019-08-21 04:55:56 +00:00
Jonas Devlieghere 7483005c59 [NFC] Remove unused function GetHexWithFixedSize
The implementation of this function was obviously incorrect, as the
result variable was never used. This led me to check if it was actually
used anywhere, which came back negative.

llvm-svn: 369492
2019-08-21 04:55:53 +00:00
Jonas Devlieghere dc333e6398 [NFC] Simplify code
This simplifies the code and updates the comments.

llvm-svn: 369491
2019-08-21 04:55:50 +00:00
Jonas Devlieghere 4b3c0fd5da [NFC] Remove lldb_utility namespace.
While generating the Doxygen I noticed this lone namespace that has one
class and one function in it. This moves them into lldb_private.

llvm-svn: 369485
2019-08-21 00:50:46 +00:00
Jason Molenda 1ecc507e2a Update a few tests that may change the platform to save & restore
the platform in the setUp/tearDown methods.  I want to migrate the
re-instatement of the correct plaform to the setUp base method but
haven't had time to look at that yet, so I want to land this handful
of fixes until I get to it.

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

llvm-svn: 369484
2019-08-21 00:27:30 +00:00
Jonas Devlieghere d979a29935 [Doxygen] Document private class members.
Given that the C++ documentation is meant for LLDB developers it makes
sense to include private class members in the output.

llvm-svn: 369479
2019-08-21 00:10:19 +00:00
Jonas Devlieghere 625ab43318 [dotest] Don't set the DWARF version override in CFLAGS_EXTRA.
We cannot override the DWARF version in the CFLAGS_EXTRA because they
are used by tests that explicitly build without debug info. Instead, we
pass them through the regular CFLAGS.

llvm-svn: 369477
2019-08-20 23:56:32 +00:00
Jonas Devlieghere 0dcd186b0d [NFC] Fix -Wdocumentation warnings in Utility.
This patch fixes a bunch of -Wdocumentation warnings in Utility. I'm
sure there are still a bunch outdated comments left, but this fixes the
most flagrant inconsistencies that the compiler understands.

llvm-svn: 369461
2019-08-20 22:20:46 +00:00
Alex Langford b2232a1af3 [Symbol] Move VerifyDecl to ClangASTContext
VerifyDecl is specific to clang and is only used in ClangASTContext.

llvm-svn: 369456
2019-08-20 22:06:13 +00:00
Med Ismail Bennani 27a313ebde [LLDB][Test] Remove `skipIfWindows` for conditional breakpoint test (NFC)
Summary:
The test for conditional breakpoints on Windows was skipped because
there was no expression evaluation support at the time it was written.

After removing the annotation and testing it again, the test is passing.
http://lists.llvm.org/pipermail/lldb-dev/2019-August/015405.html

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Reviewers: stella.stamenova, jingham

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369453
2019-08-20 21:58:22 +00:00
Jonas Devlieghere c569d4af4c [NFC] Update RegularExpression documentation
llvm-svn: 369452
2019-08-20 21:56:49 +00:00
Alex Langford cb40f89c6e [Symbol][NFC] Remove references to clang in TypeMap
llvm-svn: 369436
2019-08-20 20:44:36 +00:00
Jonas Devlieghere 8509b0a778 [CMake] Remove LLDB_TEST_USE_CUSTOM_C(XX)_COMPILER
Given that LLDB_TEST_USE_CUSTOM_C_COMPILER and LLDB_TEST_C_COMPILER are
both set at configuration time, I don't really see the point of having
both. This patch simplifies things and uses the custom C/C++ compiler
when the variable is set, and uses the default one when it's not set.
The variable can be unset by passing -ULLDB_TEST_C_COMPILER to CMake.

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

llvm-svn: 369435
2019-08-20 20:20:20 +00:00
Alex Langford 1271521ed8 [ClangExpressionParser] Add ClangDeclVendor
Summary:
This introduces a layer between DeclVendor and the currently implemented
DeclVendors (ClangModulesDeclVendor and AppleObjCDeclVendor). This
allows the removal of DeclVendor::GetImporterSource which is extremely
clang-specific, freeing up the interface to be more general.

A good follow up to this would be to remove the remaining instances of
clang in DeclVendor, either by moving things to ClangDeclVendor or by
using wrappers (e.g. CompilerDecl instead of clang::NamedDecl).

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

llvm-svn: 369424
2019-08-20 18:47:30 +00:00
Adrian Prantl 260aa0f0f3 Make the FindTypes(std::vector<CompilerContext>, ...) API testable in lldb-test
This adds a -compiler-context=<...> option to lldb-test that trakes a
comma-separated string that is a list of kind/name pairs and
translates it into a std::vector<CompilerContext>, a CompilerContext
being a pair of context-kind and name.

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

<rdar://problem/54471165>

llvm-svn: 369407
2019-08-20 16:44:25 +00:00
Jan Kratochvil 1c56d3df19 [lldb] Use the new Regex::isValid() with no parameter
Differential Revision: https://reviews.llvm.org/D66463

llvm-svn: 369398
2019-08-20 16:08:27 +00:00
Pavel Labath 028fe5af60 Fix build for r369374
This patch added some gtest code to the TestingSupport library. As this
is not a unit test, but a unit test library, gtest does not get added to
the include path automatically, but we have to do that ourselves. (It
was working for me without this because the compiler picked up the
system gtest instead.)

llvm-svn: 369381
2019-08-20 13:17:20 +00:00
Pavel Labath 5877fb7cd7 Convert minidump unittests to use llvm::yaml::convertYAML
previously they used a minidump-specific function for this purpose, but
this is no longer needed now that whole of yaml2obj is available as a
library.

llvm-svn: 369379
2019-08-20 12:53:42 +00:00
Pavel Labath a2e270fa70 unittests: Use yaml2obj as a library instead of an external process
Summary:
Recently, yaml2obj has been turned into a library. This means we can use
it from our unit tests directly, instead of shelling out to an external
process. This patch does just that.

Reviewers: JDevlieghere, aadsm, espindola, jdoerfert

Subscribers: emaste, mgorny, arichardson, MaskRay, jhenderson, abrachet, lldb-commits

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

llvm-svn: 369374
2019-08-20 12:28:36 +00:00
Pavel Labath 66d109640f [cmake] Remove the test for libstdc++<4.9
It is no longer relevant now that llvm requires >=5.1.

llvm-svn: 369371
2019-08-20 12:17:42 +00:00
Raphael Isemann 213a5abb4f [lldb][NFC] Test quotes when completing
llvm-svn: 369353
2019-08-20 09:26:58 +00:00
Jan Kratochvil f9d90bc5f6 [lldb] D66174 `RegularExpression` cleanup
I find as a good cleanup to drop the Compile method. As I do not find TIMTOWTDI
as an advantage and there is already constructor parameter to compile the
regex.

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

llvm-svn: 369352
2019-08-20 09:24:20 +00:00
Med Ismail Bennani 6815b6ef2a [lldb] Fix typo on the BreakpointLocation header and the lldbtest.py (NFC)
Summary:
This commit fixes some typo I found while exploring LLDB's codebase.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369313
2019-08-19 23:59:31 +00:00
Saleem Abdulrasool 2e8b57558d Windows: Include "windows" Instead of "Windows"
The actual include directory is lldb/Host/windows not
lldb/Host/Windows which breaks on case sensitive file systems

Patch by Gwen Mittertreiner!

llvm-svn: 369307
2019-08-19 22:45:01 +00:00
Matthias Gehre 8b0d15e43f Fix use-after-free
Summary:
The warning
```
lldb/source/Core/FormatEntity.cpp:2350:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
```
is emitted after annotating `llvm::StringRef` with `[[gsl::Pointer]]`.

The reason is that in
```
 size_t FormatEntity::AutoComplete(CompletionRequest &request) {
  llvm::StringRef str = request.GetCursorArgumentPrefix().str();
```
the function `GetCursorArgumentPrefix()` returns a `StringRef`, and `StringRef::str()` returns
a temporary `std::string`.

Reviewers: jingham, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 369304
2019-08-19 21:39:16 +00:00
Alex Langford 3b4ce731fb [lldb-vscode] add `launchCommands` to handle launch specific commands
Summary:
This can help `lldb-vscode` handle launch commands associate with remote platform
attach request have field `attachCommands` to handle attach specific commands
add a corresponding one for launch request
if no launch command is provided, create a new target and launch; otherwise, execute the launch command

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

Patch by Wanyi Ye <kusmour@gmail.com>

llvm-svn: 369296
2019-08-19 20:17:27 +00:00
Raphael Isemann 0f4e9835c9 [lldb] Make TestIOHandlerCompletion more stable and document it
Instead of relying that three tabs show all completions, we should
show all remaining completions which will always stop the mode
where we show completions. Should fix this test on systems that
somehow have more completions that our normal LLDB (as they
would end up being stuck in the mode where we show completions).

llvm-svn: 369293
2019-08-19 19:13:26 +00:00
Jonas Devlieghere 8880ac648c [dotest] Add --dwarf-version to override the tested DWARF version.
On the matrix bot on GreenDragon [1] we want to run the test suite
against different DWARF versions. The idea here is not to replace
targeted tests for certain DWARF features, but rather to provide an easy
way to support this configuration.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/

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

llvm-svn: 369272
2019-08-19 16:04:21 +00:00
Raphael Isemann 6632ad5851 [lldb][NFC] Stop using GetNumberOfMatches in CompletionRequest test
This function is just a wrapper for GetNumberOfResults and will
be removed soon. This patch just changes all calls to GetNumberOfResults
where possible (which is currently just the unit test).

llvm-svn: 369267
2019-08-19 14:52:48 +00:00
Raphael Isemann 0684132107 [lldb][NFC] Use CompletionRequest in Variable::AutoComplete
llvm-svn: 369252
2019-08-19 11:49:43 +00:00
Raphael Isemann fb443746a8 [lldb][NFC] Add a few more completion tests to increase test coverage
These tests are mostly trying to reach the different completion functions
in CommandCompletions.cpp (::ArchitectureNames, ::DiskFiles, ::Modules).

llvm-svn: 369249
2019-08-19 10:46:38 +00:00
Raphael Isemann b8639f5c0f [lldb][NFC] Remove StringList::AutoComplete
We don't need this very specific function in StringList that
we only call once in LLDB.

llvm-svn: 369242
2019-08-19 08:15:46 +00:00
Raphael Isemann 81094aad61 [lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecute
llvm-svn: 369240
2019-08-19 07:59:44 +00:00
Raphael Isemann 21599876be [lldb][NFC] Address review comments to StringList for-loop support
llvm-svn: 369237
2019-08-19 07:22:19 +00:00
Jan Kratochvil 0697bcd127 [lldb] Remove unused inheritance in RegularExpression
D66174 left inherited llvm::Regex which is now a member variable there.

Approved as a part of: https://reviews.llvm.org/D66392#1634575

llvm-svn: 369235
2019-08-19 07:06:56 +00:00
Jonas Devlieghere 45e598d135 [CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.
After LLVM moved to C++14, the RWMutex implementation was removed in
favor of std::shared_timed_mutex, which is only available on macOS
10.12 and later. As a workaround for older deployment targets, I added
   the original RWMutexImpl again, guarded by the deployment target.

When doing a standalone build of LLDB using the Xcode generator, the
CMake cache specifies a minimum deployment target. However, LLVM and
Clang might have been built with a different minimum deployment target.

This is exactly what happened for the Xcode build. LLVM was built with a
minimum deployment target newer than 10.12, using
std::shared_timed_mutex. LLDB on the other hand was built with a minimum
deployment target of 10.11, using the old RWMutexImpl, resulting in
undefined symbols at link-time.

This patch changes the minimum deployment target for the Xcode build to
10.12 to work around this problem. A better solution would involve
synchronizing the minimum deployment or even not setting one at all.

llvm-svn: 369220
2019-08-18 21:54:26 +00:00
Raphael Isemann 37a928efd9 [lldb][NFC] Remove unused MaterializeInitializer and MaterializeInternalVariable
llvm-svn: 369198
2019-08-17 21:57:51 +00:00
Adrian Prantl 69cef325a3 Simplify code (NFC).
llvm-svn: 369179
2019-08-17 00:38:58 +00:00
Jonas Devlieghere 3af3f1e8e2 [Utility] Reimplement RegularExpression on top of llvm::Regex
Originally I wanted to remove the RegularExpression class in Utility and
replace it with llvm::Regex. However, during that transition I noticed
that there are several places where need the regular expression string.
So instead I propose to keep the RegularExpression class and make it a
thin wrapper around llvm::Regex.

This patch also removes the workaround for empty regular expressions.
The result is that we are now (more or less) POSIX conformant.

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

llvm-svn: 369153
2019-08-16 21:25:36 +00:00