Commit Graph

18398 Commits

Author SHA1 Message Date
Stella Stamenova c3bedd0564 [cmake] Suppress 'warning C4201: nonstandard extension used: nameless struct/union' on Windows
This warning comes up in the ObjC language plugin because of the use of nameless structs. This change suppresses the warning.

llvm-svn: 349977
2018-12-21 23:59:24 +00:00
Jonas Devlieghere 8d20cfdfc6 [NFC] Replace `compare` with (in)equality operator where applicable.
Using compare is verbose, bug prone and potentially inefficient (because
of early termination). Replace relevant call sites with the (in)equality
operator.

llvm-svn: 349972
2018-12-21 22:46:10 +00:00
Davide Italiano b429637168 [Scalar] Simplify as Jonas suggested. NFCI.
llvm-svn: 349971
2018-12-21 22:45:07 +00:00
Davide Italiano 18a0ce9813 [Scalar] Implement operator!= using operator==.
Summary: Adding some test coverage while I'm around.

Reviewers: JDevlieghere, aprantl, zturner, clayborg, jingham

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

llvm-svn: 349970
2018-12-21 22:42:00 +00:00
Jonas Devlieghere aa2dc6bfec [ExpressionParser] Reserve size before copying over args
We already know the final size here so we might as well reserve it so we
don't have to re-allocate during the loop.

llvm-svn: 349967
2018-12-21 22:16:10 +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
Greg Clayton 57577c0634 Don't duplicate the logic that detects if a section can/should be loaded (NFC)
Prior to this there were 3 places that were duplicating the logic to detect if a section can/should be loaded and some were doing things a bit differently. Now it is all centralized in one place and it is done correctly.

llvm-svn: 349926
2018-12-21 17:04:18 +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
Jonas Devlieghere 34fb64d661 Fix stack-buffer-overflow in lldb_private::Host::FindProcesses (2/2)
This fixes the second call at line 640 that I missed in r349858.

llvm-svn: 349869
2018-12-21 01:22:58 +00:00
Adrian Prantl 5255094b3e Add an assertion to aid in tracking down a bug
llvm-svn: 349865
2018-12-21 01:09:15 +00:00
Adrian Prantl 938d52538a Remove ineffective (misspelled) sanitizer option
llvm-svn: 349864
2018-12-21 01:09:14 +00:00
Adrian Prantl 33c46ca675 Fix typo
llvm-svn: 349861
2018-12-20 23:50:32 +00:00
Jonas Devlieghere 6679bc15ca Fix stack-buffer-overflow in lldb_private::Host::FindProcesses
Found by the address sanitizer on GreenDragon:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/1628/console

llvm-svn: 349858
2018-12-20 23:45:26 +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
Zachary Turner 3790029d97 [NativePDB] Create VarDecls for global variables.
Previously we would create these for local variables but not for
global variables.

Also updated existing tests which created global variables to check
for them in the resulting AST.

llvm-svn: 349854
2018-12-20 23:32:37 +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
Jonas Devlieghere 3447077a28 [API] Remove redundants get() from smart pointers. NFC
Removes redundant calls to ::get() from smart pointers in the source/API
directory..

llvm-svn: 349821
2018-12-20 21:02:55 +00:00
Jonas Devlieghere dcc8fc9e98 [dotest] Consider unexpected passes as failures.
Unexpected successes should be considered failures because they can hide
regressions when not addressed. When a test is fixed and not re-enabled,
it can easily regress without us noticing.

I couldn't find a good way to make this change other than changing it in
the unittest2 framework. I know this is less than optimal but since we
have the dependency checked in and the change is pretty fundamental to
the framework I think it's not unreasonable.

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

llvm-svn: 349818
2018-12-20 20:44:23 +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 fcf01e6e5f [lit] Skip stop-hook test on Windows
This test is now marked as unsupported on Windows - it is not technically  "unsupported" on Windows, but it fails because "expr ptr" does not evaluate correctly. However, the error message contains the expected string, so the test "passes" despite the fact that the commands failed
The following bug has been opened for it: llvm.org/pr40119

llvm-svn: 349784
2018-12-20 18:23:08 +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
Tatyana Krasnukha 36788bbb32 Replace MemoryRegionInfoSP with values and cleanup related code
Differential Revision: https://reviews.llvm.org/D55472

