Commit Graph

17747 Commits

Author SHA1 Message Date
Frederic Riss 314614ad4f Disable exceptions for TestDataFormatterLibcxxOptional.py
On macOS, some of the <optional> APIs used by the test are available only
starting on macOS 10.14 when using exceptions. Build the test with
-fno-exceptions so that the test builds on older systems too.

rdar://problem/43700544

llvm-svn: 340676
2018-08-25 01:25:24 +00:00
Stella Stamenova 04acc99db8 [vscode] Skip some of the vscode tests on Linux and fix one
Summary: These are already skipped on Darwin because they cause build bot failures. Both on the build bots as well as in our testing we have seen a number of these tests fail and hang. This change skips the failing/hanging tests on Linux and also fixes one of the test - the test needs the thread library to build.

Reviewers: asmith, clayborg, aprantl

Subscribers: teemperor, lldb-commits

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

llvm-svn: 340658
2018-08-24 21:42:53 +00:00
Raphael Isemann 6328ccc14c Fixed windows bots that were failing because of PATH_MAX
As we only use PATH_MAX for an assert in a unit test that is supposed
to catch the random failures on the Swift CI bots, we might as well
just ifdef this assert out on Windows.

llvm-svn: 340652
2018-08-24 20:55:23 +00:00
Aleksandr Urakov 562811a86d [PDB] Make variables.test to pass using a 32-bit compiler too
Summary:
`variables.test` depends on mangled names, but the mangling depends
on the bitness. This patch specifies the bitness explicitly, so mangled names
doesn't differ when a 32-bit version of the compiler is used.

Reviewers: stella.stamenova, asmith

Reviewed By: stella.stamenova

Tags: #lldb

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

llvm-svn: 340597
2018-08-24 07:24:52 +00:00
Raphael Isemann 3e1c793e9d Add more pre-run asserts for the DirCompletionAbsolute test
Summary:
The DirCompletionAbsolute is still randomly failing on the nodes even after D50722, so this patch adds more asserts
that verify certain properties on which the actual completion implementation relies on.

The first assert checks that the directory we complete on actually exists. If the directory doesn't exist on the
next CI failure, this assert should catch it and we know that the 0 matches come from a missing base directory.

The second assert is just checking that we are below the PATH_MAX limit that the completion checks against.
This check could randomly fail if the temporary directories we generate are sometimes longer than PATH_MAX,
and the assert can tell us that this is the reason we failed (instead of the mysterious '0 matches').

(As a sidenote: We shouldn't be checking against PATH_MAX anyway in the code (as this is just wrong). Also
the disk completion API really needs a better error mechanism than returning 0 on both error or no-results.)

Reviewers: aprantl, friss

Reviewed By: aprantl

Subscribers: abidh

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

llvm-svn: 340589
2018-08-23 23:21:52 +00:00
Raphael Isemann d2b0862f7f Reuse the SelectorTable from Clang's Preprocessor
Summary:
At the moment we create our own SelectorTable even though the Preprocessor always
creates one for us that we can (and should) reuse.

Reviewers: vsk

Reviewed By: vsk

Subscribers: lldb-commits

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

llvm-svn: 340585
2018-08-23 22:40:54 +00:00
Leonard Mosescu 40b832ea08 Restrict the set of plugins used for ProcessMinidump
1. The dynamic loaders should not be needed for loading minidumps
and they may create problems (ex. the macOS loader resets the list of
loaded sections, which for minidumps are already set up during minidump loading)

2. In general, the extra plugins can do extraneous work which hurts performance
(ex. trying to set up implicit symbolic breakpoints, which in turn will trigger
extra debug information loading)

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

llvm-svn: 340578
2018-08-23 21:34:33 +00:00
Adrian Prantl 252ed741b2 Change xfail to skipIf. The exact condition is really difficult to get
right and doesn't add much signal.

llvm-svn: 340574
2018-08-23 21:08:30 +00:00
Adrian Prantl 4e3bd78a80 XFAIL test for older versions of clang
llvm-svn: 340573
2018-08-23 21:00:37 +00:00
Raphael Isemann 778b308eb9 Fix broken builtin functions in the expression command
Summary:
Calling any non-libc builtin function in the expression command currently just causes Clang
to state that the function is not known. The reason for this is that we actually never
initialize the list of builtin functions in the Builtin::Context.

This patch just calls the initializer for the builtins in the preprocessor. Also adds some tests
for the new builtins.

It also gets rid of the extra list of builtins in the ClangExpressionParser, as we can just reuse
the existing list in the Preprocessor for the ASTContext. Having just one list of builtins around
is also closer to the standard Clang behavior.

