Commit Graph

17040 Commits

Author SHA1 Message Date
Jonas Devlieghere 22af9c63f3 [dotest] Rename llvm-dotest -> lldb-dotest and make it a custom target
This renames llvm-dotest to lldb-dotest and makes it a custom target so
you can run `ninja lldb-dotest` to rebuild whatever is necessary before
rerunning the tests.

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

llvm-svn: 327519
2018-03-14 15:36:32 +00:00
Jonas Devlieghere 81ccb97024 [test] Disable TestMachCore everywhere except on Darwin
Apparently the parser is wrapped inside ifdef's so the logic isn't
available on non-Darwin platforms.

Should fix build bot failure:
  http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/20463

llvm-svn: 327512
2018-03-14 14:16:23 +00:00
Jonas Devlieghere 25486b7512 Update selected thread after loading mach core
The OS plugins might have updated the thread list after a core file has
been loaded. The physical thread in the core file may no longer be the
one that should be selected. Hence we should run the thread selection
logic after loading the core.

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

llvm-svn: 327501
2018-03-14 11:50:10 +00:00
Pavel Labath 10ef313678 [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)
Summary:
To make this build work, I needed to add detection code for the pthread
library. This is necessary, because we have direct calls to these
libraries (instead of going through llvm) and in the standalone build we
cannot rely on llvm to detect these for us. In a standalone non-dylib
build this was accidentaly working because these libraries were pulled
in as an interface dependency of the .a files, but in a dylib build
these are no longer part of the link interface, and so we need to add
them explicitly.

Reviewers: krytarowski, zturner

Subscribers: lldb-commits, mgorny

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

