Commit Graph

16897 Commits

Author SHA1 Message Date
Aaron Smith d80372c45e [docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER
Summary:
LLDB_TEST_COMPILER is not a valid option for CMake for LLDB. There are instead two properties LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. Update the documents accordingly to reflect the correct information.


Reviewers: zturner, lldb-commits

Subscribers: llvm-commits

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

llvm-svn: 324564
2018-02-08 05:11:17 +00:00
Eugene Zemtsov 4c17d95bea Deactivate TestTargetSymbolsBuildidCase if host is windows
Makefile has unix magic and thus not working on windows.

llvm-svn: 324558
2018-02-08 03:05:47 +00:00
Aaron Smith 35cdfe2d1d Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler.
Summary:
This is a small change towards running the LLDB unit tests on Windows (still WIP).

Builds that use make do not point to specific configurations. However, builds with multiple configurations such as Visual Studio on Windows need the configuration (release/debug/etc) as part of the path so the binaries produced by clang are placed in the correct directory for the configuration.

Reviewers: zturner, lldb-commits, labath

Reviewed By: labath

Subscribers: labath, mgorny, hintonda, llvm-commits

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

llvm-svn: 324555
2018-02-08 02:13:48 +00:00
Jim Ingham 9c82180d3a Remove an errant ^S
(still can't get over those Emacs habits...)

llvm-svn: 324509
2018-02-07 20:09:13 +00:00
Jonas Devlieghere ea6fbd92d8 [test] Don't drop existing categories for methods.
The change in r324488 dropped the existing category attribute in for
instance methods. This patch corrects that.

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

llvm-svn: 324492
2018-02-07 17:34:46 +00:00
Jonas Devlieghere 466396592d [test] Enable setting category for inline tests.
Inlined tests have a test function that is actually an instance method,
which requires a slightly different approach when it comes to setting
the category attribute. The attribute must be set on the actual
function, rather than on a particular instance.

llvm-svn: 324488
2018-02-07 16:10:59 +00:00
Pavel Labath 986b39b61f Remove function DW_DSC_value_to_name
It is unused, and the underlying llvm function has been removed as well.

llvm-svn: 324472
2018-02-07 11:13:21 +00:00
Jason Molenda fd443e9b6c lldb running on an ios device is using the _dyld_get_all_image_infos()
SPI call to to find its own shared cache's UUID.  On newer sytems we 
need to use the a new SPI which will return the UUID directly.

<rdar://problem/36625871> 

llvm-svn: 324437
2018-02-07 01:28:29 +00:00
Adrian Prantl f5ffbdbde0 Remove obsolete file
llvm-svn: 324400
2018-02-06 21:04:06 +00:00
Adrian Prantl dc797c0b55 Pass --build-dir to dotest in the Xcode project
llvm-svn: 324396
2018-02-06 20:48:35 +00:00
Eugene Zemtsov 9e916e5e0e More correct handling of error cases C++ name parser
Now incorrect type argument that looks like T<A><B> doesn't
cause an assert, but just a parsing error.

Bug: 36224
Differential Revision: https://reviews.llvm.org/D42939

llvm-svn: 324380
2018-02-06 19:04:12 +00:00
Adrian Prantl 332351d9b9 Build each testcase variant in its own subdirectory and remove the srcdir lock file
This patch creates a <test>.dwarf, <test>.dwo, etc., build directory for each testcase variant.
Most importantly, this eliminates the need for the per-test lock file in the source directory.

Tests that are marked as NO_DEBUG_INFO_TESTCASE and build with
buildDefault() are built in a <test>.default build directory.

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

llvm-svn: 324368
2018-02-06 18:22:51 +00:00
Davide Italiano d9a97a20c0 [testsuite] Skip a flakey test.
llvm-svn: 324293
2018-02-05 23:51:57 +00:00
Eugene Zemtsov 40ddcb8133 Disable test_restart_bug failing on Android
llvm-svn: 324288
2018-02-05 23:31:58 +00:00
Jason Molenda 8c0d106f5d Fix the cputype comparison in GDBRemoteCommunicationServerCommon::Handle_qHostInfo
to use Mach-O cpu types instead of the ArchSpec enum value, and handle the case
of bridgeos.

llvm-svn: 324287
2018-02-05 23:10:51 +00:00
Adrian Prantl 74bd5eb067 CMake: fix build directory name in clean rule
llvm-svn: 324281
2018-02-05 22:35:46 +00:00
Davide Italiano e3693a3e50 [lang/Objc] UNXFAIL a test. Nullability has been implemented in clang.
(a while ago).

<rdar://problem/20416388>

llvm-svn: 324280
2018-02-05 22:31:59 +00:00
Jan Kratochvil 50397237d9 refactor: DWARFCompileUnit::Producer -> DWARFProducer
Differential revision: https://reviews.llvm.org/D42891

llvm-svn: 324275
2018-02-05 21:50:01 +00:00
Pavel Labath bca95f8acc Add a comment explaining how the input for GetModuleSpecifications_EarlySectionHeaders was generated
Davide pointed out this would be useful if the file ever needs to be
regenerated (and I certainly agree).

I also replace the test binary with a slightly smaller one -- I intended
to do this in the original commit, but I forgot to add it to the patch
as I was juggling several things at the same time.

llvm-svn: 324256
2018-02-05 18:03:02 +00:00
Pavel Labath 4f0331251f Fix parsing of object files with "early" section headers
ObjectFileELF::GetModuleSpecifications contained a lot of tip-toing code
which was trying to avoid loading the full object file into memory. It
did this by trying to load data only up to the offset if was accessing.
However, in practice this was useless, as 99% of object files we
encounter have section headers at the end, so we would load the whole
file as soon as we start parsing the section headers.

In fact, this would break as soon as we encounter a file which does
*not* have section headers at the end (yaml2obj produces these), as the
access to .strtab (which we need to get the section names) was not
guarded by this offset check.

As this strategy was completely ineffective anyway, I do not attempt to
proliferate it further by guarding the .strtab accesses. Instead I just
lead the full file as soon as we are reasonably sure that we are indeed
processing an elf file.

If we really care about the load size here, we would need to reimplement
this to just load the bits of the object file we need, instead of
loading everything from the start of the object file to the given
offset. However, given that the OS will do this for us for free when
using mmap, I think think this is really necessary.

For testing this I check a (tiny) SO file instead of yaml2obj-ing it
because the fact that they come out first is an implementation detail of
yaml2obj that can change in the future.

llvm-svn: 324254
2018-02-05 17:25:40 +00:00
Kamil Rytarowski eb175a00ab Sync PlatformNetBSD.cpp with Linux
Summary:
Various changes in logging from log->Printf() to generic LLDB_LOG().

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: llvm-commits, lldb-commits

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

llvm-svn: 324251
2018-02-05 17:12:23 +00:00
Pavel Labath bcf201a843 Skip TestTargetSymbolsSepDebugSymlink on remote targets
Currently, our behavior when installing symlinks on the remote target is
broken (pr36237).

llvm-svn: 324236
2018-02-05 14:07:44 +00:00
Kamil Rytarowski 8a4bf06ba9 Fix a crash in *NetBSD::Factory::Launch
Summary:
We cannot call process_up->SetState() inside
the NativeProcessNetBSD::Factory::Launch
function because it triggers a NULL pointer
deference.

The generic code for launching a process in:
GDBRemoteCommunicationServerLLGS::LaunchProcess
sets the m_debugged_process_up pointer after
a successful call to  m_process_factory.Launch().
If we attempt to call process_up->SetState()
inside a platform specific Launch function we
end up dereferencing a NULL pointer in
NativeProcessProtocol::GetCurrentThreadID().

Use the proper call process_up->SetState(,false)
that sets notify_delegates to false.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: lldb-commits

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

llvm-svn: 324234
2018-02-05 13:16:22 +00:00
Pavel Labath 5bc157443e TestLinuxCore -- add a check for thread name
We've had a bug (fixed by https://reviews.llvm.org/D42828) where the
thread name was being read incorrectly. Add a test for this behavior.

llvm-svn: 324230
2018-02-05 12:34:09 +00:00
Jonas Devlieghere f176aa1c75 [test] Un-XFAIL TestRaise.RaiseTestCase.test_restart_bug
This test was marked as an expected failure because of PR20231 but it
seems to consistently result in an unexpected success across the bots.
Let's try to re-enable this test again.

llvm-svn: 324227
2018-02-05 11:39:04 +00:00
Pavel Labath 55790fb7f8 [dotest] make debug info variant accessible in setUp()
Summary:
This changes the way we store the debug info variant to make it
available earlier in the test bringup: instead of it being set by the
test wrapper method, it is set as a *property* of the wrapper method.

This way, we can inspect it as soon as self.testMethodName is
initialized. The retrieval is implemented by a new function
TestBase.getDebugInfo(), and all that's necessary to make it work is to
change self.debug_info into self.getDebugInfo().

While searching for debug_info occurences i noticed that TestLogging is
being replicated for no good reason, so I removed the replication there.

Reviewers: aprantl, jingham

Subscribers: eraman, JDevlieghere, lldb-commits

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

llvm-svn: 324226
2018-02-05 11:30:46 +00:00
Jan Kratochvil 401df58064 Resolve binary symlinks before finding its separate .debug file
I have found LLDB cannot find separate debug info of Fedora /usr/bin/gdb.
It is because:

lrwxrwxrwx 1 root root       14 Jan 25 20:41 /usr/bin/gdb -> ../libexec/gdb*
-rwxr-xr-x 1 root root 10180296 Jan 25 20:41 /usr/libexec/gdb*
ls: cannot access '/usr/lib/debug/usr/bin/gdb-8.0.1-35.fc27.x86_64.debug': No such file or directory
-r--r--r-- 1 root root 29200464 Jan 25 20:41 /usr/lib/debug/usr/libexec/gdb-8.0.1-35.fc27.x86_64.debug

FYI that -8.0.1-35.fc27.x86_64.debug may look confusing, it was always just
.debug before.
Why is /usr/bin/gdb a symlink is offtopic for this bugreport, Fedora has it so
for some reasons.

It is always safest to look at the .debug file only after resolving all
symlinks on the binary file.

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

llvm-svn: 324224
2018-02-05 10:50:38 +00:00
Jan Kratochvil 4fc027105a Fix upper->lower case for /usr/lib/debug/.build-id/**.debug
I have found the lookup by build-id
(when lookup by /usr/lib/debug/path/name/exec.debug failed) does not work as
LLDB tries the build-id hex string in uppercase but Fedora uses lowercase.

xubuntu-16.10 also uses lowercase during my test:
/usr/lib/debug/.build-id/6c/61f3566329f43d03f812ae7057e9e7391b5ff6.debug

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

llvm-svn: 324222
2018-02-05 10:46:56 +00:00
Jason Molenda 35eb6c856a Turn off the deprecated ALWAYS_SEARCH_USER_PATHS feature
in debugserver.  This is already set this way in the lldb
project files but not in debugserver.  Updating for
consistency.

llvm-svn: 324158
2018-02-03 00:37:46 +00:00
Jason Molenda 37713073d6 Fix a copy of a fixed length, possibly non-nul terminated, string
into a std::string so we don't run off the end of the array when
there is no nul byte in ProcessElfCore::parseLinuxNotes.  
Found with ASAN testing.

<rdar://problem/37134319> 

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

llvm-svn: 324156
2018-02-02 22:48:45 +00:00
Jim Ingham 40207d5064 Add the ability to restrict the breakpoint to a module
for run_to_{source,name}_breakpoint.

llvm-svn: 324119
2018-02-02 18:39:25 +00:00
Adrian Prantl 34769d80dd Use an alternative approach to prevent Spotlight from indexing the build directory.
llvm-svn: 324115
2018-02-02 18:32:29 +00:00
Adrian Prantl e885768640 Create a marker for Spotlight to never index $BUILD_DIR.
LLDB queries Spotlight to locate .dSYM bundles based on the UUID
embedded in a binary, and because the UUID is a hash of filename and
.text section, there *will* be conflicts inside $BUILD_DIR.

This should fix the broken green dragon bots.

llvm-svn: 324019
2018-02-01 22:18:02 +00:00
Han Ming Ong 017edbddeb Make use of physical footprint as memory measurement.
Remove obsolete measurements.

This check in requires at least 10.11

Reviewed: Jason Molenda, Jim Ingham

<rdar://problem/37047106> Xcode Memory gauge should show the jetsam ledger footprint rather than anonymous

llvm-svn: 324013
2018-02-01 21:46:40 +00:00
Jim Ingham 0423fcac39 Added lldbutil.run_to_name_breakpoint and use it in one test.
Using the "run_to_{source,name}_breakpoint will allow us to remove
a lot of boiler-plate from the testsuite.  We mostly use source
breakpoints, but some tests use by name ones so this was needed.

llvm-svn: 324010
2018-02-01 21:35:50 +00:00
Jim Ingham 1765028d3c Remove unused Args variable, and #include of Args.h. NFC.
llvm-svn: 324008
2018-02-01 21:31:14 +00:00
Pavel Labath 7ae53e8c70 Extend windows->android XFAIL on TestLoadUnload
This fails regardless of the android architecture or compiler used. The
important bit is the mismatch in path separators.

llvm-svn: 323974
2018-02-01 15:35:55 +00:00
Pavel Labath 71ad71e530 mock_gdb_server: rectify ack handling code
The mock server was sending acks back in response to spurious acks from
the client, but the client was not prepared to handle these. Most of the
time this would work because the only time the client was sending
unsolicited acks is after the initial connection, and there reply-ack
would get ignored in the "flush all packets from the server" loop which
came after the ack. However, this loop had only a 10ms delay, and
sometimes this was not enough to catch the reply (which meant the
connection got out of sync, and test failed).

Since this behavior not consistent with how lldb-server handles this
situation (it just ignores the ack), I fix the mock server to do the
same.

llvm-svn: 323953
2018-02-01 11:29:06 +00:00
Adrian Prantl 7faa9dac84 replace os.mkdirs with lldbutil.mkdir_p (NFC)
llvm-svn: 323917
2018-01-31 21:39:00 +00:00
Pavel Labath f53288d596 Fix TestMixedDwarfBinary.py
As of yesterday, tests need to use self.getBuildArtifact() to get the
built executable.

llvm-svn: 323884
2018-01-31 16:23:24 +00:00
Davide Italiano 98f0021dd3 [lldb] Enable debugging of binaries with mixed (splitted/regular) dwarf
This recommits the patch, now that I verified that the bot instability
is due to something else. Sorry for the noise.

llvm-svn: 323879
2018-01-31 15:17:47 +00:00
Pavel Labath 73d8778437 Fix TestTargetSymbolsAddCommand makefile
We started passing the "all" target to make, which rendered the
"localall" trick in this Makefile inoperable.

I implement the strip step differently, and also reformat the Makefile.

llvm-svn: 323855
2018-01-31 09:14:12 +00:00
Davide Italiano 910f0a06c9 Revert "[lldb] Enable debugging of binaries with mixed (splitted/regular) dwarf"
It might have caused some instability on the bots.

llvm-svn: 323845
2018-01-31 04:13:37 +00:00
Alexander Shaposhnikov 2aea8f9787 [lldb] Enable debugging of binaries with mixed (splitted/regular) dwarf
Initialize the default value of SymbolFileDWARF uuid with 
the appropriately shifted DW_INVALID_OFFSET constant.
This change fixes the collision in the computation of DIE uid 
(inside DIERef::GetUID) and incorrect CompileUnit lookup
(because of the misleading cu_offset value).

Test plan: make check-lldb

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

llvm-svn: 323832
2018-01-30 23:45:20 +00:00
Adrian Prantl dbdda6a1e7 Enforce that NO_DEBUG_INFO_TESTCASEs build using buildDefault().
This is a prerequisite for building each test variant in its own subdirectory.

llvm-svn: 323830
2018-01-30 23:15:49 +00:00
Vedant Kumar e2fbd7035d XUnit Formatter: Handle UTF-8 decode errors on invalid XML
Strings which contain garbage data can trigger an exception in the XUnit
plugin at the UTF-8 decode step because the decode is strict. Use a lax
mode to avoid an exception.

See: https://ci.swift.org/job/oss-lldb-incremental-osx/780
llvm-svn: 323817
2018-01-30 21:16:42 +00:00
Vedant Kumar 61a29ded5d PR25934: Skip EventAPITestCase. It still SEGV's on Darwin.
See: https://ci.swift.org/job/swift-lldb-PR-osx/39

llvm.org/PR25934

llvm-svn: 323809
2018-01-30 19:49:05 +00:00
Adrian Prantl ee2d2bfbcd Add more diagnostics to help diagnose flaky test
llvm-svn: 323808
2018-01-30 19:40:09 +00:00
Jim Ingham 34b58a0ae4 Rewrite this test not to use pexpect.
llvm-svn: 323805
2018-01-30 18:43:31 +00:00
Adrian Prantl 5ec76fe720 Compile the LLDB tests out-of-tree.
This patch is the result of a discussion on lldb-dev, see
http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for
background.

For each test (should be eventually: each test configuration) a
separate build directory is created and we execute

  make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test

In order to make this work all LLDB tests need to be updated to find
the executable in the test build directory, since CWD still points at
the test's source directory, which is a requirement for unittest2.

Although we have done extensive testing, I'm expecting that this first
attempt will break a few bots. Please DO NOT HESITATE TO REVERT this
patch in order to get the bots green again. We will likely have to
iterate on this some more.

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

llvm-svn: 323803
2018-01-30 18:29:16 +00:00