Reviewers: #lldb, vsk

Reviewed By: vsk

Subscribers: sgraenitz, clayborg, vsk, lldb-commits

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

llvm-svn: 340571
2018-08-23 20:40:45 +00:00
Walter Lee d0ddf313c5 Fix format string issue introduced in r340548
Make format string portable.

llvm-svn: 340562
2018-08-23 18:26:26 +00:00
Alex Langford 520201babb [cmake] Add option to skip building lldb-server
Summary:
There is currently a way to skip the debugserver build. See how the CMake
variables SKIP_DEBUGSERVER and LLDB_CODESIGN_IDENTITY are used if you're
interested in that.

This allows us to skip building lldb-server as well. There is another
debug server called ds2 that can be used with LLDB. If you choose to use
ds2, this flag is very useful because it can cut down the build time of LLDB.

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

llvm-svn: 340560
2018-08-23 18:05:45 +00:00
Adrian Prantl 6c7f5884d5 Fix check for dictionary entry
llvm-svn: 340557
2018-08-23 17:51:14 +00:00
Adrian Prantl 315334be05 XFAIL test for older versions of dsymutil
llvm-svn: 340550
2018-08-23 17:30:56 +00:00
Adrian Prantl 748310b193 lldbtest.py: Work around macOS SIP when testing ASANified builds.
llvm-svn: 340548
2018-08-23 17:19:08 +00:00
Adrian Prantl 6b58fa7120 Add libc++ data formatter for std::function
- Added LibcxxFunctionSummaryProvider
- Removed LibcxxFunctionFrontEnd
- Modified data formatter tests to test new summary functionality

Patch by Shafik Yaghmour!

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

llvm-svn: 340543
2018-08-23 17:02:39 +00:00
Stephane Sezer a8accca4f5 Add include directory for libxml on macOS
Summary:
Builds fail because libxml/xmlreader.h isn't found. Adding the include
directory to the include list fixes the issue. This is what we already do on
non-macOS platforms in the same file.

Reviewers: clayborg, xiaobai, lanza

Reviewed By: clayborg, lanza

Subscribers: mgorny

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

llvm-svn: 340460
2018-08-22 22:25:45 +00:00
Raphael Isemann b238b8dcf0 Add unit test for StringLexer
Reviewers: labath, #lldb

Reviewed By: labath

Subscribers: jloser, mgorny, lldb-commits

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

llvm-svn: 340448
2018-08-22 20:22:34 +00:00
Adrian Prantl 95f21584a9 lldbtest.py: Unconditionally set the clang module cache path.
This should fix the errors observable on the new lldb-cmake bot.

llvm-svn: 340293
2018-08-21 16:13:37 +00:00
Adrian Prantl cd9f68ec05 Makefile.rules: Use an absolute path to the module cache directory.
This change is NFC, but it makes it more obvious in log files what happened.

llvm-svn: 340286
2018-08-21 15:46:15 +00:00
Adrian Prantl 0e45df4c0e Reflow comments
llvm-svn: 340219
2018-08-20 22:00:32 +00:00
Adrian Prantl c14fd34803 Set path to sanitizer runtime when running tests through LIT on macOS.
rdar://problem/42984739

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

llvm-svn: 340218
2018-08-20 22:00:31 +00:00
Raphael Isemann 5b06c228af Remove manual byte counting from Opcode::Dump
Summary:
Stream now has byte-counting functionality, so let's use this instead of manual byte
counting.

Reviewers: clayborg, davide

Reviewed By: davide

Subscribers: davide, lldb-commits

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

llvm-svn: 340179
2018-08-20 15:51:14 +00:00
Stefan Granitz d882a49742 Fix lit.cfg for python3: can only concatenate str (not "bytes") to str
llvm-svn: 340168
2018-08-20 12:37:54 +00:00
Aleksandr Urakov ff70172716 [NFC] Minor update to comment
Update comment after rLLDB339994

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

llvm-svn: 340151
2018-08-20 05:59:27 +00:00
Greg Clayton c1f10e34ed Skip tests on Darwin for now. The build bots are not passing due to heavy load and poor machines.
llvm-svn: 340112
2018-08-18 00:33:15 +00:00
Greg Clayton f6e36ee83e Skip the lldb-vscode attach with waitFor test for now, some build bots are having trouble.
llvm-svn: 340077
2018-08-17 20:42:06 +00:00
Jim Ingham 72024ad7af Show how to use "lldb -P" to find the lldb.py.
We had hard-coded the path in the docs but that got
out of date - showing again that -P is the better
way to do this.

