Commit Graph

1805 Commits

Author SHA1 Message Date
Adrian Prantl 952c802780 Add decorator support for the DWARF version produced by the compiler
and mark up some tests failing in
  http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/

llvm-svn: 352072
2019-01-24 18:24:14 +00:00
Adrian Prantl 3b4d731fde Skip test on clang <8 instead of 7
llvm-svn: 352009
2019-01-24 02:37:28 +00:00
Jonas Devlieghere c98cc39e50 Revert "[dotest] Add logging to investigate CI issue."
We figured out the issue so the logging is no longer necessary. It turns
out we were using a session format that was not unique for inline tests.

llvm-svn: 351902
2019-01-23 00:13:47 +00:00
Jonas Devlieghere 1efb72f8a4 [Test] Fix up tests affected by the new LLVM header.
The new LLVM header is one line shorter than the old one, which lead to
some test failures. Ideally tests should rely on line numbers for
breakpoints or output, but that's a different discussion. Hopefully this
turns the bots green again.

llvm-svn: 351779
2019-01-22 03:50:44 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Jonas Devlieghere 71c7303044 [dotest] Add logging to investigate CI issue.
We're seeing an odd issue on GreenDragon's lldb-cmake-matrix. Dotest is
unable to move a log file (OSError: [Errno 2] No such file or
directory). The os.rename call is guarded with a check that the source
file and destination directory exist.

This wraps the call in a try-except that prints the source and
destination path to see which component seemingly doesn't exist.

llvm-svn: 351611
2019-01-18 23:05:19 +00:00
Jason Molenda 03e26de4d2 Don't run TestBreakpointThumbCodesection.py on darwin systems;
we don't use a thumb code section.

Don't run Test128BitsInteger.py on armv7k; it's not a supported
type on that target.

llvm-svn: 351490
2019-01-17 22:26:25 +00:00
Adrian Prantl 6273bb5430 XFAIL test on Windows
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/677/steps/test/logs/stdio

llvm-svn: 351385
2019-01-16 22:07:21 +00:00
Adrian Prantl 2ee7b881a0 Change TypeSystem::GetBitSize() to return an optional result.
This patch changes the behavior when printing C++ function references:
where we previously would get a <could not determine size>, there is
now a <no summary available>. It's not clear to me whether this is a
bug or an omission, but it's one step further than LLDB previously
got.

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

llvm-svn: 351376
2019-01-16 21:19:20 +00:00
Stella Stamenova da97713fc4 [lldbsuite] Skip two more flaky tests on Windows
TestNamespaceLookup occasionally passes unexpectedly and TestExitDuringStep occasionally fails unexpectedly