llvm-svn: 349766
2018-12-20 15:02:58 +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
Adrian Prantl 03bd183883 Simplify code for readability. (NFC)
llvm-svn: 349700
2018-12-19 23:48:40 +00:00
Zachary Turner 1c286430c2 Fix line endings.
llvm-svn: 349692
2018-12-19 22:50:22 +00:00
Zachary Turner 660860e659 [NativePDB] Enable function-level-linking.test in native mode.
This test passes with the native reader, so run it in both modes.

llvm-svn: 349675
2018-12-19 20:00:25 +00:00
Zachary Turner 51f88af359 [NativePDB] Fix a use after free and enable corresponding native test.
We had a use after free where we were assigning the result of a function
that returned a string to a StringRef.  After fixing this use after
free, one of the DIA PDB tests now passes with the native PDB reader,
so we enable the test under native mode as well.  The goal is to
eventually make all the tests pass under both, at which point we can
disable them all under DIA mode.

llvm-svn: 349673
2018-12-19 19:45:30 +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
Jonas Devlieghere b5c1d07920 [lit] Make TestConvenienceVariables a cpp file
The build.py script always runs the compiler in C++ mode, regardless of
the file extension. This results in mangled names presented to the
linker which in turn cannot find the printf symbol.

While we figure out how to solve this issue I've turned the source file
into a cpp file and added extern c. This should unbreak the bots.

llvm-svn: 349642
2018-12-19 17:10:21 +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
Jason Molenda 8460bb0583 Don't forget to free the libcompression scratch buffer in the dtor.
llvm-svn: 349580
2018-12-18 23:45:45 +00:00
Stella Stamenova 9efcff5602 [lit] Rather than including stdio.h, forward-declare printf in TestConvenienceVariables.test
llvm-svn: 349573
2018-12-18 23:36:35 +00:00
Jason Molenda f00cf36290 Remove the zlib CFLAGS and LDFLAGS settings from the xcode project file.
We're linking against libcompression all the time now, we don't need to
fall back to zlib.  zlib support will still be used when lldb is built on
linux et al systems, so I'm not removing any of the source support, but
when built on darwin with xcode, we'll be using libcompression.

llvm-svn: 349572
2018-12-18 23:33:42 +00:00
Zachary Turner cb67fad44a [NativePDB] Correctly reconstruct DeclContext for nested enums.
We reconstruct the AST hierarchy by trying to hack up a mangled
name for the parent type using the child type's mangled name.
This was failing for enums because their tag type is represented
with two letters ("W4") instead of one letter ("T", "U", etc) as
it is with classes, structs, and unions.  After accounting for
this we can now correctly determine when an enum is nested
inside of a namespace or a class.

llvm-svn: 349565
2018-12-18 23:12:08 +00:00
Jason Molenda 4a793c846f Force libcompression calls to be enabled when building on Darwin
systems.  It has been available in the OS over over three years
now.  If lldb doesn't link against -lcompression, it should be an
error.

Allocate a scratch buffer for libcompression to use when decoding
packets, instead of it having to allocate & free one on every call.

Fix a typeo with the size of the buffer that compression_decode_buffer()
is expanding into.

<rdar://problem/41601084> 

llvm-svn: 349563
2018-12-18 23:02:50 +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
Jason Molenda 681f6c2f55 Un-conditionalize use of libcompression. debugserver only builds
on Darwin systems and libcompression has been in the OS for over
three years. 

Remove use of / linking to zlib.  We'll always have libcompression
available now.

Create a scratch buffer via compression_encode_scratch_buffer_size()
and use it in calls to compression_encode_buffer() to avoid 
compression_encode_buffer having to malloc & free a scratch buffer
on each call.  

Tested by forcing compression to be enabled on macos native (normally
only enabled on iOS et al devices), running the testsuite.

<rdar://problem/41601084>

llvm-svn: 349553
2018-12-18 22:21:48 +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
Jonas Devlieghere 26bbd810b2 [CMake] Don't require libcxxabi on darwin
Just libcxx should suffice.

llvm-svn: 349546
2018-12-18 21:40:05 +00:00
Jonas Devlieghere deb54f1b24 [cmake] Make libcxx(abi) a dependency when building in-tree clang for macOS
As discussed on IRC this morning, when building an in-tree clang for
testing we have to have libcxx and libcxxabi checked out. This is a
common pitfall. Not only are the resulting failures non-obvious, they
only manifest when running the test suite, *after* building lldb and
clang. By making them a hard dependency (on macOS) we fail earlier with
a more useful error message.

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

llvm-svn: 349539
2018-12-18 20:59:23 +00:00