Commit Graph

20236 Commits

Author SHA1 Message Date
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