llvm-svn: 351080
2019-01-14 17:55:17 +00:00
Aleksandr Urakov b4c1e4c2fb [Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild
Summary:
This patch allows to retrieve an address object for `ValueObject`'s children
retrieved through e.g. `GetChildAtIndex` or `GetChildMemberWithName`. It just
uses the corresponding method of the implementation object `m_impl` to achieve
that.

Reviewers: zturner, JDevlieghere, clayborg, labath, serge-sans-paille

Reviewed By: clayborg

Subscribers: leonid.mashinskiy, lldb-commits

Tags: #lldb

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

llvm-svn: 351065
2019-01-14 13:08:13 +00:00
Stella Stamenova c2fb9ed1d0 [lldbsuite] Skip TestExitDuringStep on Windows
This test is flaky on Windows and will occasionally hang or fail.

llvm-svn: 350978
2019-01-11 23:08:35 +00:00
Adrian Prantl 5ea5231bec lldbtest.py: try to fix a runtime exception
found on http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-matrix/32/consoleFull#15046896708254eaf0-7326-4999-85b0-388101f2d404

llvm-svn: 350876
2019-01-10 19:06:46 +00:00
Davide Italiano 53dddee171 [Python] Update checkDsymForUUIDIsOn to be compatible with Python 3.
Summary:
In python 2, strings and bytes are the same, but they're not in
python 3, hence the return of read() needs an explicit conversion.
While I'm around, rename the return of Popen() from `pipe` to
`process`, as that's what Popen returns.

Reviewers: JDevlieghere, friss, zturner, aprantl, serge-sans-paille

Subscribers: lldb-commits

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

llvm-svn: 350788
2019-01-10 01:15:18 +00:00
Adrian Prantl 91cb4cccae Split two sub-tests into separate top-level methods.
llvm-svn: 350559
2019-01-07 19:24:04 +00:00
Adrian Prantl 9e9e7b38e0 Refactor test, no changes expected.
llvm-svn: 350557
2019-01-07 19:19:34 +00:00
Adrian Prantl 9d5480b55f Fine-tune and document the barrier in TestQueues.
llvm-svn: 350543
2019-01-07 17:18:39 +00:00
Adrian Prantl ae9f93b4aa Simplify testcase by using lldbutil.run_to_source_breakpoint()
llvm-svn: 350537
2019-01-07 16:27:52 +00:00
Kuba Mracek 961fbf21c6 [lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of recognized arguments
Differential Revision: https://reviews.llvm.org/D56027

llvm-svn: 350376
2019-01-04 00:25:08 +00:00
Jan Kratochvil 4c993ce187 symbols.enable-external-lookup=false on all hosts (not just OSX)
There is already in use:
	lit/lit-lldb-init:
		settings set symbols.enable-external-lookup false
	packages/Python/lldbsuite/test/lldbtest.py:
		self.runCmd('settings set symbols.enable-external-lookup false')

But those are not in effect during MI part of the testsuite. Another problem is
that symbols.enable-external-lookup (read by GetEnableExternalLookup) has been
currently read only by LocateMacOSXFilesUsingDebugSymbols and therefore it had
no effect on Linux.

On Red Hat platforms (Fedoras, RHEL-7) there is DWZ in use and so
MiSyntaxTestCase-test_lldbmi_output_grammar FAILs due to:
	AssertionError: error: inconsistent pattern ''^.+?\n'' for state 0x5f
	(matched string: warning: (x86_64) /lib64/libstdc++.so.6 unsupported
	DW_FORM values: 0x1f20 0x1f21
It is the only testcase with this error. It happens due to:
	(lldb) target create "/lib64/libstdc++.so.6"
	Current executable set to '/lib64/libstdc++.so.6' (x86_64).
	(lldb) b main
	warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21
	Breakpoint 1: no locations (pending).
	WARNING:  Unable to resolve breakpoint to any actual locations.
which happens only with gcc-base-debuginfo rpm installed (similarly for other packages).

It should also speed up the testsuite as it no longer needs to read
/usr/lib/debug symbols which have no effect (and should not have any effect) on
the testsuite results.

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

llvm-svn: 350368
2019-01-03 23:11:06 +00:00
Adrian Prantl a07bba60d0 TestQueues: Move the synchronisation code into the binary itself.
Thanks to Pavel Labath for the suggestion!

llvm-svn: 350360
2019-01-03 22:34:48 +00:00
Adrian Prantl 3b2136e55e Add file-based synching to places missed in r350247.
llvm-svn: 350266
2019-01-02 22:37:28 +00:00
Adrian Prantl 5eade7ab3c Add file-based synchronization to flaky test
TestQueues is failing randomly on green dragon and I suspect it is
because the enqueued threads haven't executed by the time we expect
them. This patch adds file-based synchronization to the queues.

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

llvm-svn: 350247
2019-01-02 19:06:22 +00:00
Jonas Devlieghere 2e8bbb9c00 [test] Remove flakiness decorator from TestObjCDynamicSBType
The quoted bug report (llvm.org/PR20270) was closed in 2014.

llvm-svn: 350160
2018-12-30 06:10:03 +00:00
Pavel Labath 9294a2669e Fix tests for python 3.7
python 3.7 removes re._pattern_type. Fix the one place where we were
depending on the type of regular expressions to compute the type
dynamically.

llvm-svn: 350093
2018-12-27 15:16:37 +00:00
Stella Stamenova 569ac69809 [lldbsuite] Skip flakey Windows tests
Skip a number of tests on Windows that are flakey and will pass/fail unexpectedly every dozen or so runs.

llvm-svn: 349946
2018-12-21 20:10:45 +00:00
Jim Ingham 79d8105fc8 "help finish" tells you it is an alias. "help fin" doesn't.
They both run the same command, and people get used to typing the shortest
string they can, so we should support alias info on shortened strings as well.

<rdar://problem/46859207>

llvm-svn: 349874
2018-12-21 01:45:28 +00:00
Adrian Prantl 33c46ca675 Fix typo
llvm-svn: 349861
2018-12-20 23:50:32 +00:00
Kuba Mracek 4c7f5d5c5a [lldb] Add a "display-recognized-arguments" target setting to show recognized arguments by default
Differential Revision: https://reviews.llvm.org/D55954

llvm-svn: 349856
2018-12-20 23:38:19 +00:00
Adrian Prantl 74f6bcfb49 Disable a few tests on the green dragon sanitzier bot.
These are tests that found actual, but hard to fix, bugs that are
tracked elsewhere. Leaving them red only distracts from new failures
this bot finds.

llvm-svn: 349851
2018-12-20 23:16:47 +00:00
Stella Stamenova 7f17c227ce [lldbsuite] Un-xfail several tests in TestInferiorCrashing on Windows
Several of the tests are now passing. This change is enabling them.

llvm-svn: 349813
2018-12-20 20:26:05 +00:00
Stella Stamenova 3dcbc33203 [lldbsuite] Un-xfail TestMiniDump and TestThreadJump
Both of these are now passing. I've resolved the bugs as well for verification.

llvm-svn: 349783
2018-12-20 18:21:17 +00:00
Stella Stamenova 9adf3fc405 [lldbsuite] Un-xfail TestEvents on Windows
There are a couple of tests in TestEvents that are now passing.

llvm-svn: 349781
2018-12-20 18:00:20 +00:00
Stella Stamenova e6ebb51052 [lldbsuite] Skip TestConflictingSymbol (test_shadowed) on Windows
The test is "passing" on windows, but it is a false positive. Skip it on Windows until it is fixed on all platforms.

llvm-svn: 349775
2018-12-20 17:19:56 +00:00
Tatyana Krasnukha 92e5e36004 Overload GetMemoryRegions for the ProcessMinidump
Differential Revision: https://reviews.llvm.org/D55841

llvm-svn: 349767
2018-12-20 15:05:43 +00:00
Stella Stamenova 21ea152b4c [lldbsuite] Un-xfail TestRedefinitionsInInlines on Windows
llvm-svn: 349722
2018-12-20 03:04:14 +00:00
Stella Stamenova c834f925c1 [lldbsuite] Un-xfail TestDataFormatterSynthVal on Windows
llvm-svn: 349721
2018-12-20 02:22:09 +00:00
Stella Stamenova 6314b92331 [lldbsuite] Un-xfail tests on Windows that are now passing (pt.5)
This is a set of tests that were all marked as failing becuse of pr24764. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green.

llvm-svn: 349719
2018-12-20 02:04:01 +00:00
Kuba Mracek c9e1190a27 [lldb] Retrieve currently handled Obj-C exception via __cxa_current_exception_type and add GetCurrentExceptionBacktrace SB ABI
This builds on https://reviews.llvm.org/D43884 and https://reviews.llvm.org/D43886 and extends LLDB support of Obj-C exceptions to also look for a "current exception" for a thread in the C++ exception handling runtime metadata (via call to __cxa_current_exception_type). We also construct an actual historical SBThread/ThreadSP that contains frames from the backtrace in the Obj-C exception object.

The high level goal this achieves is that when we're already crashed (because an unhandled exception occurred), we can still access the exception object and retrieve the backtrace from the throw point. In Obj-C, this is particularly useful because a catch+rethrow is very common and in those cases you currently don't have any access to the throw point backtrace.

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

llvm-svn: 349718
2018-12-20 02:01:59 +00:00
Stella Stamenova 92c1296361 [lldbsuite] Un-xfail tests on Windows that are now passing (pt.4)
This is a set of tests that were all marked as failing becuse of several different bugs. A couple of the bugs are now resolved as fixed since all the tests that were failing associated with the bug are now passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green.

llvm-svn: 349713
2018-12-20 01:25:35 +00:00
Stella Stamenova 68ddb76807 [lldbsuite] Un-xfail tests on Windows that are now passing (pt.3)
This is a set of tests that were all marked as failing becuse of several different bugs. A couple of the bugs are now resolved as fixed since all the tests that were failing associated with the bug are now passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green.

llvm-svn: 349711
2018-12-20 00:58:48 +00:00
Stella Stamenova 0ab990345a [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2)
This is a set of tests that were all marked as failing becuse of pr21765. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green.

llvm-svn: 349668
2018-12-19 19:10:25 +00:00
Stella Stamenova 756b91dc14 [lldbsuite] Un-xfail tests on Windows that are now passing
This is a set of tests that were all marked as failing becuse of pr24489. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green.

llvm-svn: 349665
2018-12-19 19:04:01 +00:00
Greg Clayton da9c5dba96 Show the memory region name if there is one in the output of the "memory region" command
Prior to this change we would show the name of the section that a memory region belonged to but not its actual region name. Now we show this,. Added a test that reuses the regions-linux-map.dmp minidump file to test this and verify the correct region names for various memory regions.

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

llvm-svn: 349658
2018-12-19 18:16:52 +00:00
Jan Kratochvil 9a33a15766 refactor testsuite spawnLldbMi args->exe+args
Currently spawnLldbMi accepts both lldb-mi options and executable to debug as
a single parameter. Split them.

As in D55859 we will need to execute one lldb-mi command before loading the
exe. Therefore we can no longer use the exe as lldb-mi command-line parameter
as then there is no way to execute a command before loading exe specified as
lldb-mi command-line parameter.

LocateExecutableSymbolFileDsym should be static, that is also a little
refactorization.

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

llvm-svn: 349607
2018-12-19 08:57:10 +00:00
Stella Stamenova f5b5325a10 [lit] Use the new build.py script in the lldb-mi tests
This allows the tests to pass on Windows as well

llvm-svn: 349562
2018-12-18 22:54:17 +00:00
Adrian Prantl 0c7fca5ce7 TestHelloWorld: Use a file on the target platform for synchronisation.
Thanks to Pavel Labath for the idea!

llvm-svn: 349550
2018-12-18 22:17:38 +00:00
Pavel Labath ef4d4f543a de-flake TestThreadStates.test_process_interrupt
the "self.assertEqual(thread.GetStopReason(), lldb.eStopReasonSignal)"
was occasionally failing because the stop reason would come out as
"trace" this happened if we issued the interrupt just as the processed
stopped due to single-stepping over the breakpoint (i.e., the it was not
necessary to send any signal).

Fix this by removing the breakpoint before resuming the process. This
ensures the process can run unobstructed.

After this, the test passed 200 consecutive runs successfully for me,
even while the system was under heavy load.

llvm-svn: 349491
2018-12-18 15:15:02 +00:00
Pavel Labath b4b7c148e3 Skip TestMultithreaded.test_sb_api_listener_resume on linux
The test still fails occasionally (1/100 runs). Upgrade the xfail to
skip.

llvm-svn: 349487
2018-12-18 14:24:55 +00:00
Pavel Labath 2ba9dad66d Un-XFail TestYMMRegister on linux
This test was disabled in r326756 as a part of "upstreaming debugserver
support for AVX-512 (zmm register set)". This looks like an error
because both register set and remote stubs are different.

In any case, the test passes now.

llvm-svn: 349485
2018-12-18 13:50:38 +00:00
Pavel Labath e0d47ca107 Un-XFail TestThreadStates.test_process_interrupt
This test is passing now on linux. The same test is claimed to be flaky
on darwin, so it's possible that's true on linux too. If that's the case
we'll have to skip it here too (or fix it).

I mark the test as not-debug-info-dependent as a drive-by.

llvm-svn: 349482
2018-12-18 13:32:42 +00:00
Pavel Labath 56168f0dbb Un-XFAIL TestExitDuringBreak.py for linux
This test is passing now on linux, and probably has been passing since
r282993.

llvm-svn: 349479
2018-12-18 13:12:36 +00:00
Pavel Labath 7f03203142 Un-XFAIL TestNamespaceLookup for linux
These tests are now passing on linux, at least with top-of-tree clang,
clang-6 and gcc-7.3. It's possible it may still be failing with some
older compilers, but I don't have those around to test.

llvm-svn: 349478
2018-12-18 12:55:30 +00:00
Jason Molenda f47c734e49 A few small updates to the testsuite for running against an iOS device.
Remove the expected-fails for 34538611; using an alternate platform
implementation handles these correctly.

llvm-svn: 349417
2018-12-17 23:33:40 +00:00
Adrian Prantl 5a5b49060d Reflow readme
llvm-svn: 349398
2018-12-17 21:18:12 +00:00
Adrian Prantl 4cf98e2c7b Remove sleep() synchronisation from teststcase and
make the executable name more unique.

This test is failing sporadically on some bots. By removing the sleep
synchronisation, I'm hoping to get it to fail more reproducibly so I
can investigate what is going on.

llvm-svn: 349397
2018-12-17 21:18:11 +00:00
Tatyana Krasnukha 0127883373 Update a comment according to r255360 "Remove -r and -R options from dotest.py"
llvm-svn: 349208
2018-12-14 23:02:41 +00:00
Adrian Prantl 8f06d10291 Remove the Disassembly benchmarks.
While I was out hunting for remaining pexpect-based tests, I came
across these tests that can't possibly work an any modern system, as
they rely on having gdb available in /Developer.

This patch simply removes the test without replacement.

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

llvm-svn: 349194
2018-12-14 21:06:00 +00:00
Greg Clayton 918adb56d8 Fix test failures that depended on module order
llvm-svn: 349122
2018-12-14 03:07:15 +00:00
Jonas Devlieghere c67768fe23 Remove unused file
I removed the dotest-style reproducer test but forgot to delete the
source file. Thanks Jim for the heads up!

llvm-svn: 348901
2018-12-11 22:46:56 +00:00
Adrian Prantl 0bc587a128 Rewrite pexpect-based test in LIT/FileCheck.
pexecpt-based tests are flakey because they involve timeouts and this
test is eprfectly serializable.

llvm-svn: 348808
2018-12-10 22:57:47 +00:00
Pavel Labath 1f6b247717 Re-commit "Introduce ObjectFileBreakpad"
This re-commits r348592, which was reverted due to a failing test on
macos.

The issue was that I was passing a null pointer for the
"CreateMemoryInstance" callback when registering ObjectFileBreakpad,
which caused crashes when attemping to load modules from memory. The
correct thing to do is to pass a callback which always returns a null
pointer (as breakpad files are never loaded in inferior memory).

It turns out that there is only one test which exercises this code path,
and it's mac-only, so I've create a new test which should run everywhere
(except windows, as one cannot delete an executable which is being run).
Unfortunately, this test still fails on linux for other reasons, but at
least it gives us something to aim for.

The original commit message was:
This patch adds the scaffolding necessary for lldb to recognise symbol
files generated by breakpad. These (textual) files contain just enough
information to be able to produce a backtrace from a crash
dump. This information includes:
- UUID, architecture and name of the module
- line tables
- list of symbols
- unwind information

A minimal breakpad file could look like this:
MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 a.out
INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3
FILE 0 /tmp/a.c
FUNC 1010 10 0 _start
1010 4 4 0
1014 5 5 0
1019 5 6 0
101e 2 7 0
PUBLIC 1010 0 _start
STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^
STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 +
STACK CFI 1014 .cfa: $rbp 16 +

Even though this data would normally be considered "symbol" information,
in the current lldb infrastructure it is assumed every SymbolFile object
is backed by an ObjectFile instance. So, in order to better interoperate
with the rest of the code (particularly symbol vendors).

In this patch I just parse the breakpad header, which is enough to
populate the UUID and architecture fields of the ObjectFile interface.
The rough plan for followup patches is to expose the individual parts of
the breakpad file as ObjectFile "sections", which can then be used by
other parts of the codebase (SymbolFileBreakpad ?) to vend the necessary
information.

Reviewers: clayborg, zturner, lemo, amccarth

Subscribers: mgorny, fedor.sergeev, markmentovai, lldb-commits

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

llvm-svn: 348773
2018-12-10 17:16:38 +00:00
Stella Stamenova 1770c9ad24 [lldbsuite] Disable TestStopPCs when there's no XML support
The test relies on xml support to setup the correct registers. If there's no XML support, the test is going to fail.

llvm-svn: 348435
2018-12-06 00:11:17 +00:00
Aleksandr Urakov eecf48785b [Expr] Fix `TestExprOptions` after r348240 on MacOS X
Summary:
r348240 assumes that an expression contains the Objective C option if
Objective C Runtime is found. But on MacOS X it seems that the test application
process always contains Objective C Runtime, so the test fails when it assumes
that the language is C++ only. Skip this part on Darwin.

llvm-svn: 348250
2018-12-04 11:08:02 +00:00
Aleksandr Urakov f335188925 [Expr] Check the language before ignoring Objective C keywords
Summary:
This patch adds the check of the language before ignoring names like `id` or
`Class`, which are reserved in Objective C, but are allowed in C++. It is needed
to make it possible to evaluate expressions in a C++ program containing names
like `id` or `Class`.

Reviewers: jingham, zturner, labath, clayborg

Reviewed By: jingham, clayborg

Tags: #lldb

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

llvm-svn: 348240
2018-12-04 09:51:29 +00:00
Jonas Devlieghere 15eacd741f [Reproducers] Change how reproducers are initialized.
This patch changes the way the reproducer is initialized. Rather than
making changes at run time we now do everything at initialization time.
To make this happen we had to introduce initializer options and their SB
variant. This allows us to tell the initializer that we're running in
reproducer capture/replay mode.

Because of this change we also had to alter our testing strategy. We
cannot reinitialize LLDB when using the dotest infrastructure. Instead
we use lit and invoke two instances of the driver.

Another consequence is that we can no longer enable capture or replay
through commands. This was bound to go away form the beginning, but I
had something in mind where you could enable/disable specific providers.
However this seems like it adds very little value right now so the
corresponding commands were removed.

Finally this change also means you now have to control this through the
driver, for which I replaced --reproducer with --capture and --replay to
differentiate between the two modes.

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

llvm-svn: 348152
2018-12-03 17:28:29 +00:00
Aleksandr Urakov a5235af980 [PDB] Support PDB-backed expressions evaluation (+ fix stuck test)
Summary:
This patch contains several small fixes, which makes it possible to evaluate
expressions on Windows using information from PDB. The changes are:
- several sanitize checks;
- make IRExecutionUnit::MemoryManager::getSymbolAddress to not return a magic
  value on a failure, because callers wait 0 in this case;
- entry point required to be a file address, not RVA, in the ObjectFilePECOFF;
- do not crash on a debuggee second chance exception - it may be an expression
  evaluation crash. Also fix detection of "crushed" threads in tests;
- create parameter declarations for functions in AST to make it possible to call
  debugee functions from expressions;
- relax name searching rules for variables, functions, namespaces and types. Now
  it works just like in the DWARF plugin;
- fix endless recursion in SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc.

Reviewers: zturner, asmith, stella.stamenova

Reviewed By: stella.stamenova, asmith

Tags: #lldb

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

llvm-svn: 348136
2018-12-03 13:31:13 +00:00
Jason Molenda e2c7c18056 Add a test to verify that lldb can load a kext binary.
<rdar://problem/46356062> 

llvm-svn: 348040
2018-11-30 21:33:00 +00:00
Jonas Devlieghere da51778880 Skip TestRequireHWBreakpoints on Windows
The test assumes that HW breakpoints are not implemented by the debug
server. Windows doesn't use these and might actually support HW
breakpoints so these tests are expected fail because they don't raise
the expected error.

llvm-svn: 348010
2018-11-30 17:31:20 +00:00
Aleksandr Urakov 9b087d2ce6 [Target] Do not skip a stop on a breakpoint if a plan was completed
Summary:
This patch fixes the next situation. On Windows clang-cl makes no stub before
the main function, so the main function is located exactly on module entry
point. May be it is the same on other platforms. So consider the following
sequence:

- set a breakpoint on main and stop there;
- try to evaluate expression, which requires a code execution on the debuggee
  side. Such an execution always returns to the module entry, and the plan waits
  for it there;
- the plan understands that it is complete now and removes its breakpoint. But
  the breakpoint site is still there, because we also have a breakpoint on
  entry;
- StopInfo analyzes a situation. It sees that we have stopped on the breakpoint
  site, and it sees that the breakpoint site has owners, and no one logical
  breakpoint is internal (because the plan is already completed and it have
  removed its breakpoint);
- StopInfo thinks that it's a user breakpoint and skips it to avoid recursive
  computations;
- the program continues.

So in this situation the program continues without a stop right after
the expression evaluation. To avoid this an additional check that
the plan was completed was added.

Reviewers: jingham, zturner, boris.ulasevich

Reviewed by: jingham

Tags: #lldb

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

llvm-svn: 347974
2018-11-30 09:45:52 +00:00
Stella Stamenova c84754e7f9 [lldbsuite] Build with -gdwarf on Windows
Earlier this month there was a change in clang that defaulted to using codeview rather than dwarf on Windows. Since all the tests rely on dwarf, we need to explicitly request dwarf when building on Windows.

llvm-svn: 347924
2018-11-29 22:15:23 +00:00
Kuba Mracek e60bc53b46 [lldb] Add GetCurrentException APIs to SBThread, add frame recognizer for objc_exception_throw for Obj-C runtimes
This adds new APIs and a command to deal with exceptions (mostly Obj-C exceptions): SBThread and Thread get GetCurrentException API, which returns an SBValue/ValueObjectSP with the current exception for a thread. "Current" means an exception that is currently being thrown, caught or otherwise processed. In this patch, we only know about the exception when in objc_exception_throw, but subsequent patches will expand this (and add GetCurrentExceptionBacktrace, which will return an SBThread/ThreadSP containing a historical thread backtrace retrieved from the exception object. Currently unimplemented, subsequent patches will implement this).

Extracting the exception from objc_exception_throw is implemented by adding a frame recognizer.

This also add a new sub-command "thread exception", which prints the current exception.

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

llvm-svn: 347813
2018-11-28 22:01:52 +00:00
Stella Stamenova fdfcd719a2 [lldbsuite] Each lldb suite test must have a unique class name
A couple of new tests have been added that use existing class names. This causes failures on Windows if the tests run at the same time and on any platform it results in the logs being overwritten.

llvm-svn: 347717
2018-11-27 22:18:02 +00:00
Jonas Devlieghere 312a46a94a Skip TestTargetCreateDeps
Skip this test because Windows deals differently with shared libraries.

llvm-svn: 347283
2018-11-20 01:18:49 +00:00
Stella Stamenova c01fc1c696 [lldbsuite] Invoke sed on Windows to determine the cache dir for clang
Summary: In order to invoke sed on Windows, we need to quote the command correctly. Since we already have commands which do that, move the definitions at the beginning of the file and then re-use them for each command.

Reviewers: aprantl, zturner

Subscribers: teemperor, lldb-commits

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

llvm-svn: 347243
2018-11-19 18:41:33 +00:00
Zachary Turner f8610fc4e7 Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD"
This breaks many tests on Windows, which now all fail with an error such
as "Unable to read memory at address <xxxxxxxx>".

llvm-svn: 347174
2018-11-18 20:48:25 +00:00
Adrian Prantl a900471d58 Just don't even attempt to invoke sed on Windows.
llvm-svn: 347125
2018-11-17 01:27:47 +00:00
Adrian Prantl 3d6c743f4e Revert "Makefile.rules: Fix the windows-sed-quoting issue harder."
llvm-svn: 347124
2018-11-17 01:27:46 +00:00
Adrian Prantl b3d7092ab8 Makefile.rules: Fix the windows-sed-quoting issue harder.
llvm-svn: 347120
2018-11-17 00:45:58 +00:00
Frederic Riss f7c101b653 Make TestAppleSimulatorOSType.py more flexible
Different versions of Xcode have different outputs for the simctl command

llvm-svn: 347117
2018-11-17 00:40:31 +00:00
Frederic Riss d146e337ed Rewrite stop-hook tests as a couple of FileCheck tests
Those tests were using pexpect and being flaky on some of ours bots.
This patch reimplmeents the tests usinf FileCheck, and it also
extends the test coverage to a few more stop-hook options.

llvm-svn: 347109
2018-11-16 23:07:28 +00:00
Adrian Prantl ac35cd330a Makefile.rules: Degrade gracefully on Windows machines without sed.
llvm-svn: 347104
2018-11-16 22:44:57 +00:00
Adrian Prantl ddc01238b1 Use a shared module cache directory for LLDB.
This saves about 3 redundant gigabytes from the Objective-C test build
directories. Tests that must do unsavory things with the LLDB clang
module cache, already specify a per-test module cache in their .py
test instructions.

<rdar://problem/36002081>

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

llvm-svn: 347057
2018-11-16 16:19:07 +00:00
Adrian Prantl d1b33162b5 Makefile.rules: Use a shared clang module cache directory.
Just to be safe, up until now each test used its own Clang module
cache directory. Since the compiler within one testsuite doesn't
change it is just as safe to share a clang module directory inside the
LLDB test build directory. This saves us from compiling tens of
gigabytes of redundant Darwin and Foundation .pcm files and also
speeds up running the test suite quite significantly.

rdar://problem/36002081

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

llvm-svn: 347056
2018-11-16 16:19:07 +00:00
Nathan Lanza 04f9d0a0c3 Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD
Summary:
This commit implements basic DidAttach and DidLaunch for the windows
DynamicLoader plugin which allow us to load shared libraries from the
inferior.

Reviewers: sas, zturner

Reviewed By: zturner

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

llvm-svn: 346994
2018-11-15 20:58:09 +00:00
Nathan Lanza 5cc7de09ef Force SHELL to be cmd.exe on Windows for the test suite
Summary:
Windows make will search for other shells and choose those over cmd
if available (e.g. C:\cygdrive\bin\sh.exe). This shell has numerous
issues with path handling (/ vs \\ vs \ and C:). So default to using
cmd.exe which is known to work.

Reviewers: zturner, sas, xiaobai

Reviewed By: zturner

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

llvm-svn: 346993
2018-11-15 20:56:44 +00:00
Adrian Prantl d987a8cf38 Port the Darwin universal binary testcase to x86_64.
Xcode 10 doesn't ship with an i386 SDK any more. This patch ports the
testcase from an i386/x86_64 -> x86_64/x86_64h universal binary.

rdar://problem/46099343

llvm-svn: 346981
2018-11-15 19:15:03 +00:00
Jonas Devlieghere e103ae92ef Add setting to require hardware breakpoints.
When debugging read-only memory we cannot use software breakpoint. We
already have support for hardware breakpoints and users can specify them
with `-H`. However, there's no option to force LLDB to use hardware
breakpoints internally, for example while stepping.

This patch adds a setting target.require-hardware-breakpoint that forces
LLDB to always use hardware breakpoints. Because hardware breakpoints
are a limited resource and can fail to resolve, this patch also extends
error handling in thread plans, where breakpoints are used for stepping.

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

llvm-svn: 346920
2018-11-15 01:18:15 +00:00
Adrian Prantl dced6ee923 Remove the expectedFlakeyDsym decorator. It's not useful anymore.
llvm-svn: 346906
2018-11-14 22:54:43 +00:00
Jonas Devlieghere 9e046f02e3 Add GDB remote packet reproducer.
llvm-svn: 346780
2018-11-13 19:18:16 +00:00
Kuba Mracek 377912845e [lldb] Add synthetic frontend for _NSCallStackArray
An Obj-C array type _NSCallStackArray is used in NSException backtraces. This patch adds a synthetic frontend for _NSCallStackArray, which now correctly returns frame PCs.

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

llvm-svn: 346708
2018-11-12 21:26:03 +00:00
Kuba Mracek c3f1e62920 [lldb] Extract more fields from NSException values
This patch teaches LLDB about more fields on NSException Obj-C objects, specifically we can now retrieve the "name" and "reason" of an NSException. The goal is to eventually be able to have SB API that can provide details about the currently thrown/caught/processed exception.

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

llvm-svn: 346695
2018-11-12 19:12:31 +00:00
Jonas Devlieghere ceff6644bb Remove header grouping comments.
This patch removes the comments grouping header includes. They were
added after running IWYU over the LLDB codebase. However they add little
value, are often outdates and burdensome to maintain.

llvm-svn: 346626
2018-11-11 23:17:06 +00:00
Adrian Prantl 2ddb2652d9 Add extra diagnostics to test
llvm-svn: 346572
2018-11-10 00:16:39 +00:00
Jason Molenda c0e793d654 Work with a gdb-remote target that doesn't handle the
qWatchpointSupportInfo packet correctly.  

In GDBRemoteCommunicationClient::GetWatchpointSupportInfo,
if the response to qWatchpointSupportInfo does not
include the 'num' field, then we did not get an answer
we understood, mark this target as not supporting that
packet.

In Target.cpp, rename the very confusingly named
CheckIfWatchpointsExhausted to CheckIfWatchpointsSupported,
and check the error status returned by 
Process::GetWatchpointSupportInfo.  If we cannot determine
what the number of supported watchpoints are, assume that
they will work.  We'll handle the failure
later when we try to create/enable the watchpoint if the
Z2 packet isn't supported.

Add a gdb_remote_client test case.

<rdar://problem/42621432> 

llvm-svn: 346561
2018-11-09 22:33:26 +00:00
Shafik Yaghmour 8c5ec1ff46 Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove redundant parameter which can be calculated from other parameter.
rdar://problem/43822994

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

llvm-svn: 346428
2018-11-08 18:42:00 +00:00
Davide Italiano 62d2f76a45 [TestVLA] Fix a python decorator.
llvm-svn: 346186
2018-11-06 00:18:17 +00:00
Adrian Prantl 005d3dee4d Skip this test on older versions of clang.
llvm-svn: 346172
2018-11-05 22:19:22 +00:00
Adrian Prantl eca07c592a Fix (and improve) the support for C99 variable length array types
Clang recently improved its DWARF support for C VLA types. The DWARF
now looks like this:

0x00000051:         DW_TAG_variable [4]
                     DW_AT_location( fbreg -32 )
                     DW_AT_name( "__vla_expr" )
                     DW_AT_type( {0x000000d3} ( long unsigned int ) )
                     DW_AT_artificial( true )
...
0x000000da:     DW_TAG_array_type [10] *
                 DW_AT_type( {0x000000cc} ( int ) )

0x000000df:         DW_TAG_subrange_type [11]
                     DW_AT_type( {0x000000e9} ( __ARRAY_SIZE_TYPE__ ) )
                     DW_AT_count( {0x00000051} )

Without this patch LLDB will naively interpret the DIE offset 0x51 as
the static size of the array, which is clearly wrong.  This patch
extends ValueObject::GetNumChildren to query the dynamic properties of
incomplete array types.

See the testcase for an example:

   4   int foo(int a) {
   5   	     int vla[a];
   6   	       for (int i = 0; i < a; ++i)
   7   	           vla[i] = i;
   8
-> 9            pause(); // break here
   10  		return vla[a-1];
   11   }

(lldb) fr v vla
(int []) vla = ([0] = 0, [1] = 1, [2] = 2, [3] = 3)
(lldb) quit

rdar://problem/21814005

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

llvm-svn: 346165
2018-11-05 20:49:07 +00:00
Jonas Devlieghere 77198bc79b Remove Go debugger plugin
In January Davide sent an e-mail to the mailing list to suggest removing
unmaintained language plugins such as Go and Java. The plan was to have
some cool down period to allow users to speak up, however after that the
plugins were never actually removed.

This patch removes the Go debugger plugin.

The plugin can be added again in the future if it is mature enough both
in terms of testing and maintenance commitment.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013171.html

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

llvm-svn: 346157
2018-11-05 19:33:59 +00:00
Jan Kratochvil b5602a6c70 Fix duplicate testcase filename
dotest.py started reporting:
	Exception: Found multiple tests with the name TestSampleTest.py
After the commit of:
	https://reviews.llvm.org/D54056

llvm-svn: 346089
2018-11-04 06:13:09 +00:00
Jim Ingham ab639986cf Add an SBExpressionOptions setting mirroring the "exec" command's --allow-jit.
<rdar://problem/44809176>

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

llvm-svn: 346053
2018-11-02 23:42:40 +00:00
Jason Molenda 7d40f144f2 When no FileCheck binary is specified, look in the llvm/clang bin
dirs relative to the source directory (Xcode build style) to find
one, use it if found.  

llvm-svn: 345912
2018-11-01 23:41:05 +00:00
Adrian Prantl 24a255d9aa Makefile.rules: Don't use code signing on macOS; it isn't necessary.
llvm-svn: 345768
2018-10-31 19:42:02 +00:00
Kuba Mracek 41ae8e7445 [lldb] Introduce StackFrameRecognizer [take 3]
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

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

llvm-svn: 345693
2018-10-31 04:00:22 +00:00
Kuba Mracek cb3628bcc0 Revert r345686 due to build failures
llvm-svn: 345688
2018-10-31 01:22:48 +00:00
Kuba Mracek 8fddd98185 [lldb] Introduce StackFrameRecognizer [take 2]
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

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

llvm-svn: 345686
2018-10-31 00:36:20 +00:00
Kuba Mracek 377f9f9b3f Revert r345678 (build failure on Linux machines).
llvm-svn: 345680
2018-10-31 00:29:17 +00:00
Kuba Mracek ac0ba8c524 [lldb] Introduce StackFrameRecognizer
This patch introduces a concept of "frame recognizer" and "recognized frame". This should be an extensible mechanism that retrieves information about special frames based on ABI, arguments or other special properties of that frame, even without source code. A few examples where that could be useful could be 1) objc_exception_throw, where we'd like to get the current exception, 2) terminate_with_reason and extracting the current terminate string, 3) recognizing Objective-C frames and automatically extracting the receiver+selector, or perhaps all arguments (based on selector).

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

llvm-svn: 345678
2018-10-31 00:21:03 +00:00
Davide Italiano 70ad9c74ae [testsuite] Skip an already failing test on MacOS.
Due to some libcxx changes to inlining, this now also crashes,
so it gets reported as "failure" by the bot. This commit doesn't
really change the status quo, just placates the bots.

llvm-svn: 345668
2018-10-30 22:49:22 +00:00
Shafik Yaghmour 693fbf5c93 [DataFormatters] Adding formatters for libc++ std::u16string and std::u32string
rdar://problem/41302849

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

llvm-svn: 345402
2018-10-26 17:00:48 +00:00
Jonas Devlieghere a2a2f2efba Update test that checks auto-completion for settings set.
This reverts r345350 and updates the test rather than removing it. Now
we check that `--g` auto-completes to `--global`.

llvm-svn: 345351
2018-10-26 00:50:54 +00:00
Jonas Devlieghere 81fec4299d Remove test that checks auto-completion for settings set.
With the new `-f` option for `settings set`, `-` (dash) no longer
auto-complete to `-g`.

llvm-svn: 345350
2018-10-26 00:39:27 +00:00
Aleksandr Urakov c1c0fac765 [API] Extend the `SBThreadPlan` interface
Summary:
This patch extends the `SBThreadPlan` to allow retrieving of thread plans
for scripted steps.

Reviewers: labath, zturner, jingham

Reviewed By: jingham

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 345247
2018-10-25 08:27:42 +00:00
Jason Molenda df9f796fbb Support nwere versions of the Segger J-Link jtag board software.
Add support in ProcessGDBRemote::GetGDBServerRegisterInfo
for recognizing a generic "arm" architecture that will be used if
nothing better is available so that we don't ignore the register
definitions if we didn't already have an architecture set.
Also in ProcessGDBRemote::DoConnectRemote don't set the target
arch unless we have a valid architecture to set it to.

Platform::ConnectProcess will try to get the current target's
architecture, or the default architecture, when creating the 
target for the connection to be attempted.  If lldb was started
with a target binary, we want to create this target with that
architecture in case the remote gdb stub doesn't supply a
qHostInfo arch.

Add logging to Target::MergeArchitecture.

<rdar://problem/34916465> 

llvm-svn: 345106
2018-10-23 23:45:56 +00:00
Jonas Devlieghere 6389f6055a Skip test with older versions of clang
This was failing for the bots that build with older clangs:

http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-5.0.2/
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-6.0.1/

llvm-svn: 345061
2018-10-23 17:49:51 +00:00
Stella Stamenova f6ec77b447 [lldbsuite, windows] Disable two tail call frames tests that fail on Windows
Summary: These tests fail on Windows because of known limitations (a.k.a. bugs) with the current implementation of GetFrameAtIndex

Reviewers: asmith, vsk

Reviewed By: vsk

Subscribers: abidh, lldb-commits

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

llvm-svn: 344788
2018-10-19 16:00:58 +00:00
Stella Stamenova c3439b0995 [lldbsuite] Mark the TestScriptedResolver tests as XFAIL on Windows
Summary: They fail similarly to some of the other breakpoint tests on Windows, so I suspect the cause is the same. I've linked to the same bug.

Reviewers: asmith, zturner, jingham

Subscribers: abidh, lldb-commits

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

llvm-svn: 344744
2018-10-18 15:30:31 +00:00
Krasimir Georgiev a35912da9f Revert "Return a named error in the result object of an expression with no result"
This reverts commit r344647.
This causes build failures with [-Werror, -Wswitch]. Some cases where the newly
introduced enum value is not handled in particular are in:
  lldb/source/Expression/REPL.cpp:350
  lldb/source/Interpreter/CommandInterpreter.cpp:1529
(maybe there could be more)

As I don't understand lldb to make sure the likely trivial fixes are
correct and also as they might need additional tests, leaving to the
author to resolve.

llvm-svn: 344722
2018-10-18 03:10:43 +00:00
Jim Ingham b1ecc3cac2 Return a named error in the result object of an expression with no result
Before we returned an error that was not exposed in the SB API and no useful
error message.  This change returns eExpressionProducedNoResult and an
appropriate error string.

<rdar://problem/44539514>

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

llvm-svn: 344647
2018-10-16 21:58:40 +00:00
Jason Molenda 0128e7f540 Tiny testsuite tweaks. Don't run the apple simulator
tests when targetting a device.  Add an include to 
safe-to-call-func to work around a modules issue with
a certain combination of header files.  Add rules for
Darwin systems to ad-hoc codesign binaries that the
testsuite builds.

llvm-svn: 344635
2018-10-16 18:14:30 +00:00
Vedant Kumar 2493707818 Use a relaxed substring check for function names in a test
The TestTailCallFrameSBAPI.py test checks that function names in a
backtrace are equal to an expected value.

Use a relaxed substring check because function dislpay names are
platform-dependent. E.g we see "void sink(void)" on Windows, but "sink()" on
Darwin. This seems like a bug -- just work around it for now.

llvm-svn: 344634
2018-10-16 18:13:42 +00:00
Jason Molenda 696569d757 Don't run TestBreakpointIt.py on arm64 devices;
it is armv7 specific.

llvm-svn: 344633
2018-10-16 18:11:17 +00:00
Stella Stamenova e05451b73b [lldbsuite] Fix the mac version decorator to work on non-mac platforms
Summary: On non-mac platforms, mac_ver returns an empty string which when converted to LooseVersion has no "version" property. This causes a failure when the decorator executes. Instead, check whether the value returned from mac_ver is an empty string and avoid the LooseVersion comparison.

Reviewers: labath, davide, asmith, shafik, jingham

Reviewed By: jingham

Subscribers: jingham, lldb-commits

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

llvm-svn: 344623
2018-10-16 17:13:45 +00:00
Vedant Kumar b48515a44e Use assertEqual to improve test failure logging
Some tests in test/functionalities/tail_call_frames are failing on
non-Darwin platforms. Use assertEqual to improve logging on failure.

llvm-svn: 344581
2018-10-16 03:31:33 +00:00
Stella Stamenova 7a8865cea8 [lldbsuite] Make the names of test classes unique
Summary:
If the names are not unique, the tests overwrite each other's results and logs. This also causes failures on platforms where the files are locked for writing.

The names of the class/test pairs *have to* always be unique. The easiest way to achieve that is to name each class differently (usually the same as the file name).

Reviewers: jasonmolenda, asmith

Subscribers: clayborg, nemanjai, kbarton, lldb-commits

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

llvm-svn: 344547
2018-10-15 19:51:21 +00:00
Stella Stamenova abe3c7d841 [lldbsuite] Disable Test128BitsInteger on Windows
Summary: This test is failing on Windows because lldb does not support JIT on Windows.

Reviewers: davide, asmith

Reviewed By: davide

Subscribers: lldb-commits

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

llvm-svn: 344543
2018-10-15 18:51:28 +00:00
Stella Stamenova 8003485cbf Fix failure in get_filecheck_path when filecheck is None
If the path was not specified (and it's None), lexists throws an exception rather than returning False. get_filecheck_path now checks whether filecheck is set before calling lexists

llvm-svn: 344410
2018-10-12 20:00:20 +00:00
Shafik Yaghmour 730985b1b3 Changing test names in TestDataFormatterLibcxxVariant.py and TestStdFunctionStepIntoCallable.py to be unique, NFC
llvm-svn: 344407
2018-10-12 19:46:17 +00:00
Vedant Kumar 8e2f09d615 [dotest] Make a missing FileCheck binary a warning, not an error
This allows bots which haven't updated to pass in --filecheck to
dotest.py to run more tests. FileCheck-dependent tests will continue to
fail.

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

llvm-svn: 344401
2018-10-12 19:29:59 +00:00
Stella Stamenova 073d21fad0 [lldbsuite] Fix the filecheck functionality to work with Python 3
Summary: This is another string/byte conversion issue between Python 2 and 3. In Python 2, the subprocess communication expects a byte string, but in Python 3, it expects bytes. Since both versions are capable of using strings when universal_newlines is set to True AND filecheck operates on strings, force the use of strings.

Reviewers: zturner, asmith, vsk

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 344386
2018-10-12 17:56:01 +00:00
Shafik Yaghmour aa30268539 Adding support to step into the callable wrapped by libc++ std::function
rdar://problem/14365983

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

llvm-svn: 344371
2018-10-12 17:20:39 +00:00
Vedant Kumar 4b36f7911d Add support for artificial tail call frames
This patch teaches lldb to detect when there are missing frames in a
backtrace due to a sequence of tail calls, and to fill in the backtrace
with artificial tail call frames when this happens. This is only done
when the execution history can be determined from the call graph and
from the return PC addresses of calls on the stack. Ambiguous sequences
of tail calls (e.g anything involving tail calls and recursion) are
detected and ignored.

Depends on D49887.

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

llvm-svn: 343900
2018-10-05 23:23:15 +00:00
Vedant Kumar 9d9c965544 Relax a data formatter test
Before inspecting the contents of a list, make sure that we've stepped
past the push_back() that inserts the element we're interested in.

llvm-svn: 343899
2018-10-05 23:14:13 +00:00
Stefan Granitz 21d1754f7c TestMultilineExpr: validate evaluation for expressions that span multiple lines
Summary:
When LLDB successfully parses a command (like "expression" in this case) and determines incomplete input, the user can continue typing on multiple lines (in this case "2+3"). This should provide the correct result.
Note that LLDB reverts input from the additional lines, so they are not present in the output.

Reviewers: vsk, davide, aprantl

Subscribers: lldb-commits

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

llvm-svn: 343860
2018-10-05 16:49:53 +00:00
Bruce Mitchener 173946dca6 Fix typos.
Reviewers: lldb-commits

Subscribers: srhines, ki.stfu

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

llvm-svn: 343825
2018-10-04 22:33:39 +00:00
Jan Kratochvil 0e99f561e1 Fix buildbot regression by rL339929: NameError: global name 'test_directory' is not defined
With buildbot slave under test - I get after rL339929:
http://lab.llvm.org:8014/builders/lldb-x86_64-fedora-28-cmake/builds/243/steps/test1/logs/stdio

  File "/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/scripts/../llvm/tools/lldb/test/dotest.py", line 7, in <module>
    lldbsuite.test.run_suite()
  File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dotest.py", line 1177, in run_suite
    configuration.results_formatter_object)
  File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dosep.py", line 1692, in main
    dst = core.replace(test_directory, "")[1:]
NameError: global name 'test_directory' is not defined

Patch by Vedant Kumar.

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

llvm-svn: 343726
2018-10-03 21:42:54 +00:00
Shafik Yaghmour d2fcbbab3a Adding skipIf to std::variant libc++ data-formatter test since get is not available before macOS 10.14
Patch by Shafik Yaghmour

llvm-svn: 343718
2018-10-03 20:52:56 +00:00
Adrian Prantl 1c8ed2081f Skip test with older versions of clang
llvm-svn: 343695
2018-10-03 16:24:14 +00:00
Adrian Prantl be50052a2b Remove unnecessary field
llvm-svn: 343624
2018-10-02 20:14:12 +00:00
Adrian Prantl f796e763b2 DWARFExpression: Resolve file addresses in the linked module
This is a follow-up to https://reviews.llvm.org/D46362.

When evaluating a complex expression in DWARFExpression::Evaluate,
file addresses must be resolved to load addresses before we can
perform operations such as DW_OP_deref on them.

For this the address goes through three steps

1. Read the file address as stored in the DWARF
2. Link/relocate the file address (when reading from a .dSYM, this is a no-op)
3. Convert the file address to a load address.

D46362 implemented step (3) by resolving the file address using the
Module that the original DWARF came from. In the case of a dSYM that
is correct, but when reading from .o files, we need to look up
relocated/linked addresses, so the right place to look them up is the
current frame's module. This patch fixes that by setting the
expression's Module to point to the linked debugmap object.

A word a bout the unorthodox testcase: The motivating testcase for
this fix is in Swift, but I managed to hand-modify LLVM-IR for a
trivial C program to exhibit the same problem, so we can fix this in
llvm.org.

rdar://problem/44689915

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

llvm-svn: 343612
2018-10-02 17:50:42 +00:00
Adrian Prantl 7fd4513920 Enable C++ tests to run in the -gmodules configuration on Darwin.
This addresses PR36048 (http://llvm.org/bugs/show_bug.cgi?id=36048)

rdar://problem/36776281

llvm-svn: 343545
2018-10-01 22:27:42 +00:00
Jonas Devlieghere 23b62aa6d4 Fix tests affected by printing change.
I forgot to update some tests that were affected by the escaping of
backticks in the format string, landed in r343471.

llvm-svn: 343502
2018-10-01 17:20:57 +00:00
Davide Italiano e174746c5e [SBAPI/Target] Expose SetStatistics(bool enable)/GetStatistics().
<rdar://problem/44875808>

llvm-svn: 343368
2018-09-28 23:27:54 +00:00
Jason Molenda a11b3fe26f Change the unwinder to not use a hard-coded limit on the
max number of stack frames to backtrace, make it a setting,
target.process.thread.max-backtrace-depth.
Add a test case for the setting.

<rdar://problem/28759559> 

llvm-svn: 343029
2018-09-25 21:01:54 +00:00
Vedant Kumar 75606b285c [lldbinline] Set directory attribute on test-specific classes
Set the "mydir" attribute of an inline test on the test-specific class,
instead of on the base InlineTest class.

This makes it possible to run dotest.py on a directory containing inline
tests. This wasn't really possible prior to this patch, because what
would happen is that one test would just run over and over again, even
though the test infrastructure would claim that different tests were
being run.

Example:

The test infrastructure claimed that all of these different tests were passing,
which couldn't be true --

$ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep PASS
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateTailCallSeq)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestArtificialFrameStepOutMessage)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq1)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguatePathsToCommonSink)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestDisambiguateCallSite)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestUnambiguousTailCalls)
PASS: LLDB (/Users/vsk/src/builds/tailcall-RA/bin/clang-8-x86_64) :: test_dwarf (lldbsuite.test.lldbtest.TestAmbiguousTailCallSeq2)
RESULT: PASSED (7 passes, 0 failures, 0 errors, 24 skipped, 0 expected failures, 0 unexpected successes)