llvm-svn: 327490
2018-03-14 10:08:21 +00:00
Pavel Labath 5a48f95a0f Skip TestWatchedVarHitWhenInScope.py everywhere
The expression-hits tracking logic is not available on any platform. The
reason this tests happens to pass on some platforms is that the test is
written poorly -- it relies on the fact that post-main cleanup code will
write to the stack memory once occupied by the watched variable, but
this is not the case everywhere (e.g. linux glibc does not seem to do
this, but android's bionic library does).

llvm-svn: 327483
2018-03-14 09:13:33 +00:00
Aaron Smith 66b84079f9 [SymbolFilePDB] Rewrite ParseTypes method
Summary:
The types for the compiland's children are parsed when parsing types for a PDB compiland. Global types also need to be parsed but unfortunately PDBs do not have compiland information about each global type. So we parse them all on the first call to ParseTypes.

If a sc.function is provided then parse the types for that function. Otherwise parse the types for the overall sc.comp_unit.

The ParseTypes method can be very slow if a program has a long list of compile units containing needed modules. Debugging clang-cl with lldb will show the problem.



Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 327473
2018-03-14 04:05:27 +00:00
Vedant Kumar 48ffd5cc6e [test] Replace some references to Apple-internal bugs
This removes around 10 references to Apple-internal radars. I've filed
fresh bugs on bugs.llvm.org as appropriate for open issues.

llvm-svn: 327463
2018-03-13 23:37:11 +00:00
Jim Ingham ca38766c9c Add a missing return in SBPlatform::IsConnected and test
for the behavior - using the fact that the Host platform
is always present & connected.

llvm-svn: 327448
2018-03-13 21:06:05 +00:00
Davide Italiano 5bcb9d7211 [DataFormatter] Remove dead code for the NSDictionary formatter.
I'm going to make changes in this area soon, so I figured I
could clean things a bit while I was around.

llvm-svn: 327445
2018-03-13 20:26:38 +00:00
Pavel Labath f9841cec26 include locale.h in IOHandler.cpp
This is needed for the setlocale() call, and it seems that it is not
transitively pulled in for some build configurations.

llvm-svn: 327413
2018-03-13 15:55:00 +00:00
Pavel Labath cd3cbd4c1f Fix clang-3.8 build
clang-3.8 complains that constructor for '...' must explicitly
initialize the const member. Newer clangs and gcc seem to be fine with
this, but explicitly initializing the member does not hurt.

llvm-svn: 327380
2018-03-13 09:46:10 +00:00
Pavel Labath 01961c4b1a Fix linux s390x build (pr36694)
llvm-svn: 327379
2018-03-13 09:46:00 +00:00
Davide Italiano d5bbaa6688 [ExpressionParser] Fix crash when evaluating invalid expresssions.
Typical example, illformed comparisons (operator== where LHS and
RHS are not compatible). If a symbol matched `operator==` in any
of the object files lldb inserted a generic function declaration
in the ASTContext on which Sema operates. Maintaining the AST
context invariants is fairly tricky and sometimes resulted in
crashes inside clang (or assertions hit).

The real reason why this feature exists in the first place is
that of allowing users to do something like:
(lldb) call printf("patatino")

even if the debug informations for printf() is not available.
Eventually, we might reconsider this feature in its
entirety, but for now we can't remove it as it would break
a bunch of users. Instead, try to limit it to non-C++ symbols,
where getting the invariants right is hopefully easier.

Now you can't do in lldb anymore
(lldb) call _Zsomethingsomething(1,2,3)

but that doesn't seem to be such a big loss.

<rdar://problem/35645893>

llvm-svn: 327356
2018-03-13 01:40:00 +00:00
Davide Italiano 65c3ccc65a [lit] `llvm-mc` is now a dependency to run tests.
llvm-svn: 327350
2018-03-12 23:42:37 +00:00
Jim Ingham 08581263dc Re-add change for https://reviews.llvm.org/D42582 with added directories.
llvm-svn: 327331
2018-03-12 21:17:04 +00:00
Adrian Prantl 1cc1c5f298 Introduce a setting to disable Spotlight while running the test suite
This is a more principled approach to disabling Spotlight .dSYM
lookups while running the testsuite, most importantly it also works
for the LIT-based tests, which I overlooked in my initial fix
(renaming the test build dir to lldb-tests.noindex).

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

llvm-svn: 327330
2018-03-12 20:52:36 +00:00
Vedant Kumar d1faa56f3d Revert "Improve prologue handling to support functions with multiple entry points."
This reverts commit r327318. It breaks the Xcode and CMake Darwin
builders:

clang: error: no such file or directory:
'.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
clang: error: no input files

More details are in https://reviews.llvm.org/D42582.

llvm-svn: 327327
2018-03-12 20:35:33 +00:00
Jim Ingham 467b50057a Improve prologue handling to support functions with multiple entry points.
https://reviews.llvm.org/D42582

Patch from Leandro Lupori.

llvm-svn: 327318
2018-03-12 19:21:59 +00:00
Mandeep Singh Grang 4ccea6230b [lldb] Unbreak lldb builds due to r327219
Summary:
r327219 adds wrappers to sort which shuffle the container before sorting.
This causes lldb bots to break as the call to sort is now ambiguous:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/20725/steps/ninja%20build%20local/logs/stdio

So we need use llvm::sort instead of sort to avoid ambiguity with std::sort.

Note: This patch is just to unbreak the bots. I plan to have subsequent patches which will convert all
calls to std::sort to llvm::sort.

Reviewers: RKSimon, k8stone, jingham, labath, zturner

Subscribers: andreadb, lldb-commits

Tags: #lldb

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

llvm-svn: 327224
2018-03-10 21:13:55 +00:00
Adrian Prantl 3cd29bcfe2 Rename clang.modules-cache-path to symbols.clang-modules-cache-path
I want to extend the properties on ModuleList to also contain other
more general settings and renaming the settings category to symbols
seems to be the least bad of choices.

llvm-svn: 327193
2018-03-10 01:11:25 +00:00
Aaron Smith dee18b82c2 [SymbolFilePDB] Keep searching until the file name is found for the pdb compiland
Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 327162
2018-03-09 18:50:19 +00:00
Pavel Labath ef624fecdd Make TestCompletion work on windows
The test I added in r327110 is failing on windows because of "import
pexpect". However, this import is no longer necessary as these tests
don't use pexpect anymore.

In fact, it seems that all TestCompletion tests are passing on windows
after this, so I enable all of them.

llvm-svn: 327133
2018-03-09 14:32:16 +00:00
Pavel Labath 3ef4eebc27 [elf] Remove one copy of the section merging code
Summary:
Besides being superfluous, this double merging was actually wrong and
causing some sections to be added twice. The reason for that was that
the code assumes section IDs are unique in the section list, but this is
only true if all sections in the list come from the same object file.

Reviewers: fjricci, jankratochvil

Subscribers: emaste, lldb-commits, arichardson

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

llvm-svn: 327123
2018-03-09 12:30:09 +00:00
Pavel Labath 5f56fca4e1 Move option parsing out of the Args class
Summary:
The args class is used in plenty of places (a lot of them in the lower lldb
layers) for representing a list of arguments, and most of these places don't
care about option parsing. Moving the option parsing out of the class removes
the largest external dependency (there are a couple more, but these are in
static functions), and brings us closer to being able to move it to the
Utility module).