<rdar://problem/43394652>

llvm-svn: 340053
2018-08-17 17:39:32 +00:00
Greg Clayton a75fad4fa4 Change the attach test case to use self.assertEqual so we can get more info on what is going wrong on test bots.
Also add a cleanup function to remove the copied binary.

llvm-svn: 340050
2018-08-17 17:27:53 +00:00
Aleksandr Urakov 534594822f Fix compiler warnings after rL339649.
Differential Revision: https://reviews.llvm.org/D49980

llvm-svn: 339994
2018-08-17 07:28:24 +00:00
Stephane Sezer 9e2fe8be02 Add a relocation for R_AARCH64_ABS32 in ObjectFileELF
Summary:
.rela.debug_info relocations are being done via
ObjectFileELF::ApplyRelocations for aarch64. Currently, the switch case
that iterates over the relocation type is only implemented for a few
different types and `assert(false)`es over the rest.

Implement the relocation for R_AARCH64_ABS32 in ApplyRelocations

Reviewers: sas, xiaobai, javed.absar, espindola

Reviewed By: sas

Subscribers: emaste, arichardson, kristof.beyls

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

Change by Nathan Lanza <lanza@fb.com>

llvm-svn: 339974
2018-08-17 00:35:47 +00:00
Alex Langford ee3b981673 Remove commented out constructor from Scalar
This appears to have been commented out since the initial checkin of
lldb.

llvm-svn: 339965
2018-08-16 23:23:18 +00:00
Alex Langford 9084e82880 Remove outdated TODOs in RegisterValue
These TODOs were for setting m_type in RegisterValue::SetValueFromString
in the case where reg_info's encoding was eEncodingUint or
eEncodingSint. m_type is set by SetUInt{8,16,32,64.128} during the
SetUInt call.

llvm-svn: 339959
2018-08-16 22:48:46 +00:00
Greg Clayton ada3f77e44 Update the Core file loading instructions so they keep the process stopped after attaching to a core file.
llvm-svn: 339954
2018-08-16 22:13:01 +00:00
Vedant Kumar 33ed57eebd [dotest] Make --test-subdir work with --no-multiprocess
The single-process test runner is invoked in a number of different
scenarios, including when multiple test dirs are specified or (afaict)
when lit is used to drive the test suite.

Unfortunately the --test-subdir option did not work with the single
process test runner, breaking an important use case (using lit to run
swift-lldb Linux tests):

  Failure URL: https://ci.swift.org/job/swift-PR-Linux/6841

We won't be able to run lldb tests within swift PR testing without
filtering down the set of tests.

This change makes --test-subdir work with the single-process runner.

llvm-svn: 339929
2018-08-16 19:56:38 +00:00
Reid Kleckner 8b5e6991d2 Fix lldb-vscode build on Windows
Include PosixAPI.h to get a PATH_MAX definition and replace CreateEvent
with CreateEventObject to avoid conflicts with the windows.h definition
of CreateEvent to CreateEventW.

llvm-svn: 339920
2018-08-16 18:24:59 +00:00
Vedant Kumar 642de8a088 Disable two flaky pexpect-backed tests on Darwin
These tests are sporadically timing out on our bots, e.g here:

  https://ci.swift.org/job/swift-PR-Linux/6841

llvm-svn: 339914
2018-08-16 18:18:16 +00:00
Greg Clayton 2f5cf8511a Add a new tool named "lldb-vscode" that implements the Visual Studio Code Debug Adaptor Protocol
This patch adds a new lldb-vscode tool that speaks the Microsoft Visual Studio Code debug adaptor protocol. It has full unit tests that test all packets.

This tool can be easily packaged up into a native extension and used with Visual Studio Code, and it can also be used by Nuclide

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

llvm-svn: 339911
2018-08-16 17:59:38 +00:00
Reid Kleckner cecc9f5828 Update LLDB for LLVM CodeView API change in r339907
llvm-svn: 339910
2018-08-16 17:51:58 +00:00
Jim Ingham 8a5d7a2784 Fix a little thinko in generating ___lldb_unnamed_symbol symbols
when we have only an in-memory copy of the binary.

Also added a test for the generation of these symbols in the 
in-memory and regular cases.

<rdar://problem/43160401>

llvm-svn: 339833
2018-08-15 23:10:32 +00:00
Adrian Prantl c53d36847e Add libc++ data formatters for std::optional.
Patch by Shafik Yaghmour!

This reapplies an earlier version after addressing some post-commit feedback.

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