... because it wasn't even looking at some of these tests:

$ ./bin/lldb-dotest /Users/vsk/src/tailcall/lldb/test/testcases/functionalities/tail_call_frames/ -G dwarf -t 2>&1 | grep "Change dir"
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2
Change dir to: /Users/vsk/src/tailcall/lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2

E.g it was only building one of them:

$ ls lldb-test-build.noindex/functionalities/tail_call_frames/                        
ambiguous_tail_call_seq2

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

llvm-svn: 343023
2018-09-25 20:20:13 +00:00
Pavel Labath 7bfc416bfb XFAIL some tests in TestTargetCreateDeps on linux
On linux, we do not support automatic loading of dependent modules, so
the module list will always contain just one module (until the target is
launched).

llvm-svn: 343016
2018-09-25 19:52:04 +00:00
Tatyana Krasnukha ec9a6a2701 Skip test if gcc version is less than 7.1 since it doesn't support -gcolumn-info option
llvm-svn: 342732
2018-09-21 13:20:26 +00:00
Vedant Kumar f853c6e074 [lldbtest] Fix self.filecheck check file lookup
The 'test_filename' property in TestBase changes over time, so
attempting to find a check file relative to the directory containing
'test_filename' is flaky.

Use the absolute path of the check file as that's always correct (and
simpler). This relies on the test driver changing into the test
directory, which it seems we can safely assume.