The new home for these functions is the Options class, which was already used
as an argument to the parse calls, so this just inverts the dependency between
the two.

The functions are themselves are mainly just copied -- the biggest functional
change I've made to them is to avoid modifying the input Args argument (getopt
likes to permute the argument vector), as it was weird to have another class
reorder the entries in Args class. So now the functions don't modify the input
arguments, and (for those where it makes sense) return a new Args vector
instead. I've also made the addition of a "fake arg0" (required for getopt
compatibility) an implementation detail rather than a part of interface.

While doing that I noticed that ParseForCompletion function was recording the
option indexes in the shuffled vector, but then the consumer was looking up the
entries in the unshuffled one. This manifested itself as us not being able to
complete "watchpoint set variable foo --" (because getopt would move "foo" to
the end). Surprisingly all other completions (e.g. "watchpoint set variable foo
--w") were not affected by this. However, I couldn't find a comprehensive test
for command argument completion, so I consolidated the existing tests and added
a bunch of new ones.

Reviewers: davide, jingham, zturner

Subscribers: lldb-commits

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

llvm-svn: 327110
2018-03-09 10:39:40 +00:00
Jason Molenda 250524f7ed I added CFLAGS etc to one part of the project file I should not have.
llvm-svn: 327097
2018-03-09 01:43:18 +00:00
Jason Molenda 4b7ea1f33c More cleanups of debugserver project file and the libpmenergy/libpmsample
stuff.  Activate it when an internal SDK is selected.  Update the name of
the LDFLAGS to match the rest of the settings.  Update the default arch for 
ios builds.

llvm-svn: 327095
2018-03-09 01:37:37 +00:00
Vedant Kumar e96dc75339 [test] Skip a test which sporadically fails in its dsym variant
There is a mailing list discussion re: r325927 about why this test fails
in the dsym variant. I've marked it skipped for now, until the issue is
resolved.

llvm-svn: 327089
2018-03-09 00:34:43 +00:00
Jason Molenda fc7321197e Remove unneeded per-arch sdk specifications from debugserver xcode project file.
llvm-svn: 327088
2018-03-09 00:32:56 +00:00
Jason Molenda c13a14ac26 Remove the explicit dependency on libpmenergy and libpmsample.
llvm-svn: 327087
2018-03-09 00:28:51 +00:00
Jason Molenda a608510b13 Fixed two more sdk inconsistencies with the pmenergy stuff.
llvm-svn: 327085
2018-03-09 00:23:29 +00:00
Jason Molenda 917f5b9944 Three little cleanups in the debugserver xcode project file.
1. Link against libpmenergy and pmsample unconditionally.  It is available on 
macOS 10.10 ("Yosemite") and newer.  We're already linking against libcompression
unconditionally which is only available on macOS 10.11 & newer.

2. Change a few "sdk=macosx.internal"'s to sdk=macosx.

3. Clean up a few places where libcompression was being enabled inconsistently.


Note: the -DLLDB_ENERGY define is only set when building against the macosx.internal
SDK; it includes a header file that is not public.  We link against the dylibs
unconditionally for simplicity.

llvm-svn: 327084
2018-03-09 00:17:22 +00:00
Vedant Kumar 45ae11cd80 [test] Skip a test when using an out-of-tree debugserver
The test "test_fp_special_purpose_register_read" in TestRegisters.py
fails on Darwin machines configured to use an out-of-tree debugserver.

The error message is: 'register read ftag' returns expected result, got
'ftag = 0x80'. This indicates that the debugserver in use is too old.

This commit introduces a decorator which can be used to skip tests which
rely on having a just-built debugserver. This resolves the issue:

$ ./bin/llvm-dotest -p TestRegisters.py -v
  1 out of 617 test suites processed - TestRegisters.py
  Test Methods:          7
  Success:               6
  Skip:                  1
...

llvm-svn: 327052
2018-03-08 19:46:39 +00:00
Pavel Labath b312b13960 Fix std unique pointer pretty-printer for new stl versions
Summary: The unique pointer layout was changed in libstdc++ 6.0.23.

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: luporl, lbianc, lldb-commits

Differential Revision: https://reviews.llvm.org/D44015
Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>.

llvm-svn: 327017
2018-03-08 16:03:09 +00:00
Pavel Labath 6bf2a8ea70 Install lldb's SB headers (pr36630)
These were removed in r309021 in what looks like an accidentally
committed change. This brings them back.

I also rename the header component to lldb-headers (instead of
lldb_headers) to match the llvm style and add a special
install-lldb-headers target, which installs just the headers.

llvm-svn: 327016
2018-03-08 15:52:46 +00:00
Pavel Labath b9923f049e [LLDB][PPC64] Fix single step and LldbGdbServer tests
Summary:
On PPC64, the tested functions were being entered through their local entry point, while the tests expected the program to stop at the function start address, that, for PPC64, corresponds to the global entry point.

To fix the issue, the test program was modified to call the functions to be tested through function pointers, which, on PPC64, force the calls through the global entry point, while not affecting the test on other platforms.

Reviewers: clayborg, labath

Reviewed By: labath

Subscribers: alexandreyy, lbianc

Differential Revision: https://reviews.llvm.org/D43768
Patch by Leandro Lupori <leandro.lupori@gmail.com>.

llvm-svn: 327013
2018-03-08 15:41:13 +00:00
Davide Italiano c0311fe19b [lldbtestsuite] llvm-objcopy is now required to run the lit tests.
There's now a test using llvm-objcopy in lit/.
This doesn't fail on the bot(s) because `llvm-objcopy` is probably
already available there, but if you get a fresh checkout and run
`ninja check-lldb` you'll observe the failure as it's not tracking
the dependency correctly. This fixes the problem on my machine,
and probably everywhere else.

llvm-svn: 326919
2018-03-07 18:06:12 +00:00
Aaron Smith 2a989f36ca [SymbolFilePDB] Add missing Char16 and Char32 types in a few places
Reviewers: zturner, rnk, lldb-commits

Subscribers: clayborg, llvm-commits

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

llvm-svn: 326875
2018-03-07 05:43:05 +00:00
Aaron Smith f76fe6825c [SymbolFilePDB] Minor cleanup
Summary:
 - Remove unused code

- Adding `break` statement conditionally

- Ignore empty strings in FindTypeByName

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326870
2018-03-07 03:16:50 +00:00
Aaron Smith a0db2eb096 [SymbolFilePDB] Add support for CVR pointer type qualifier
Summary:
- Complete element type of PDBSymbolTypeArray.

- Add a test to check types of multi-dimensional array and pointers with CVR.

Reviewers: zturner, rnk, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326859
2018-03-07 00:39:25 +00:00
Aaron Smith 7abdf2d24f [SymbolFilePDB] Get line number for PDBSymbolTypeEnum
Reviewers: zturner, lldb-commits, rnk

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 326858
2018-03-07 00:35:27 +00:00
Jason Molenda 702895989a the thread id is easier to read in base16.
llvm-svn: 326849
2018-03-06 23:33:02 +00:00
Adrian Prantl bff272faa9 Add test for lldb-mi interpreter
Test that "lldb-mi --interpreter" can interpret "target list" CLI command.

Patch by Alex Polyakov!

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

llvm-svn: 326847
2018-03-06 23:25:04 +00:00
Pavel Labath 96979ceecb Rewrite TestTargetSymbolsBuildidCase to be more focused
Summary:
The test was failing in remote debugging scenario with windows as a host
as cmd.exe is not able to parse the complicated shell commands in the
Makefile.

The test seemed like a perfect candidate for a more focused testing
approach, so I have rewritten in on top of lldb-test's module-sections
functionality. The slight gotcha there was that the
Module::GetSectionList does not include the sections from the symbol
file until someone manually calls Module::GetSymbolVendor. Normally,
this is not an issue, because someone will have initialized the symbol
vendor by the time anyone starts looking at the sections. However, when
all one this is dump the section list, we run into this problem.

I've tried making this behavior more automatic, but it turns out it's
not that easy, so for now, I just manually initialize the Symbol Vendor
before dumping out the sections in lldb-test.

Reviewers: jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 326805
2018-03-06 15:56:20 +00:00
Pavel Labath b417eeaeb5 ObjectFileMachO: split CreateSections mega-function into more manageable chunks
Summary:
In an effort to understand the function's operation, I've split it into logical
pieces. Parsing of a single segment is moved to a separate function (and the
parsing state that is carried from one segment to another is explicitly
captured in the SegmentParsingContext object). I've also extracted some pieces
of code which were already standalone (validation of the segment load command,
determining the section type, determining segment permissions) into
separate functions.

Parsing of a single section within the segment should probably also be a
separate function, but I've left that for a separate patch.

This patch is intended to be NFC.

Reviewers: clayborg, davide

Subscribers: lldb-commits

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

llvm-svn: 326791
2018-03-06 13:53:26 +00:00
Pavel Labath 408b0f53b4 HostThreadPosix::Cancel: remove android-specific implementation
Noone is calling this function on android, so we can just use the
generic llvm_unreachable "implementation".

llvm-svn: 326777
2018-03-06 12:46:05 +00:00
Pavel Labath 5e5dd70674 [LLDB][PPC64] Fixed issues with expedited registers
Summary:
- reg_nums were missing the end marker entry
- marked FP test to be skipped for ppc64

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: alexandreyy, lbianc, nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D43767
Patch by Leandro Lupori <leandro.lupori@gmail.com>

llvm-svn: 326775
2018-03-06 11:54:41 +00:00
Jason Molenda a1bd9508e0 Upstreaming avx512 register support in debugserver. These changes
were originally written by Chris Bieneman, they've undergone a
number of changes since then.

Also including the debugserver bridgeos support, another arm
environment that runs Darwin akin to ios.  These codepaths are
activated when running in a bridgeos environment which we're not
set up to test today.

There's additional (small) lldb changes to handle bridgeos binaries
that still need to be merged up.

Tested on a darwin system with avx512 hardware and without.

<rdar://problem/36424951> 

llvm-svn: 326756
2018-03-06 00:27:41 +00:00
Adrian Prantl 39e54cb7b7 LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir
llvm-svn: 326754
2018-03-05 23:57:46 +00:00
Adrian Prantl 39c71a7bcb Fix the install location of LLDBWrapPython.cpp when building
LLDB.framework to point to the build directory where it is expected by
the top-level CMakeLists.txt.

This should be a no-op in any other configurations.

rdar://problem/38005302

llvm-svn: 326743
2018-03-05 21:08:42 +00:00
Vedant Kumar 2ddfe5c9c3 [test] Skip pexpect-based lldb-mi tests on Darwin
These tests fail with a relatively frequently on Darwin machines with
errors such as:

  File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, in expect_loop
    raise EOF(str(e) + '\n' + str(self))
EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform.

The unpredictable failures make these tests noisy.

rdar://37046976

llvm-svn: 326739
2018-03-05 20:16:52 +00:00