llvm-svn: 339828
2018-08-15 22:48:48 +00:00
Raphael Isemann 0e24bfc6bd Revert "[ASTImporter] Add test for IfStmt"
That's actually a clang patch, sorry.

llvm-svn: 339826
2018-08-15 22:32:35 +00:00
Raphael Isemann 0b81d447c5 [ASTImporter] Add test for IfStmt
Reviewers: a.sidorin, hiraditya

Reviewed By: hiraditya

Subscribers: hiraditya, martong, cfe-commits

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

llvm-svn: 339825
2018-08-15 22:31:44 +00:00
Greg Clayton e15e32f800 Fix doc string variable name to quiet a compiler warning.
llvm-svn: 339817
2018-08-15 21:21:22 +00:00
Stefan Granitz 4aaa72f98f Remove asseration from ConstString::GetConstCStringAndSetMangledCounterPart() to fix more tests first
llvm-svn: 339716
2018-08-14 19:38:54 +00:00
Raphael Isemann ffa7010b8c Stability improvements for CompletionTest
Summary:
CompletionTest.DirCompletionAbsolute had a random failure on a CI node
(in the failure, the completion count was 0, while we expected it to be 1),
but there seems no good reason for it to fail. The sanitizers don't complain
about the test when it's run, so I think we don't have some uninitialized
memory that we access here.

My best bet is that the unique directory selection randomly failed on the CI
node because maybe the FS there doesn't actually guarantee the atomic fopen
assumptions we make in the LLVM code (or some other funny race condition).
In this case a different test run could get the same directory and clean its contents
which would lead to 0 results.

The other possible explanation is that someone changed the CI configuration
on the node and changed the working dir to something very long, which would
make our PATH_MAX test fail (which also leads to 0 results), but I think that case
is unlikely.

This patch is just a stab in the dark that (hopefully) fixes this random failure by
giving each test a (more) unique working directory by appending the unique
test name to the temp-dir prefix. Also adds one more ASSERT_NO_ERROR to
one of our chdir calls just in case that is the reason for failing.

The good thing is that this refactor gets rid of most of the static variables
and files that we previously had as shared state between the different tests.

Potentially fixes rdar://problem/43150260

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: jfb, lldb-commits

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

llvm-svn: 339715
2018-08-14 19:36:58 +00:00
Raphael Isemann 2d437f6b02 Remove manual byte counting from Highlighter code.
Summary:
This removes the manual byte counting mechanism from the syntax highlighting
code. This is no longer necessary as the Stream class now has built-in support for
automatically counting the bytes that were written to it so far.

The advantage of automatic byte counting via Stream is that it is less error-prone
than the manual version and we need to write less boilerplate code.

Reviewers: labath

Reviewed By: labath

Subscribers: labath, lldb-commits

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

llvm-svn: 339695
2018-08-14 17:12:54 +00:00
Stefan Granitz 44780cc3b9 Remove unused FastDemangle sources
llvm-svn: 339671
2018-08-14 11:32:51 +00:00
Stefan Granitz 2397a2b6e2 Fix: ConstString::GetConstCStringAndSetMangledCounterPart() should update the value if the key exists already
Summary:
This issue came up because it caused problems in our unit tests. The StringPool did connect counterparts only once and silently ignored the values passed in subsequent calls.
The simplest solution for the unit tests would be silent overwrite. In practice, however, it seems useful to assert that we never overwrite a different mangled counterpart.
If we ever have mangled counterparts for other languages than C++, this makes it more likely to notice collisions.

I added an assertion that allows the following cases:
* inserting a new value
* overwriting the empty string
* overwriting with an identical value

I fixed the unit tests, which used "random" strings and thus produced collisions.
It would be even better if there was a way to reset or isolate the StringPool, but that's a different story.

Reviewers: jingham, friss, labath

Subscribers: lldb-commits

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

llvm-svn: 339669
2018-08-14 11:07:18 +00:00
Aleksandr Urakov 7d2a74fc54 [PDB] Parse UDT symbols and pointers to members (combined patch)
Summary:
In this patch I've tried to combine the best ideas from D49368 and D49410,
so it implements following:

- Completion of UDTs from a PDB with a filling of a layout info;
- Pointers to members;
- Fixes the bug relating to a virtual base offset reading from `vbtable`.
  The offset was treated as an unsigned, but it can be a negative sometimes.
- Support of MSInheritance attribute

Reviewers: asmith, zturner, rnk, labath, clayborg, lldb-commits

Reviewed By: zturner

Subscribers: aleksandr.urakov, stella.stamenova, JDevlieghere, lldb-commits

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

llvm-svn: 339649
2018-08-14 07:57:44 +00:00