As a drive-by, make self.filecheck respect the trace (-t) option.

llvm-svn: 342699
2018-09-20 23:56:39 +00:00
Jonas Devlieghere 26ba928214 [target] Change target create's behavior wrt loading dependent files.
When creating a target, lldb loads all dependent files (i.e. libs in
LC_LOAD_DYLIB for Mach-O). This can be confusing, especially when two
versions of the same library end up in the shared cache. It's possible
to change this behavior, by specifying  target create -d <target> these
dependents are not loaded.

This patch changes the default behavior to only load dependent files
only when the target is an executable. When creating a target for a
library, it is now no longer necessary to pass -d. The user can still
override this behavior by specifying the -d option to change this
behavior.

rdar://problem/43721382

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

llvm-svn: 342634
2018-09-20 09:09:13 +00:00
Shafik Yaghmour 8306f76e56 [DataFormatters] Add formatter for C++17 std::variant
rdar://problem/43691454

Patch by Shafik Yaghmour.

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

llvm-svn: 342563
2018-09-19 18:07:05 +00:00
Vedant Kumar 9b13bea61a Allow use of self.filecheck in LLDB tests (c.f self.expect)
Add a "filecheck" method to the LLDB test base. This allows test authors
to pattern match command output using FileCheck, making it possible to
write stricter tests than what `self.expect` allows.

For context (motivation, examples of stricter checking, etc), see the
lldb-dev thread: "Using FileCheck in lldb inline tests".

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

llvm-svn: 342508
2018-09-18 19:31:47 +00:00
Shafik Yaghmour 2ee93d28fd Revert "[DataFormatters] Add formatter for C++17 std::variant"
This reverts commit r342421.

Because it breaks build bot http://green.lab.llvm.org/green/job/lldb-cmake-clang-5.0.2//418/console

llvm-svn: 342424
2018-09-17 23:15:35 +00:00
Shafik Yaghmour 854a35092c [DataFormatters] Add formatter for C++17 std::variant
rdar://problem/43691454

Patch by Shafik Yaghmour.

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

llvm-svn: 342421
2018-09-17 22:10:44 +00:00
Raphael Isemann 9dd34c8385 Add descriptions to completed expressions
Summary:
Completing inside the expression command now uses the new description API
to also provide additional information to the user. For now this information
are the types of variables/fields and the signatures of completed function calls.

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere, lldb-commits

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

llvm-svn: 342385
2018-09-17 12:06:07 +00:00
Davide Italiano 5f6789ef6e [IRInterpreter] Fall back to JIT with 128-bit values.
They're not that common, and falling back is definitely
better than throwing an error instead of the result. If we
feel motivated, we might end up implementing support for these,
but it's unclear whether it's worth the effort/complexity.

Fixes PR38925.

<rdar://problem/44436068>

llvm-svn: 342262
2018-09-14 18:55:31 +00:00
Jim Ingham 19a5f6202c Make the eSearchDepthFunction searches work, add tests
using the scripted breakpoint resolver.

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

llvm-svn: 342259
2018-09-14 18:41:40 +00:00
Jim Ingham e19adf5470 svn add the new files...
I started from a clean slate to do the checkin, but forgot to svn add the new files.
Do that now.

Also add the one new source file to CMakeLists.txt

llvm-svn: 342190
2018-09-13 21:59:16 +00:00
Jim Ingham 3815e702e7 Add a "scripted" breakpoint type to lldb.
This change allows you to write a new breakpoint type where the
logic for setting breakpoints is determined by a Python callback
written using the SB API's.

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

llvm-svn: 342185
2018-09-13 21:35:32 +00:00
Raphael Isemann 7f88829cea Add support for descriptions with command completions.
Summary:
This patch adds a framework for adding descriptions to the command completions we provide.
It also adds descriptions for completed top-level commands so that we can test this code.

Completions are in general supposed to be displayed alongside the completion itself. The descriptions
can be used to provide additional information about the completion to the user. Examples for descriptions
are function signatures when completing function calls in the expression command or the binary name
when providing completion for a symbol.

There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective
APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be
used), so that's why I still had to change some function signatures. Also, as the old API only passes around a
list of matches, and the descriptions are for these functions just another list, I had to add some code that
essentially just ensures that both lists are always the same side (e.g. all the manual calls to
`descriptions->AddString(X)` below a `matches->AddString(Y)` call).

The initial command descriptions that come with this patch are just reusing the existing
short help that is already added in LLDB.

An example completion with descriptions looks like this:
```
(lldb) pl
Available completions:
        platform -- Commands to manage and create platforms.
        plugin   -- Commands for managing LLDB plugins.
```

Reviewers: #lldb, jingham

Reviewed By: #lldb, jingham

Subscribers: jingham, JDevlieghere, lldb-commits

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

llvm-svn: 342181
2018-09-13 21:26:00 +00:00
George Rimar c6c7bfc4d2 [LLDB] - Improved DWARF5 support.
This patch improves the support of DWARF5.
Particularly the reporting of source code locations.

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

llvm-svn: 342153
2018-09-13 17:06:47 +00:00
Jonas Devlieghere bf2d112c15 [DWARFExpression] Read literars as unsigned values.
After landing r341457, we started seeing a failure on the swift-lldb
bots. The change was correct and pretty straightforward, a DW_OP_constu
was replaced with DW_OP_lit23, the value remaining identical.

  0x000000f4: DW_TAG_variable
		DW_AT_location    (0x00000000
		  [0x0000000100000a51,  0x0000000100000d47): DW_OP_lit23, DW_OP_stack_value)
		DW_AT_name        ("number")

However, this broke LLDB.

  (Int) number = <extracting data from value failed>

The value was read correctly, but apparently the value's type was different.
When reading a constu it was reading a uint64 (m_type = e_ulonglong) while for
the literal, it got a signed int (m_type = e_sint). This change makes sure we
read the value as an unsigned.

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

llvm-svn: 342142
2018-09-13 15:18:39 +00:00
Jason Molenda 9d0f9ced40 Commit my attempt to test the change to ProcessGDBRemote
in r336956.  This test doesn't actually test the change
that was submitted by Venkata, but it's a good one to
add.

llvm-svn: 342085
2018-09-12 21:35:02 +00:00
Raphael Isemann 10fb677285 Add a basic test for 'memory region'
Summary:
The 'memory region' command is at the moment not tested at all by our test suite.
This patch just adds a basic test that at least provides some basic testing.

Reviewers: #lldb, davide

Reviewed By: #lldb, davide

Subscribers: vsk, davide, lldb-commits

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

llvm-svn: 342042
2018-09-12 10:04:25 +00:00
Davide Italiano ae3f793e9e Rollback "Fix raw address breakpoints not resolving".
It broke a bunch of bots. Ted confirmed, but can't revert for
now so I'm reverting on his behalf.

llvm-svn: 341878
2018-09-10 23:09:09 +00:00
Ted Woodward 860bafa07d Fix raw address breakpoints not resolving
Summary: An address breakpoint of the form "b 0x1000" won't resolve if it's created while the process isn't running. This patch deletes Address::SectionWasDeleted, renames Address::SectionWasDeletedPrivate to SectionWasDeleted (and makes it public), and changes the section check in Breakpoint::ModulesChanged back to its original form

Reviewers: jingham, #lldb

Reviewed By: jingham

Subscribers: davide, lldb-commits

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

llvm-svn: 341849
2018-09-10 18:19:01 +00:00
Adrian Prantl 4954f6a565 Print column info in backtraces et al. if available
This patch allows LLDB to print column info in backtraces et al. if
available, which is useful when the backtrace contains a frame like
the following:

  f(can_crash(0), can_crash(1));

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

llvm-svn: 341506
2018-09-05 23:52:08 +00:00
Pavel Labath 89d2245a2a Ignore unicode decode errors in test suite's encoded_file class
These happen in a couple of tests when lldb tries to pretty print a
const char * variable in the inferior which points to garbage. Instead,
we have the python replace the invalid sequences with the unicode
replacement character.

llvm-svn: 341274
2018-09-01 12:15:46 +00:00
Pavel Labath 332447f4b4 Avoid using short identifiers in some tests
This applies the same workaround  as r321271 to other tests. The root
problem is that lldb finds an internal symbol with the same name in the
debug info of system libraries, and then fails to disambiguate between
the two.

llvm-svn: 341235
2018-08-31 18:25:01 +00:00
Pavel Labath 8b0853a6da XFail one more VSCode test which fails under heavy load
llvm-svn: 341186
2018-08-31 08:31:27 +00:00
Pavel Labath a95c33f600 Fix deadlock in gdb-client tests
Using a listen queue of length 0 caused a deadlock on my machine in the
gdb-client tests while attempting to establish the loopback socket
connection.

I am not sure if this is down to a different python or kernel version,
but in either case, having queue of length zero sounds like a bad idea,
so I'm bumping that to one (which also fixes the deadlock).

llvm-svn: 341096
2018-08-30 19:14:02 +00:00
Raphael Isemann 7482973411 Added initial code completion support for the `expr` command
Summary:
This patch adds initial code completion support for the `expr` command.

We now have a completion handler in the expression CommandObject that
essentially just attempts to parse the given user expression with Clang with
an attached code completion consumer. We filter and prepare the
code completions provided by Clang and send them back to the completion
API.

The current completion is limited to variables that are in the current scope.
This includes local variables and all types used by local variables. We however
don't do any completion of symbols that are not used in the local scope (or
in some other way already in the ASTContext).

This is partly because there is not yet any code that manually searches for additiona
information in the debug information. Another cause is that for some reason the existing
code for loading these additional symbols when requested by Clang doesn't seem to work.
This will be fixed in a future patch.

Reviewers: jingham, teemperor

Reviewed By: teemperor

Subscribers: labath, aprantl, JDevlieghere, friss, lldb-commits

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

llvm-svn: 341086
2018-08-30 17:29:37 +00:00
Adrian Prantl 431b158400 Support setting a breakpoint by FileSpec+Line+Column in the SBAPI.
This patch extends the SBAPI to allow for setting a breakpoint not
only at a specific line, but also at a specific (minimum) column. When
a column is specified, it will try to find an exact match or the
closest match on the same line that comes after the specified
location.

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

llvm-svn: 341078
2018-08-30 15:11:00 +00:00
Raphael Isemann 207863261c Move the column marking functionality to the Highlighter framework
Summary:
The syntax highlighting feature so far is mutually exclusive with the lldb feature
that marks the current column in the line by underlining it via an ANSI color code.
Meaning that if you enable one, the other is automatically disabled by LLDB.

This was caused by the fact that both features inserted color codes into the the
source code and were likely to interfere with each other (which would result
in a broken source code printout to the user).

This patch moves the cursor code into the highlighting framework, which provides
the same feature to the user in normal non-C source code. For any source code
that is highlighted by Clang, we now also have cursor marking for the whole token
that is under the current source location. E.g., before we underlined only the '!' in the
expression '1 != 2', but now the whole token '!=' is underlined. The same for function
calls and so on. Below you can see two examples where we before only underlined
the first character of the token, but now underline the whole token.

{F7075400}
{F7075414}

It also simplifies the DisplaySourceLines method in the SourceManager as most of
the code in there was essentially just for getting this column marker to work as
a FormatEntity.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: lldb-commits

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

llvm-svn: 341003
2018-08-30 00:09:21 +00:00
Frederic Riss ae6ca2fc3f Allow IRInterpreter to deal with non-power-of-2 sized types to support some bitfield accesses.
Summary:
For some bitfield patterns (like the one added by this commit), Clang will
generate non-regular data types like i24 or i48. This patch follows a
pretty naive approach of just bumping the type size to the next power of 2.
DataExtractor know how to deal with weird sizes. The operations on Scalar
do not know how to deal with those types though, so we have to legalize the
size when creating a Scalar.

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 340880
2018-08-28 22:50:01 +00:00
Pavel Labath 1f8639afa6 Respect platform sysroot when loading core files
Patch by Eugene Birukov <eugenebi@microsoft.com>
Differential Revision: https://reviews.llvm.org/D49685

llvm-svn: 340841
2018-08-28 16:32:46 +00:00
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
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
Adrian Prantl 315334be05 XFAIL test for older versions of dsymutil
llvm-svn: 340550
2018-08-23 17:30:56 +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
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
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
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
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
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
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
Jason Molenda 858162f972 Update TestTargetXMLArch.py test for llvm triple change with unspecified
components in r339294.

llvm-svn: 339615
2018-08-13 21:20:29 +00:00
Stella Stamenova 98b75bec71 [tests, libstdcxx] Add missing test category on the TestDataFormatterStdUniquePtr tests
Each test needs to be marked with the add_test_categories decorator individually.

llvm-svn: 339457
2018-08-10 17:52:45 +00:00
Raphael Isemann 92be39d382 Added missing null checks to fix r339351
llvm-svn: 339353
2018-08-09 15:57:43 +00:00
Raphael Isemann 879c142130 Also display the output and error output of a failed command
Summary:
Instead of just printing the current "False is not True, ..." message when we
fail to run a certain command, this patch also adds the actual command output or
error output that we received to the assertion message.

Reviewers: davide

Reviewed By: davide

Subscribers: lldb-commits

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

llvm-svn: 339351
2018-08-09 15:29:32 +00:00
Jim Ingham 7aa4ed9b5f If a function starts with line number 0, don't try to check if a breakpoint crossed function boundaries.
clang doesn't use line number 0 (to mean artifically generated code) very often, but swift does it
quite often.  We were rejecting all by line breakpoints in functions that started at line 0.  But that's
a special marker so we can just not do this test in that case.

llvm-svn: 339182
2018-08-07 21:09:55 +00:00
Greg Clayton 19c8f394bc Add support for ARM and ARM64 breakpad generated minidump files (version 2).
In this patch I add support for ARM and ARM64 break pad files. There are two flavors of ARM: Apple where FP is R7, and non Apple where FP is R11. Added minimal tests that load up ARM64 and the two flavors or ARM core files with a single thread and known register values in each register. Each register is checked for the exact value.

This is a fixed version of: https://reviews.llvm.org/D49750

The changes from D49750 are:

Don't init the m_arch in the Initialize call as a system info isn't required. This keeps the thread list, module list and other tests from failing
Added -Wextended-offsetof to Xcode project so we catch use extended usages of offsetof before submission
Fixed any extended offset of warnings

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

llvm-svn: 339032
2018-08-06 16:56:10 +00:00
Pavel Labath 659cee52fc Revert "Add support for ARM and ARM64 breakpad generated minidump files"
This reverts commit r338734 (and subsequent fixups in r338772 and
r338746), because it breaks some minidump unit tests and introduces a
lot of compiler warnings.

llvm-svn: 338828
2018-08-03 08:47:22 +00:00