Commit Graph

1029 Commits

Author SHA1 Message Date
Chris Bieneman 7ba5581b84 [Test Suite] Allow overriding codesign identity
Summary: Not everyone names their code sign identity "lldb_codesign", so it is nice to allow this to be overridden.

Reviewers: zturner, tfiala

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 284893
2016-10-21 22:13:55 +00:00
Tamas Berghammer d161b2147b Add data formatter for libstdc++ unique_ptr
Differential revision: https://reviews.llvm.org/D25734

llvm-svn: 284830
2016-10-21 15:02:44 +00:00
Tamas Berghammer 7f15dba16d Add data formatter for libstdc++ tuple
Differential revision: https://reviews.llvm.org/D25733

llvm-svn: 284829
2016-10-21 15:02:38 +00:00
Tamas Berghammer 0789722d85 Improve the libstdc++ smart pointer formatters
* Display the strong/weak count in the summary
* Display the pointed object as a synthetic member
* Create synthetic children for weak/strong count

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

llvm-svn: 284828
2016-10-21 15:02:32 +00:00
Pavel Labath eb01a169c2 Add TestMultipleHits.py
This tests that lldb handles the situation when a single instruction triggers
multiple watchpoint hits. It currently fails on arm due to what appears to be a
lldb-server bug (pr30758).

llvm-svn: 284819
2016-10-21 11:14:04 +00:00
Pavel Labath 2e8fe80447 Revert "Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands."
This reverts commit r284795, as it breaks watchpoint handling on arm (and
presumable all architectures that report watchpoint hits without executing the
tripping instruction).

There seems to be something fundamentally wrong with this patch: it uses
process_sp->AddPreResumeAction to re-enable the watchpoint, but the whole point
of the step-over-watchpoint logic (which AFAIK is the only user of this class) is
to disable the watchpoint *after* we resume to do the single step.

I have no idea how to fix this except by reverting the offending patch.

llvm-svn: 284817
2016-10-21 10:52:11 +00:00
Jim Ingham 94bd575c73 Fix a race condition between "ephemeral watchpoint disable/enable" and continue in commands.
Also, watchpoint commands, like breakpoint commands, need to run in async mode.

This was causing intermittent failures in TestWatchpointCommandPython.py, which is now solid.

llvm-svn: 284795
2016-10-21 00:06:38 +00:00
Jim Ingham 1d9284c3bc Remove an unnecessary and incorrect check for num locations of a breakpoint
by grubbing the break list output.  If you pass a number of locations into
the run_break_* functions, they will check that this is right for you.

llvm-svn: 284791
2016-10-20 22:49:06 +00:00
Chris Bieneman 53a7844383 Re-landing a cleaned up implementation of r284550
This time it should actually work. The previous implementaiton was not
getting the linker or compiler flag set correctly in all the right
situations. By moving the check down and basing it of whether or not CXX
is set I we can have the logic to add the flags exist only once for the
linker and once for the compiler instead of duplicating it.

llvm-svn: 284756
2016-10-20 18:01:19 +00:00
Omair Javaid 05ac4c445c Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints
This patch fixes ARM/AArch64 watchpoint bug which was taking inferior out of control while stepping over watchpoints.
Also adds a test case that tests above problem.

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

llvm-svn: 284706
2016-10-20 09:07:26 +00:00
Sean Callanan 7ef7b449a0 Added a decorator for the macOS version and switched over testcases that used platform.release
llvm-svn: 284674
2016-10-20 00:03:39 +00:00
Chris Bieneman e0dcd6d7f4 Revert back to the state before r284550
This patch is causing a lot of issues on bots that I didn't see in local testing. I'm going to have to work on this. Reverting for now while I sort it out.

llvm-svn: 284565
2016-10-19 02:44:20 +00:00
Chris Bieneman 716ac7684c Trying to fix a few more missing LDFLAGS.
llvm-svn: 284564
2016-10-19 02:31:31 +00:00
Chris Bieneman 87378bd21e Fixing the linux bots I broke in r284550
Need to gate cxx linker adding driver-mode flag based on the linker being clang.

llvm-svn: 284555
2016-10-19 00:13:56 +00:00
Chris Bieneman e80f007dfb Use clang --driver-mode instead of guessing c++ compiler path
Summary:
When building the LLDB test programs, if your CC is clang it actually isn't safe to make CXX a string replace of "clang -> clang++". This falls down on unix configurations if your compiler is clang-${version}.

A safer approach is to use the "--driver-mode=g++" option to tell clang to act like clang++.

Reviewers: tfiala, zturner, labath

Subscribers: lldb-commits

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

llvm-svn: 284550
2016-10-18 23:53:24 +00:00
Todd Fiala af6ff2a91b xfail TestMiSyntax.py's test_lldbmi_output_grammar on macOS
Needs to be investigated.  This is failing locally and on the
Xcode CI.

rdar://28805064

llvm-svn: 284484
2016-10-18 15:15:24 +00:00
Jim Ingham 8d50e0c26e Remove a debug print statement.
llvm-svn: 284448
2016-10-18 01:52:32 +00:00
Jim Ingham a7d25264eb More testsuite xfail markings cleanup.
llvm-svn: 284446
2016-10-18 01:43:22 +00:00
Jim Ingham 981da8d37b Fix a crash in expressions with fixits in the dummy target.
In the expression command, if the target is NULL, you have to use the dummy
target.

<rdar://problem/28811687>

llvm-svn: 284439
2016-10-17 23:59:41 +00:00
Jim Ingham 4b4e705b67 This test is no longer failing for gmodules.
llvm-svn: 284296
2016-10-15 00:04:38 +00:00
Jim Ingham f70847deef This test passes on i386 now.
llvm-svn: 284183
2016-10-14 01:11:19 +00:00
Jim Ingham f5afb8bd80 This test is passing on i386 now.
llvm-svn: 284182
2016-10-14 01:03:03 +00:00
Chris Bieneman 47df0196b8 Use LLDB_SRC for relative paths
Summary:
Going from LLDB_SRC instead of the file path is safer when looking for compiler-rt. Also need to add support for looking inside the LLVM runtimes subdirectory.

Eventually we should just get CMake to provide these paths during configuration.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284045
2016-10-12 20:24:42 +00:00
Chris Bieneman c6667075b3 Fix test suite lookup path for LLDB.h
Summary:
When running on Darwin, the test suite assumes a specific directory structure for the build directory. This works for the Xcode project builds, but fails for CMake builds regardless of whether or not you are generating the LLDB framework.

This patch allows the Darwin code path to fall back to the more generic code path used by other platforms in the event that LLDB.h isn't where the test suite expects it.

This allows API tests to run on Darwin when building with CMake with the framework build enabled or disabled.

Reviewers: tfiala, zturner

Subscribers: labath, lldb-commits

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

llvm-svn: 284043
2016-10-12 20:22:02 +00:00
Chris Bieneman 4c63acc39e Fix building tests without system headers on Darwin
Summary: Default installations of OS X do not have system headers installed at /usr/include. This patch allows the LLDB test executables to properly compile when built on a system without headers at /usr/include by specifying a default value for the apple-sdk flag as "macosx".

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 284042
2016-10-12 20:19:19 +00:00
Chris Bieneman 35e5457e0c Fix lookup path for lldb-mi
Summary:
The test suite calls realpath on the lldb executable then append "-mi" to it to find the path of the lldb-mi executable. This does not work when using CMake builds on *nix platforms. On *nix platforms when a version number is set on executables CMake generates the binary as ${name}-${version} with a symlink named ${name} pointing to it.

This results in the lldb executable being named lldb-4.0.0, and since lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always disabled.

This patch looks for lldb-mi in the same directory as lldb.

Reviewers: zturner, tfiala

Subscribers: ki.stfu, enlight, lldb-commits

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

llvm-svn: 284041
2016-10-12 20:15:46 +00:00
Jim Ingham 569bc27843 This test now passes.
llvm-svn: 283959
2016-10-12 00:05:36 +00:00
Jim Ingham 5afd6f7b2e This was skipped due to a clang PR that has been fixed.
llvm-svn: 283957
2016-10-11 23:55:13 +00:00
Jim Ingham 6aa9d1d756 Added a radar on our end for this test's failure.
llvm-svn: 283956
2016-10-11 23:30:38 +00:00
Jim Ingham 7d84aff200 Add the radar number on our end.
llvm-svn: 283940
2016-10-11 21:08:27 +00:00
Jim Ingham 2aa6ef7567 This test now passes.
llvm-svn: 283929
2016-10-11 20:09:40 +00:00
Jim Ingham e8be3ad9b2 Added a bugreport tracking the failure to get float return values
on i386.

llvm-svn: 283923
2016-10-11 19:29:25 +00:00
Jim Ingham 8e7fe2c741 Fixing the bug number for darwin on this failure.
llvm-svn: 283843
2016-10-11 01:53:43 +00:00
Jim Ingham bc3236ba20 This test was failing because /bin/ls is no longer debuggable on OS X.
Add an executable that we can debug.

llvm-svn: 283835
2016-10-11 00:35:41 +00:00
Jim Ingham dfaf9ccacf Adding radar number on our end for llvm.org/pr15824.
llvm-svn: 283821
2016-10-10 23:31:36 +00:00
Jim Ingham 43f5e983b3 Add the related radar on our end for llvm.org/pr15824.
llvm-svn: 283820
2016-10-10 23:29:01 +00:00
Jim Ingham 400892bd48 Add the radar number on our end.
llvm-svn: 283813
2016-10-10 22:21:47 +00:00
Nitesh Jain 2e2c24d2b2 [LLDB][MIPS] All tests get errors in dotest after this test.
Subscribers: jaydeep, bhushan, slthakur, llvm-commits
llvm-svn: 283739
2016-10-10 10:47:53 +00:00
Nitesh Jain a9b79e666c [LLDB][MIPS] Skip some test case which were causing LLDB to go into infinite loop
Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, slthakur, llvm-commits

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

llvm-svn: 283732
2016-10-10 10:02:09 +00:00
Jim Ingham 9aa53a8ced The PR that caused this test ot fail was fixed in July, removing the XFAIL.
llvm-svn: 283578
2016-10-07 18:15:11 +00:00
Todd Fiala 4c1ed9d3ca disable TSAN tests on macOS i386
These are erroring out on macOS i386.

Tracked by:
rdar://28659145

llvm-svn: 283497
2016-10-06 21:30:33 +00:00
Todd Fiala 60fb35b20a xfail TestReportData.py on i386
Tracked by:
rdar://28658860

llvm-svn: 283493
2016-10-06 21:16:37 +00:00
Todd Fiala 8e2208b237 xfail TestQueues on macOS
This test is failing on CI.  I cannot get it to fail on my
local setup.

Tracked by:
rdar://28658529

llvm-svn: 283492
2016-10-06 21:07:45 +00:00
Todd Fiala 83380c2a00 xfail TestSBTypeTypeClass.py on macOS i386
Tracked by:
rdar://28656677

llvm-svn: 283484
2016-10-06 19:23:29 +00:00
Todd Fiala 396bbe3cf5 xfail TestDataFormatterNSIndexPath.py on macOS i386
Tracked by:
rdar://28656605

llvm-svn: 283483
2016-10-06 19:18:48 +00:00
Todd Fiala 50d328b282 xfail TestExec.py on macOS i386
Tracked by:
rdar://28656532

llvm-svn: 283482
2016-10-06 19:12:05 +00:00
Todd Fiala b801095087 xfail TestDiagnoseDereferenceFunctionReturn.py on macOS i386
Tracked by:
rdar://28656408

llvm-svn: 283481
2016-10-06 19:04:58 +00:00
Todd Fiala 81f508012c xfail TestDarwinLogBasic.py for i386 macOS
Tracked by:
rdar://28655626

llvm-svn: 283477
2016-10-06 18:25:54 +00:00
Valentina Giusti 6f8c1f8da7 Add bound violation handling for Intel(R) Memory Protection Extensions (Intel(R) MPX)
Summary:
This patch adds support for handling the SIGSEGV signal with 'si_code ==
SEGV_BNDERR', which is thrown when a bound violation is caught by the
Intel(R) MPX technology.

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

llvm-svn: 283474
2016-10-06 18:05:12 +00:00
Jim Ingham f4b9659e7c These test cases don't test different debug info formats.
llvm-svn: 283468
2016-10-06 17:01:00 +00:00
Valentina Giusti 0670ad14f8 Improve test for Intel(R) MPX registers.
Summary:
Let the inferior test code determine if CPU and kernel support Intel(R)
MPX and cleanup test script.

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

llvm-svn: 283461
2016-10-06 15:49:10 +00:00
Zachary Turner 9c69bc9776 Fixup the xfail situation on Windows.
Xfails added and/or removed to reflect the current state of Windows.

llvm-svn: 283380
2016-10-05 20:47:17 +00:00
Dimitar Vlahovski 36e21a3d56 Removing the new Minidump plugin
Tests are failing and build is failing on windows and darwin.
Will fix and commit it later
-------------------------------------------------------------

Revert "xfailing minidump tests again ... :("
This reverts commit 97eade002c9e43c1e0d11475a4888083a8965044.

Revert "Fixing new Minidump plugin tests"
This reverts commit 0dd93b3ab39c8288696001dd50b9a093b813b09c.

Revert "Add the new minidump files to the Xcode project."
This reverts commit 2f638a1d046b8a88e61e212220edc40aecd2ce44.

Revert "xfailing tests for Minidump plugin"
This reverts commit 99311c0b22338a83e6a00c4fbddfd3577914c003.

Revert "Adding a new Minidump post-mortem debugging plugin"
This reverts commit b09a7e4dae231663095a84dac4be3da00b03a021.

llvm-svn: 283352
2016-10-05 18:11:45 +00:00
Dimitar Vlahovski 9078e15aba xfailing minidump tests again ... :(
llvm-svn: 283324
2016-10-05 15:00:29 +00:00
Dimitar Vlahovski c5a4269def Fixing new Minidump plugin tests
llvm-svn: 283321
2016-10-05 14:35:30 +00:00
Jim Ingham 9ff9713f8a The collision of class C and libsystem_c.dylib:C is a failure
worth preserving, but not essential to the purpose of this test
so I broke it into a separate test.

llvm-svn: 283289
2016-10-05 01:19:15 +00:00
Jim Ingham f5fe75a6e0 This test is failing because there's a global symbol "C" in libsystem_c.dylib,
and that is defeating the lookup of the "struct C" here.  Adding the bug for that.

llvm-svn: 283287
2016-10-05 01:09:43 +00:00
Dimitar Vlahovski e7439392f1 xfailing tests for Minidump plugin
the tests are failing on the buildbot because there is an extra frame
(maybe) on the call stack.
Will investigate tomorrow.

llvm-svn: 283263
2016-10-04 21:55:47 +00:00
Tamas Berghammer d69faef383 Fix the decorator of TestBreakpointCaseSensitivity
llvm-svn: 283262
2016-10-04 21:32:46 +00:00
Dimitar Vlahovski 8cabfb764d Adding a new Minidump post-mortem debugging plugin
Summary:
This plugin resembles the already existing Windows-only Minidump plugin.
The WinMinidumpPlugin uses the Windows API for parsing Minidumps
while this plugin is cross-platform because it includes a Minidump
parser (which is already commited)

It is able to produce a backtrace, to read the general puprose regiters,
inspect local variables, show image list, do memory reads, etc.

For now the only arch that this supports is x86 64 bit
This is because I have only written a register context for that arch.
Others will come in next CLs.

I copied the WinMinidump tests and adapted them a little bit for them to
work with the new plugin (and they pass)
I will add more tests, aiming for better code coverage.

There is still functionality to be added, see TODOs in code.

Reviewers: labath, zturner

Subscribers: beanz, mgorny, amccarth, lldb-commits, modocache

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

llvm-svn: 283259
2016-10-04 21:02:13 +00:00
Francis Ricci f833f173fb Improvements to testing blacklist
Summary:
This patch is necessary because individual test cases are not required
to have unique names. Therefore, test cases must now
be specified explicitly in the form <TestCase>.<TestMethod>.
Because it works by regex matching, passing just <TestCase> will
still disable an entire file.

This also allows for multiple exclusion files to be specified.

Reviewers: zturner, labath, jingham, tfiala

Subscribers: lldb-commits, sas

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

llvm-svn: 283238
2016-10-04 18:48:00 +00:00
Pavel Labath 9b13b5a1d9 Fix test when using remote debugging.
Summary:
Use os.getcwd() instead of get_process_working_directory() as prefix for
souce file.

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 283171
2016-10-04 00:32:20 +00:00
Todd Fiala 44761a6e47 add a simple test case to validate test id()
Since we count on it in a few places, the test verifies that the
test instance has an id() method that returns something non-None.

llvm-svn: 283156
2016-10-03 22:49:13 +00:00
Pavel Labath 6b582bf91f Revert "XFAIL TestSBData for gcc-4.9 i386"
Test fixed.

llvm-svn: 283069
2016-10-02 15:56:33 +00:00
Jim Ingham a479026012 Fix up this test case.
The lldbutil.run_break_set_by_file_and_line has already checked that the number of 
locations was 1, so don't check it again.  And certainly don't check it again by 
grubbing in break list output.

Also, we know the Thread's IsStopped state is wrong, and have a test for that, so 
don't keep testing it in other files where that isn't the primary thing we're testing.

I removed the xfail for Darwin.  If this also passes on other systems, we can remove
the xfails from them as we find that out.

llvm-svn: 282993
2016-10-01 00:49:12 +00:00
Todd Fiala 8cc2bddb32 test infra: clear file-charged issues on rerun of file
This change addresses the corner case bug in the test
infrastructure where a test file times out *outside*
of any running test method.  In those cases, the issue
was charged to the file, not to a test method within
the file.  When that file is re-run successfully,
none of the test-method-level successes would clear
the file-level issue.

This change fixes that: for all test files that are
getting rerun (whether by being marked flaky or
via the --rerun-all-issues flag), file-level test
issues are searched for in each of those files.  Each
file-level issue found in the rerun file list then
gets cleared.

A test of this feature is added to issue_verification,
using the technique there of moving the *.py.park file
to *.py to do an end-to-end validation.

This change also adds a .gitignore entry for pyenv
project-level files and fixes up a few minor pep8
formatting violations in files I touched.

Fixes:
llvm.org/pr27423

llvm-svn: 282990
2016-10-01 00:17:08 +00:00
Jim Ingham 57ec60a842 Fix up the test so it gets closer to passing.
Remove the test for thread stopped states from this test.  
That isn't set properly now, and its setting doesn't matter till we actually support non-stop debugging, so
we shouldn't have unrelated tests failing from it.

Also changed some code that was trying and failing to grub command line output, and replaced
it by SB API calls.

llvm-svn: 282976
2016-09-30 22:55:57 +00:00
Jim Ingham fad073a6ab Add the radar on our end to the bugreport string.
llvm-svn: 282970
2016-09-30 22:24:11 +00:00
Jim Ingham a2773357c4 Add the radar from our end to the bugreport string.
llvm-svn: 282969
2016-09-30 22:22:09 +00:00
Jim Ingham 8231b05c7d IsValid is the way to ask a breakpoint location whether it is valid.
llvm-svn: 282966
2016-09-30 22:07:41 +00:00
Sean Callanan 9c2cd9aadc Adding ivars in class extensions isn't supported on i386; skip a test.
llvm-svn: 282943
2016-09-30 20:46:09 +00:00
Sean Callanan 64bf0509f6 Skip TestRuntimeIvars on i386; the Objective-C V1 runtime doesn't list ivars.
llvm-svn: 282869
2016-09-30 16:02:28 +00:00
Pavel Labath f85ac77c9f XFAIL TestSBData for gcc-4.9 i386
test broken in r282659.

llvm-svn: 282849
2016-09-30 12:12:15 +00:00
Jim Ingham 190947e968 Add the tracking radar on our end.
llvm-svn: 282830
2016-09-30 01:23:46 +00:00
Enrico Granata 2aba83af94 Prefer skipping over x-failing
llvm-svn: 282824
2016-09-30 00:41:07 +00:00
Enrico Granata 20f27b99e8 Do not assume we will be able to discover the return type of this selector call, for that is not true in i386 mode
llvm-svn: 282823
2016-09-30 00:40:04 +00:00
Jim Ingham a703658ebc Add some logging when trace is on. We're getting a bot failure on i386 that doesn't
I can't reproduce locally.  Hopefully this will help us catch the reason.

llvm-svn: 282810
2016-09-29 23:48:21 +00:00
Sean Callanan ccbb4edbf9 Don't expect new-style Objective-C literals to work on i386 with the V1 runtime.
llvm-svn: 282794
2016-09-29 22:01:11 +00:00
Sean Callanan e62600a95c Fixed TestObjCMethods2/i386 by separating out the portions that require ObjC V2.
llvm-svn: 282787
2016-09-29 21:43:31 +00:00
Enrico Granata 6da57186d1 This test will not work in i386 mode because we don't create interesting types from the ObjC runtime
"Fixes" rdar://28501616

llvm-svn: 282774
2016-09-29 21:20:56 +00:00
Enrico Granata ae1ba73aeb Fix an issue where libc++ changed the type information we get for std::map::iterator, rendering LLDB unable to display elements vended by an iterator
Fixes <rdar://problem/28237521>

llvm-svn: 282648
2016-09-28 22:53:16 +00:00
Greg Clayton 7ae1a67ed9 Add the ability for the task port to change when a process execs.
<rdar://problem/28476369>

llvm-svn: 282632
2016-09-28 21:07:34 +00:00
Todd Fiala 5b69bb7d6b use assertEquals in TestSBTypeClassMembers
This change replaces the self.assertTrue() calls with
self.assertEquals() so that test failures get more context on failure
values.

llvm-svn: 282628
2016-09-28 20:39:50 +00:00
Todd Fiala 789ea82fa3 convert TestFatArchives.py over to no-debug-info test
We only use the .o-style debug info here regardless, so having
it run all three debuginfo styles was a waste.

This also strips out the custom build function and uses the
TestBase.build() method.

llvm-svn: 282508
2016-09-27 17:17:21 +00:00
Todd Fiala abe4ca7c02 xfail TestExec.py on macOS
Tracked by:
rdar://28476369

llvm-svn: 282496
2016-09-27 15:57:12 +00:00
Todd Fiala 2cd84c905d added Linux support for test timeout sampling
This is the Linux counterpart to the sampling support I added
on the macOS side.

This change also introduces zip-file compression if the size of
the sample output is greater than 10 KB.  The Linux side can be
quite large and the textual content is averaging over a 10x
compression factor on tests that I force to time out.  When
compression takes place, the filename becomes:

    {session_dir}/{TestFilename.py}-{pid}.sample.zip

This support relies on the linux 'perf' tool.  If it isn't
present, the behavior is to ignore pre-kill processing of
the timed out test process.

Note calling the perf tool under the timeout command appears
to nuke the profiled process.  This was causing the timeout
kill logic to fail due to the process having disappeared.
I modified the kill logic to catch the case of the process
not existing, and I have it ignore the kill request in that
case.  Any other exception is still raised.

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 282436
2016-09-26 20:25:47 +00:00
Sean Callanan 5deb06eb43 Added a setting that enables saving all .o files from a given JIT expression.
This allows debugging of the JIT and other analyses of the internals of the
expression parser.  I've also added a testcase that verifies that the setting
works correctly when off and on.

llvm-svn: 282434
2016-09-26 20:18:51 +00:00
Jim Ingham f7e0725628 Fix serialization of Python breakpoint commands.
CommandData breakpoint commands didn't know whether they were
Python or Command line commands, so they couldn't serialize &
deserialize themselves properly.  Fix that.
I also changed the "breakpoint list" command to note in the output
when the commands are Python commands.  Fortunately only one test
was relying on this explicit bit of text output.

llvm-svn: 282432
2016-09-26 19:47:37 +00:00
Pavel Labath 194cae9aba Remove ancient icc decorators
Nobody is running the test suite with icc, so we have no idea if they pass. But
the bug they link to has definitely been fixed.

llvm-svn: 282408
2016-09-26 14:34:02 +00:00
Pavel Labath a6baf8c3c8 Remove an ancient XFAIL from TestBuiltinTrap
in refers to gcc-4.6. Hopefully noone is using that anymore, and I think there is
a good chance it was fixed anyway.

llvm-svn: 282406
2016-09-26 13:50:06 +00:00
Francis Ricci 6951707943 Allow for tests to be disabled at runtime
Summary:
The current implementation of the test suite allows the user to run
a certain subset of tests using '-p', but does not allow the inverse,
where a user wants to run all but some number of known failing tests.
Implement this functionality.

Reviewers: labath, zturner, tfiala

Subscribers: jingham, sas, lldb-commits

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

llvm-svn: 282298
2016-09-23 21:32:47 +00:00
Todd Fiala 72525622b2 add hook for calling platform-dependent pre-kill action on a timed out test
differential review: https://reviews.llvm.org/D24850

reviewers: clayborg, labath
llvm-svn: 282258
2016-09-23 16:10:01 +00:00
Jim Ingham 2d3628e1f0 Add the ability to append breakpoints to the save file.
llvm-svn: 282212
2016-09-22 23:42:42 +00:00
Jim Ingham 3acdf38519 Add the ability to deserialize only breakpoints matching a given name.
Also tests for this and the ThreadSpec serialization.

llvm-svn: 282207
2016-09-22 22:20:28 +00:00
Ilia K a3174853b7 Fix parsing expressions to evaluate with spaces and optional args (MI)
Summary:
When extracting options for long options (starting with `--`), the use of
`MIUtilString::SplitConsiderQuotes` to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.

Patch by Ed Munoz <edmunoz@microsoft.com>

Reviewers: edmunoz, ki.stfu

Subscribers: ki.stfu, lldb-commits

Projects: #lldb

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

llvm-svn: 282135
2016-09-22 05:08:41 +00:00
Todd Fiala 9666ba7526 add stop column highlighting support
This change introduces optional marking of the column within a source
line where a thread is stopped.  This marking will show up when the
source code for a thread stop is displayed, when the debug info
knows the column information, and if the optional column marking is
enabled.

There are two separate methods for handling the marking of the stop
column:

* via ANSI terminal codes, which are added inline to the source line
  display.  The default ANSI mark-up is to underline the column.

* via a pure text-based caret that is added in the appropriate column
  in a newly-inserted blank line underneath the source line in
  question.

There are some new options that control how this all works.

* settings set stop-show-column

  This takes one of 4 values:

  * ansi-or-caret: use the ANSI terminal code mechanism if LLDB
    is running with color enabled; if not, use the caret-based,
    pure text method (see the "caret" mode below).

  * ansi: only use the ANSI terminal code mechanism to highlight
    the stop line.  If LLDB is running with color disabled, no
    stop column marking will occur.

  * caret: only use the pure text caret method, which introduces
    a newly-inserted line underneath the current line, where
    the only character in the new line is a caret that highlights
    the stop column in question.

  * none: no stop column marking will be attempted.

* settings set stop-show-column-ansi-prefix

  This is a text format that indicates the ANSI formatting
  code to insert into the stream immediately preceding the
  column where the stop column character will be marked up.
  It defaults to ${ansi.underline}; however, it can contain
  any valid LLDB format codes, e.g.

      ${ansi.fg.red}${ansi.bold}${ansi.underline}

* settings set stop-show-column-ansi-suffix

  This is the text format that specifies the ANSI terminal
  codes to end the markup that was started with the prefix
  described above.  It defaults to: ${ansi.normal}.  This
  should be sufficient for the common cases.

Significant leg-work was done by Adrian Prantl.  (Thanks, Adrian!)

differential review: https://reviews.llvm.org/D20835

reviewers: clayborg, jingham
llvm-svn: 282105
2016-09-21 20:13:14 +00:00
Jim Ingham 1ac2f2c4d3 Probably should add the breakpoint names test directory as well...
llvm-svn: 282103
2016-09-21 19:21:38 +00:00
Jim Ingham 92d1960e3b Add some more tests for breakpoint serialization.
Serialize breakpoint names & the hardware_requested attributes.
Also added a few missing affordances to SBBreakpoint whose absence
writing the tests pointed out.

<rdar://problem/12611863>

llvm-svn: 282036
2016-09-20 22:54:49 +00:00
Todd Fiala d15aa24a7e add availability check to DarwinLog event tests
The pexpect-based tests properly checked for the stub reporting
DarwinLog support.  The event-based ones did not.  This is fixed
here.  Swift CI bots are not currently building debugserver on
macOS, so they don't have the DarwinLog support even when they
pass the macOS 10.12 check.

llvm-svn: 281696
2016-09-16 03:07:14 +00:00
Jim Ingham 6d1e4696a2 First tests for serializing breakpoints.
Plus a few bug fixes I found along the way.

llvm-svn: 281690
2016-09-16 01:41:27 +00:00
Tamas Berghammer b293fc783b Fix TestSymbolContextTwoFiles on Android after rL281595
llvm-svn: 281601
2016-09-15 10:49:55 +00:00
Tamas Berghammer 2540a553e5 Add support for DW_AT_ranges_base attribute
It is a new attribute emitted by clang as a GNU extension and will
be part of Dwarf5. The purpose of the attribute is to specify a compile
unit level base value for all DW_AT_ranges to reduce the number of
relocations have to be done by the linker.

Fixes (at least partially): https://llvm.org/pr28826

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

llvm-svn: 281595
2016-09-15 08:53:33 +00:00
Zachary Turner 471932de24 Force c++14 when running tests on Windows.
VS 2015 and higher begin making use of c++14 in their standard
library headers.  As such, -std=c++11 makes it so you can't compile
trivial programs.  Bump this to -std=c++14 when this situation is
detected.

llvm-svn: 281420
2016-09-13 23:45:11 +00:00
Jason Molenda d82e1063f9 TestQueues could error out because the one second sleep main.c was
using to enqueue all the jobs wasn't enough time on a slow/overloaded
system.  Instead use a global to indicate when all the work has
been enqueued, let's see if this makes the CIs work more reliably.

llvm-svn: 281418
2016-09-13 23:29:46 +00:00
Jason Molenda e1489bde3b Reduce the number of simultaneous debug sessions to 10 and remove
the expectedFlakeyDarwin annotation.

I've been running this test in isolation on my macOS Sierra system
and haven't seen a failure in 20-30 runs.  The number of simultaneous
debug sessions that it spins up could be a problem when the testbots
are running under load, so I'm reducing this from 20 simultaneous
debug sessions to see if we can get enough stability to leave this
enabled.

llvm-svn: 281291
2016-09-13 02:45:45 +00:00
Todd Fiala d0c1c3220a xfail TestQueues.py and TestDarwinLogFilterMatchMessage.py
It looks like the message-content-retrieval aspect of DarwinLog
support is flaky, not just the regex match against it.  Slightly
less frequently than the regex matching, I am seeing the
direct string-match variant of log-message-content matching
also fail.

Tracked by:
llvm.org/pr30299
rdar://28237450

llvm-svn: 281251
2016-09-12 20:23:13 +00:00
Ilia K 94df34f72d Add MiSyntaxTestCase.test_lldbmi_output_grammar test (MI)
Summary: This patch adds a new test and fixes extra new-line before exit

Reviewers: abidh

Subscribers: ki.stfu, dawn, lldb-commits, abidh

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

llvm-svn: 281199
2016-09-12 07:14:51 +00:00
Todd Fiala ace732a069 xfail DarwinLog "filter message by regex" tests
These tests are not working reliably.  I'm marking them
xfail until I resolve the issue.

Tracked by:
llvm.org/pr30299

llvm-svn: 281058
2016-09-09 17:07:15 +00:00
Nitesh Jain e9cb0d89c4 [LLDB][MIPS] Fix TestEhFrameUnwind.py for MIPS
Reviewers: clayborg, labath

Subscribers: jaydeep, bhushan, slthakur, lldb-commits

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

llvm-svn: 281031
2016-09-09 10:20:08 +00:00
Nitesh Jain 4a82350239 [LLDB][MIPS] Fix TestLldbGdbServer.py failure
Subscribers: jaydeep, bhushan, slthakur, lldb-commits
llvm-svn: 281026
2016-09-09 09:50:33 +00:00
Valentina Giusti cda0ae46ac Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
Summary: Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Reviewers: dvlahovski, granata.enrico, clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 280942
2016-09-08 14:16:45 +00:00
Pavel Labath 6f22b771c4 Fix test breakage in r280919
It turns out that self.dbg.GetSelectedPlatform().GetTriple() is not a good way
to get the triple of the process, as it returns the incorrect triple in case of a
32-bit process running on a 64-bit platform.

Instead, go the long way round and ask the stub for the process triple. This
fixes the test for i386.

llvm-svn: 280922
2016-09-08 11:09:14 +00:00
Pavel Labath 2f1fbaebe2 gdb-remote: Add jModulesInfo packet
Summary:
This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to
query multiple modules at once. This makes a significant speed improvement in case the
application has many (over a hundred) modules, and the communication link has a non-negligible
latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does
the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote
stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after
it reads the list of modules from the inferior memory, but other uses are possible.

This decreases the attach time to an android application by about 40%.

Reviewers: clayborg

Subscribers: tberghammer, lldb-commits, danalbert

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

llvm-svn: 280919
2016-09-08 10:07:04 +00:00
Zachary Turner 87daab322f Revert "Fix tests on Windows."
This reverts commit 9b757b6e3946311802972409f38c6cefbea917b3.

This seems to cause strange breakages about on Ubuntu.

llvm-svn: 280763
2016-09-06 22:40:11 +00:00
Zachary Turner 4349e8f9b0 Fix tests on Windows.
This wasn't actually a problem with the reformat, but rather a
problem with Visual Studio 2015 Update 3, which uses some c++14
features in its standard libraries.  So we had to change -std=c++11
to -std=c++14.

llvm-svn: 280759
2016-09-06 22:14:22 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Dimitar Vlahovski ee44a92df6 Revert "Intel(R) Memory Protection Extensions (Intel(R) MPX) support."
This reverts commit rL280668 because the register tests fail on i386
Linux.

I investigated a little bit what causes the failure - there are missing
registers when running 'register read -a'.
This is the output I got at the bottom:
"""
...
Memory Protection Extensions:
      bnd0 = {0x0000000000000000 0x0000000000000000}
      bnd1 = {0x0000000000000000 0x0000000000000000}
      bnd2 = {0x0000000000000000 0x0000000000000000}
      bnd3 = {0x0000000000000000 0x0000000000000000}

unknown:
2 registers were unavailable.
"""

Also looking at the packets exchanged between the client and server:
"""
...
history[308] tid=0x7338 <  19> send packet: $qRegisterInfo4a#d7
history[309] tid=0x7338 < 130> read packet:
$name:bnd0;bitsize:128;offset:1032;encoding:vector;format:vector-uint64;set:Memory
Protection Extensions;ehframe:101;dwarf:101;#48
history[310] tid=0x7338 <  19> send packet: $qRegisterInfo4b#d8
history[311] tid=0x7338 < 130> read packet:
$name:bnd1;bitsize:128;offset:1048;encoding:vector;format:vector-uint64;set:Memory
Protection Extensions;ehframe:102;dwarf:102;#52
history[312] tid=0x7338 <  19> send packet: $qRegisterInfo4c#d9
history[313] tid=0x7338 < 130> read packet:
$name:bnd2;bitsize:128;offset:1064;encoding:vector;format:vector-uint64;set:Memory
Protection Extensions;ehframe:103;dwarf:103;#53
history[314] tid=0x7338 <  19> send packet: $qRegisterInfo4d#da
history[315] tid=0x7338 < 130> read packet:
$name:bnd3;bitsize:128;offset:1080;encoding:vector;format:vector-uint64;set:Memory
Protection Extensions;ehframe:104;dwarf:104;#54
history[316] tid=0x7338 <  19> send packet: $qRegisterInfo4e#db
history[317] tid=0x7338 <  76> read packet:
$name:bndcfgu;bitsize:64;offset:1096;encoding:vector;format:vector-uint8;#99
history[318] tid=0x7338 <  19> send packet: $qRegisterInfo4f#dc
history[319] tid=0x7338 <  78> read packet:
$name:bndstatus;bitsize:64;offset:1104;encoding:vector;format:vector-uint8;#8e
...
"""

The bndcfgu and bndstatus registers don't have the 'Memory Protections
Extension' set. I looked at the code and it seems that that is set
correctly.

So I'm not sure what's the problem or where does it come from.

Also there is a second failure related to something like this in the
tests:
"""
registerSet.GetName().lower()
"""

For some reason the registerSet.GetName() returns None.

llvm-svn: 280703
2016-09-06 11:00:37 +00:00
Sean Callanan 4740a734bb Added the "frame diagnose" command and use its output to make crash info better.
When a process stops due to a crash, we get the crashing instruction and the
crashing memory location (if there is one).  From the user's perspective it is
often unclear what the reason for the crash is in a symbolic sense.

To address this, I have added new fuctionality to StackFrame to parse the 
disassembly and reconstruct the sequence of dereferneces and offsets that were
applied to a known variable (or fuction retrn value) to obtain the invalid
pointer.

This makes use of enhancements in the disassembler, as well as new information
provided by the DWARF expression infrastructure, and is exposed through a
"frame diagnose" command.  It is also used to provide symbolic information, when
available, in the event of a crash.

The algorithm is very rudimentary, and it needs a bunch of work, including
  - better parsing for assembly, preferably with help from LLVM
  - support for non-Apple platforms
  - cleanup of the algorithm core, preferably to make it all work in terms of
    Operands instead of register/offset pairs
  - improvement of the GetExpressioPath() logic to make prettier expression
    paths, and
  - better handling of vtables.
I welcome all suggestios, improvements, and testcases.

llvm-svn: 280692
2016-09-06 04:48:36 +00:00
Todd Fiala 7ed76d275f remove dependence of TestGdbRemoteExitCode.py on parent directory source
As Pavel pointed out in a comment on llvm.org/pr30271, the VPATH I was
using here to eliminate duplication of a .cpp file had a side effect of
attempting to pull in a .o/.obj file from that same parent dir, where
other tests can be running in parallel.  This is no good.

For now, I have removed the VPATH, which should address
llvm.org/pr30271.  I have also removed the XFAIL.

llvm-svn: 280675
2016-09-05 22:03:02 +00:00
Valentina Giusti f105abbc0d Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
Summary:

The Intel(R) Memory Protection Extensions (Intel(R) MPX) associates pointers
to bounds, against which the software can check memory references to
prevent out of bound memory access.

This patch allows accessing the MPX registers:
  * bnd0-3: 128-bit registers to hold the bound values,
  * bndcfgu, bndstatus: 64-bit configuration registers,

This patch also adds read/write tests for the MPX registers in the register
command tests and adds a new subdirectory for MPX specific tests.

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Reviewers: labath, granata.enrico, lldb-commits, clayborg

Subscribers: lldb-commits

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

llvm-svn: 280668
2016-09-05 17:43:10 +00:00
Pavel Labath 56b23506c5 Add default_packet_timeout key to the new TestGdbRemoteHostInfo test
android targets use this key, so the test should recognize it.

llvm-svn: 280652
2016-09-05 08:34:56 +00:00
Todd Fiala b1a503bd13 XFAIL TestGdbRemoteExitCode failing tests
Tracked by:
llvm.org/pr30271

llvm-svn: 280606
2016-09-04 00:43:10 +00:00
Todd Fiala e77fce0a50 [NFC] Darwin llgs support from Week of Code
This code represents the Week of Code work I did on bringing up
lldb-server LLGS support for Darwin.  It does not include the
Xcode project changes needed, as we don't want to throw that switch
until more support is implemented (i.e. this change is inert, no
build systems use it yet.  I've verified on Ubuntu 16.04, macOS
Xcode and macOS cmake builds).

This change does some minimal refactoring of code that is shared
with the Linux LLGS portion, moving it from NativeProcessLinux into
NativeProcessProtocol.  That code is also used by NativeProcessDarwin.

Current state on Darwin:
* Process launching is implemented.  (Attach is not).
  Launching on devices has not yet been tested (FBS/BKS might
  need a bit of work).
* Inferior waitpid monitoring and communication of exit status
  via MainLoop callback is implemented.
* Memory read/write, breakpoints, thread register context, etc.
  are not yet implemented.  This impacts process stop/resume, as
  the initial launch suspended immediately starts the process
  up and running because it doesn't know it is supposed to remain
  stopped.
* I implemented the equivalent of MachThreadList as
  NativeThreadListDarwin, in anticipation that we might want to
  factor out common parts into NativeThreadList{Protocol} and share
  some code here.  After writing it, though, the fallout from merging
  Mach Task/Process into a single concept plus some other minor
  changes makes the whole NativeThreadListDarwin concept nothing more
  than dead weight.  I am likely going to get rid of this class and
  just manage it directly in NativeProcessDarwin, much like I did
  for NativeProcessLinux.
* There is a stub-out call for starting a STDIO thread.  That will
  go away and adopt the MainLoop pselect-based IOObject reading.

I am developing the fully-integrated changes in the following repo,
which contains the necessary Xcode bits and the glue that enables
lldb-debugserver on a macOS system:

  https://github.com/tfiala/lldb/tree/llgs-darwin

This change also breaks out a few of the lldb-server tests into
their own directory, and adds some $qHostInfo tests (not sure why
I didn't write those tests back when I initially implemented that
on the Linux side).

llvm-svn: 280604
2016-09-04 00:18:56 +00:00
Pavel Labath f92756e9ec Reapply "Make Scalar::GetValue more consistent"
this is a resubmission of r280476. The problem with the original commit was that it was printing
out all numbers as signed, which was wrong for unsigned numbers with the MSB set. Fix that and
add a unit test covering that case.

llvm-svn: 280480
2016-09-02 10:58:52 +00:00
Pavel Labath e6ece918e9 Revert "Make Scalar::GetValue more consistent"
This reverts commit r280476 as it breaks several tests on i386. I was fixing an 32-bit
breakage, and I did not run the 32-bit test suite before submitting, oops.

llvm-svn: 280478
2016-09-02 09:52:18 +00:00
Pavel Labath ce57a33e58 Bump up TestCallWithTimeout timeout
Still a bit flaky on remote targets. Trying a larger bump this time. :/

llvm-svn: 280477
2016-09-02 09:25:42 +00:00
Pavel Labath 21159ee681 Make Scalar::GetValue more consistent
Summary:
It seems the original intention of the function was printing signed values in decimal format, and
unsigned values in hex (without the leading "0x"). However, signed and unsigned long were
exchanged, which lead to amusing test failures in TestMemoryFind.py.

Instead of just switching the two, I think we should just print everything in decimal here, as
the current behaviour is very confusing (especially when one does not request printing of types).
Nothing seems to depend on this behaviour except and we already have a way for the user to
request the format he wants when printing values for most commands (which presumably does not go
through this function).

I also add a unit tests for the function in question.

Reviewers: clayborg, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 280476
2016-09-02 09:25:36 +00:00
Enrico Granata df43d25fd3 Change the formula for tagged NSIndexPath data formatting
Fixes rdar://25192935

llvm-svn: 280389
2016-09-01 18:09:01 +00:00
Pavel Labath cce9a609fb XFail TestMemoryFind on 32-bit architectures
the test fails for a very prosaic reason: `(const char *)0x1000` returns "4096" on x86_64 and
"1000" (without the "0x") on i386. I haven't tried other 32-bit arches, but I am guessing the
behaviour is the same. XFAIL until someone can get a chance to look at this.

llvm-svn: 280344
2016-09-01 09:17:37 +00:00
Enrico Granata 7eef5fa147 Change "memory find" over to using a variation of the Boyer–Moore search algorithm
Fixes rdar://15455621 (and adds a test case for this command which - surprisingly and sadly - was not there originally)

llvm-svn: 280327
2016-09-01 00:09:59 +00:00
Enrico Granata 1b54baef15 Add a data formatter for std::function in libcxx
llvm-svn: 280295
2016-08-31 21:46:37 +00:00
Enrico Granata 9b6d4cf9bd Fix an issue where a synthetic child provider could only provide a value of the same size as the containing type
llvm-svn: 280294
2016-08-31 21:46:21 +00:00
Pavel Labath 93b5b660e8 Fixup TestPyObjSynthProvider.py and enable it again
Summary:
- copies the new file in the cmake build
- adds an additional import statement
- marks the test as no-debug-info specific, as it seems to be testing a python feature

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 280261
2016-08-31 17:38:17 +00:00
Pavel Labath b1c4b836b9 XFail new TestPyObjSynthProvider.py on linux until I can investigate the cause of the problem
llvm-svn: 280208
2016-08-31 08:43:40 +00:00
Enrico Granata f6275a08ef Rename the test class
llvm-svn: 280173
2016-08-30 23:00:52 +00:00
Enrico Granata 42ff957e25 Add an helper class lldb.formatters.synth.PythonObjectSyntheticChildProvider
This class enables one to easily write a synthetic child provider by writing a class that returns pairs of names and primitive Python values - the base class then converts those into LLDB SBValues

Comes with a test case

llvm-svn: 280172
2016-08-30 23:00:02 +00:00
Jim Ingham fb1bdc4922 This test now succeeds.
llvm-svn: 279897
2016-08-27 00:35:48 +00:00
Sean Callanan fc670cf6d0 Don't crash when trying to capture persistent variables in a block.
Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850
2016-08-26 18:12:39 +00:00
Jim Ingham 1bf7d30469 Make all the Function implementations different so the compiler won't share them.
Clang on ARM64 was making the three Function methods with identical bodies have
one implementation that was shared.  That threw off the count of breakpoints, since
we don't count as separate locations three functions with the same address.

I also cleaned up the test case while I was at it.

<rdar://problem/27001915>

llvm-svn: 279800
2016-08-26 01:27:50 +00:00
Todd Fiala b17ac35f20 fix darwin_log test errors on macOS < 10.12
The newer event-based tests I added neglected to do the
macOS 10.12 check in the setup.  This caused earlier macOS
test suite runs to attempt to compile code that doesn't exist.

llvm-svn: 279672
2016-08-24 21:40:29 +00:00
Pavel Labath e92050f044 Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_state
The test was attempting to backtrace a process after every state change event (including the
"running", and "restarted" ones), which is not a good idea.

llvm-svn: 279512
2016-08-23 12:10:03 +00:00
Jim Ingham 27f4a94e0a Remove a test that depends on knowing all compiler's register allocation schemes.
This test was using a condition that would compare a variable against the register that would hold
it.  It was failing with clang on arm64 because clang put the variable on the stack.

This is not a supportable way to write tests.

llvm-svn: 279345
2016-08-19 22:58:26 +00:00
Dimitar Vlahovski d909f9551c Fixing a Darwing test thats failing on windows
The pexpect import should be make after the skip-if-not-darwin part
because pexpect is not available on Windows

llvm-svn: 279234
2016-08-19 12:44:53 +00:00
Todd Fiala 759300192a Add StructuredData plugin type; showcase with new DarwinLog feature
Take 2, with missing cmake line fixed.  Build tested on
Ubuntu 14.04 with clang-3.6.

See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279202
2016-08-19 04:21:48 +00:00
Todd Fiala a07e4a8352 Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8.

llvm-svn: 279200
2016-08-19 03:03:58 +00:00
Todd Fiala aef7de8492 Add StructuredData plugin type; showcase with new DarwinLog feature
See docs/structured_data/StructuredDataPlugins.md for details.

differential review: https://reviews.llvm.org/D22976

reviewers: clayborg, jingham
llvm-svn: 279198
2016-08-19 02:52:07 +00:00
Pavel Labath c233995b1e Fix tests for the gdb-remote memory read packets
Part of TestGDBRemoteMemoryRead has been disabled since r259379 because it was incompatible with
python3. This changes the test to use the lldb-server test framework, which is a more appropriate
method of testing raw stub behaviour anyway (and should avoid the whole python 3 issue).

llvm-svn: 279039
2016-08-18 08:21:42 +00:00
Omair Javaid a6583c5d89 Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPY
Differential revision: https://reviews.llvm.org/D20386

llvm-svn: 278947
2016-08-17 16:45:34 +00:00
Pavel Labath 1ac2b20d25 Fix expression evaluation with operator new
Summary:
referencing a user-defined operator new was triggering an assert in clang because we were
registering the function name as string "operator new", instead of using the special operator
enum, which clang has for this purpose. Method operators already had code to handle this, and now
I extend this to cover free standing operator functions as well. Test included.

Reviewers: spyffe

Subscribers: sivachandra, paulherman, lldb-commits

Differential Revision: http://reviews.llvm.org/D17856

llvm-svn: 278670
2016-08-15 14:32:32 +00:00
Zachary Turner b6958a888e Disable TestThreadSpecificBpPlusCondition on Windows.
Test frequently times out stalling the test runner.

llvm-svn: 278529
2016-08-12 17:15:38 +00:00
Tamas Berghammer 3785393def Skip 2 android test what is broken because of debuggerd
debuggerd is a crash reporting system on android what installs some
signal handler for SEGV to print a backtrace in the log. Its behavior
breaks tests where the test tries to continue after a SEGV so we skip
them as this behavior isn't required on android anyway.

llvm-svn: 278510
2016-08-12 14:17:05 +00:00
Pavel Labath 709269153f XFAIL TestNamespaceDefinitions on gcc-4.8 and below
llvm-svn: 278491
2016-08-12 09:52:14 +00:00
Pavel Labath b491ef4317 Make TestCallStopAndContinue clang-format-resilient
llvm-svn: 278490
2016-08-12 09:39:22 +00:00
Omair Javaid 3add5ec690 Make sure LldbGdbServerTestCase is built in arm mode to avoid failures due thumb instructions
Differential revision: https://reviews.llvm.org/D23395

llvm-svn: 278326
2016-08-11 10:35:05 +00:00
Todd Fiala c8b3717344 xfailed TestObjCNewSyntax.py on macOS for gmodules
Tracked by:
rdar://27792848

llvm-svn: 278289
2016-08-10 21:07:48 +00:00
Todd Fiala 0711416b47 Undid LLVM macro usage in test suite test subject files.
llvm-svn: 278197
2016-08-10 01:37:27 +00:00
Zachary Turner f343968f5d Delete Host/windows/win32.h
It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.

This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.

There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.

This patch depends on LLVM revision r278170.

llvm-svn: 278177
2016-08-09 23:06:08 +00:00
Jim Ingham 298de8f6a3 Errors compiling breakpoint conditions will cause the breakpoint not to be hit
This was a shadowed variable error from the big Expression Parser plugin-ification.  I also 
added a test case for this.

<rdar://problem/27682376>

llvm-svn: 277662
2016-08-03 22:46:11 +00:00
Omair Javaid 0aebb56a88 Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPY
This commit is causing problems on gcc-* compiler with version number sufix.

Requires a new solution will post a follow up patch.

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

llvm-svn: 277453
2016-08-02 13:17:49 +00:00
Omair Javaid 9845320280 Correct makefile.rules to use toolchain specific AR and OBJCOPY
Differential revision: https://reviews.llvm.org/D20386

llvm-svn: 277429
2016-08-02 07:56:11 +00:00
Dimitar Vlahovski 023dd64f25 Add/fix support for i386 elf core files
Summary:
There were places in the code, assuming(hardcoding) offsets
and types that were only valid for the x86_64 elf core file format.

The NT_PRSTATUS and NT_PRPSINFO structures are with the 64 bit layout.
I have reused them and parse i386 files manually, and fill them in the
same struct.

Also added some error handling during parsing that checks if the
available bytes in the buffer are enough to fill the structures.

The i386 core file test case now passes.

For reference on the structures layout, I generally used the
source of binutils (bfd, readelf)

Bug: https://llvm.org/bugs/show_bug.cgi?id=26947

Reviewers: labath

Subscribers: lldb-commits

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

llvm-svn: 277140
2016-07-29 13:18:09 +00:00
Ilia K 5659a2850f Fix -break-insert not working when using absolute paths (MI)
Summary:
When trying to parse the -break-insert arguments as a named location, the string parsing was not configured to allow directory paths. This patch adds a constructor to allow the parsing of string as directory path along with the other parameters.

This fixes https://llvm.org/bugs/show_bug.cgi?id=28709

Patch from malaperle@gmail.com
Reviewers: clayborg, ki.stfu
Subscribers: lldb-commits, ki.stfu
Differential Revision: https://reviews.llvm.org/D22902

llvm-svn: 277117
2016-07-29 06:01:20 +00:00
Greg Clayton 8089e81ccd Fixed "void SBWatchpoint::SetEnabled (bool enabled)" to work properly and added a test for it.
https://llvm.org/bugs/show_bug.cgi?id=28729
<rdar://problem/27575225>

llvm-svn: 276914
2016-07-27 20:47:49 +00:00
Enrico Granata d2a10e88f6 Print a warning if the directory passed to --test-subdir doesn't end up existing
llvm-svn: 276709
2016-07-25 23:26:24 +00:00
Todd Fiala 6118ce1221 Breakup TestConcurrentEvents.py into separate test subdirs per test method
This change breaks up the monolithic TestConcurrentEvents.py into a
separate subdir per test method. This allows them to run concurrently,
reduces the chance of a timeout occurring during normal operation, and
allows us to home in on any test methods that may be locking up.

This is step one in the process of squashing timeouts in these test
methods.

The reason for breaking each test method into its own file is to make it
very clear to us if there are a subset of the tests that do in fact lock
up frequently. This will limit how much hunting we need to do to
recreate it.

The reason for putting each file in a separate subdirectory is so that
our concurrent test runner can run multiple test files at the same time.
The unit of serialization in the LLDB test suite is the test directory,
so moving them into separate directories enables the test runner to do
more at the same time.

This change introduces usage of VPATH from gnu make. I use that to
facilitate keeping a single copy of the main.cpp in the parent
concurrent_events directory. Initially I had tried specifying the source
file as ../main.cpp, but our current makefile rules get confused by that
and then also build the output into the parent directory, which defeats
the ability to run each of the test methods concurrently. In the event
that not all systems support VPATH, I can do a bit of surgery on the
Makefile rules and attempt to make it smarter with regards to relative
paths to source files used in the build.

llvm-svn: 276478
2016-07-22 21:50:55 +00:00
Tamas Berghammer d7d69f8083 Support loading files even when incorrect file name specified by the linker
"Incorrect" file name seen on Android whene the main executable is
called "app_process32" (or 64) but the linker specifies the package
name (e.g. com.android.calculator2). Additionally it can be present
in case of some linker bugs.

This CL adds logic to try to fetch the correct file name from the proc
file system based on the base address sepcified by the linker in case
we are failed to load the module by name.

Differential revision: http://reviews.llvm.org/D22219

llvm-svn: 276411
2016-07-22 12:55:35 +00:00
Francis Ricci 628fd34e84 Fix typo in test runner
llvm-svn: 276166
2016-07-20 19:37:31 +00:00
Enrico Granata 1d2e609b01 s/Cocoa/Foundation/
llvm-svn: 276065
2016-07-19 23:58:23 +00:00
Enrico Granata b5ab08bdb1 Don't check the value of the unset variables on iOS
llvm-svn: 276033
2016-07-19 21:50:39 +00:00
Pavel Labath 5ab9732aef Revert "[test] Report error when inferior test processes exit with a non-zero code"
This reverts r275782.

The problem with the commit is that it reports an additional "exit (1)" error for every file
containing a failing test, which is far more than I had intended to do. I'll need to come up with
a more fine-grained way of achieving the result.

llvm-svn: 275791
2016-07-18 14:42:01 +00:00
Pavel Labath 52bd8012bd [test] Report error when inferior test processes exit with a non-zero code
Summary:
We've run into this problem when the test errored out so early (because it could not connect to
the remote device), that the code in D20193 did not catch the error. This resulted in the test
suite reporting success with 0 tests being run.

This patch makes sure that any non-zero exit code from the inferior process gets reported as an
error. Basically I expand the concept of "exceptional exits", which was previously being used for
signals to cover these cases as well.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 275782
2016-07-18 11:27:19 +00:00
Pavel Labath 9377a7b6a8 Fix TestDarwinNSLogOutput for windows
pexpect python package does not exist on windows

llvm-svn: 275555
2016-07-15 12:19:28 +00:00
Jim Ingham fa0f2a0dcf Remember to add the testcase I wrote for r274822.
llvm-svn: 275519
2016-07-15 01:41:54 +00:00
Todd Fiala 38c5318662 adjust one of the NSLog output tests to only run on macOS 10.12+
The LLDB NSLog handling when Xcode intends to suppress NSLog
output only works on Fall 2016 OS releases.  Skip it on earlier
OSes.

llvm-svn: 275506
2016-07-15 00:51:26 +00:00
Kate Stone 7428a18c1e LLDB help content has accumulated over time without a recent attempt to
review it for consistency, accuracy, and clarity. These changes attempt to
address all of the above while keeping the text relatively terse.

<rdar://problem/24868841>

llvm-svn: 275485
2016-07-14 22:03:10 +00:00
Todd Fiala da2f494992 removed darwin_log.py file from previous check-in
This file was not intended to be part of the last check-in.

llvm-svn: 275478
2016-07-14 21:25:42 +00:00
Todd Fiala 4acb65ecee fix command-line LLDB so NSLog messages show up
Changes to the underlying logging infrastructure in Fall 2016 Darwin
OSes were no longer showing up NSLog messages in command-line LLDB.
This change restores that functionality, and adds test cases to
verify the new behavior.

rdar://26732492

llvm-svn: 275472
2016-07-14 21:02:45 +00:00
Greg Clayton 7853dd5dec Add support for Objective-C class properties.
Added test cases to exiting tests to cover the new functionality.

<rdar://problem/24311282> 

llvm-svn: 275459
2016-07-14 19:31:18 +00:00
Pavel Labath c54f9c4851 mark newly failing tests as XFAIL
llvm-svn: 275394
2016-07-14 10:43:24 +00:00
Pavel Labath fa3d652d26 [test] [linux] define PR_SET_PTRACER constants if the system does not provide them
Android API <= 16 header do not have these symbols defined, but the kernel does support the
relevant calls. And in general, since these calls are on a best-effort basis, it won't hurt even
if we try to run in on a really ancient kernel.

llvm-svn: 275393
2016-07-14 10:43:21 +00:00
Ilia K beb1aa907d Fix -break-enable/-break-disable commands (MI)
* Previously -break-enable mistakenly set BP's enabled flag to false.
* These commands print fake =breakpoint-modified messages, what's not
  needed anymore because that events are come in normal way.
* Add tests for -break-enable/-break-disable commands

Initial patch from xuefangliang@hotmail.com. The test case was improved by me.

Differential Revision: http://reviews.llvm.org/D21757

llvm-svn: 275381
2016-07-14 07:43:14 +00:00
Greg Clayton ae26b488df Added test for setting breakpoints by basename and fullname.
<rdar://problem/24599697> 

llvm-svn: 275336
2016-07-13 22:38:54 +00:00
Greg Clayton f1d93ecc76 This doesn't compiler on Darwin. Skipping it.
llvm-svn: 275225
2016-07-12 23:06:28 +00:00
Pavel Labath 8a93f822e1 [test] Fix category-based skipping
Summary:
LLDBTestResult.hardMarkAsSkipped marked the whole class as skipped when the first class in the
test failed the category check. This meant that subsequent tests in the same class did not run
even if they were passing the category filter. Fix that.

Reviewers: tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D22213

llvm-svn: 275173
2016-07-12 15:07:18 +00:00
Enrico Granata 02989a4b5d Fix an issue where one could not define a Python command with the same name as an existing alias (or rather, one could but the results of invoking the command were far from satisfactory)
llvm-svn: 275080
2016-07-11 17:36:55 +00:00
Greg Clayton 6a3116415b When calling "settings set target.source-map <old-path> <new-path>", make sure that <new-path> exists before accepting it as a remapping.
We had some clients that had added old source paths remappings to their .lldbinit files and they were causing trouble at a later date. This fix should help mitigate these issues.

<rdar://problem/26358860>

llvm-svn: 274948
2016-07-08 23:06:38 +00:00
Pavel Labath 613cce835f Bump up timeout in TestCallWithTimeout
remote targets need a bit more time to get their act together

llvm-svn: 274762
2016-07-07 15:45:57 +00:00
Ravitheja Addepally b3b972a5a8 Fix for PrintStackTraces
Summary:
The issue arises due to the wrong unwinder used for the first
stack frame, where the default unwinder returns erroneous frame
whereas the fallback would have given the correct frame had it
been used.
The following fix consists of two parts ->
 1) The first part changes the unwinding strategy, earlier the
    default unwinder was used to get 2 more stack frames and if it
    failed a fallback unwinder was used. Now we try to obtain as many
    frames (max 10) as we can get from default unwinder and also
    fallback unwinder and use the one that gives more number of frames.
    
 2) Normally unwindplans are assosciated with functions and the
    row to be used is obtained from the offset (obtained from the low_pc
    of the function symbol). Sometimes it may occur that the unwindplan
    is assosciated to the complete Elf section in which case the offset
    calculation would be wrong as the debugger uses the same offset originally
    obtained from the function symbol. Hence this offset is recalculated.

Reviewers: tberghammer, lldb-commits, labath, jasonmolenda

Subscribers: jingham

Differential Revision: http://reviews.llvm.org/D21221

llvm-svn: 274750
2016-07-07 13:00:29 +00:00
Howard Hellyer ad00756301 Implement GetMemoryRegions() for Linux and Mac OSX core files.
Summary:
This patch fills in the implementation of GetMemoryRegions() on the Linux and Mac OS core file implementations of lldb_private::Process (ProcessElfCore::GetMemoryRegions and ProcessMachCore::GetMemoryRegions.) The GetMemoryRegions API was added under: http://reviews.llvm.org/D20565

The patch re-uses the m_core_range_infos list that was recently added to implement GetMemoryRegionInfo in both ProcessElfCore and ProcessMachCore to ensure the returned regions match the regions returned by Process::GetMemoryRegionInfo(addr_t load_addr, MemoryRegionInfo &region_info).

Reviewers: clayborg

Subscribers: labath, lldb-commits

Differential Revision: http://reviews.llvm.org/D21751

llvm-svn: 274741
2016-07-07 08:21:28 +00:00
Tamas Berghammer 9c6c8e9991 Add data formatter for libstdc++ shared_ptr and weak_ptr
Differential revision: http://reviews.llvm.org/D21984

llvm-svn: 274617
2016-07-06 09:50:00 +00:00
Sean Callanan 8ba1654d48 Fixed a bug where we report a single type multiple times in namespaces.
Also added a testcase.

<rdar://problem/22786569>

llvm-svn: 274580
2016-07-05 22:06:01 +00:00
Pavel Labath 97ef14c64b Split TestTemplateIntegerArgs test into two
Summary:
One of the tests there does not work with gcc, so I'm spinning that off into a separate test, so
that we can XFAIL it with more granularity.

I am also renaming the test to reflect the fact that it no longer tests only integer arguments.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D21923

llvm-svn: 274505
2016-07-04 13:49:46 +00:00
Pavel Labath 7cf00d191a Enable test log collection from remote debug servers (take 2)
Summary:
This is a slightly reworked version of D16322, which I had reverted because it did not do what it
advertised. Differences from the previous version are:
- moved the code for cleaning up the remote working dir to a later point as it was removing the
  log file before we could get to it.
- specialised log downloading code for gdb-remote tests is not needed, as this will cover that
  use case as well.

Reviewers: tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D21898

llvm-svn: 274491
2016-07-04 09:59:45 +00:00
Pavel Labath abb79683bb Join TestTlsGlobal tests again and use the proper decorator
llvm-svn: 274490
2016-07-04 09:27:53 +00:00
Greg Clayton 591ff8376b Fixed thread local storage test case to run normally with no expected fail for Darwin, always skip on windows, and expected fail for all other OSs while mentioning the new bug I filed to track fixing TLS variables: https://llvm.org/bugs/show_bug.cgi?id=28392
llvm-svn: 274393
2016-07-01 22:33:13 +00:00
Greg Clayton c7bb34f6ec Thread local storage was already broken on Linux and the tests were passing because there was a dectorator:
@unittest2.expectedFailure("rdar://7796742")
    
Which was covering up the fact this was failing on linux and hexagon. I added back a decorator so we don't break any build bots.

llvm-svn: 274388
2016-07-01 21:25:20 +00:00
Greg Clayton 63a27afae3 Added support for thread local variables on all Apple OS variants.
We had support that assumed that thread local data for a variable could be determined solely from the module in which the variable exists. While this work for linux, it doesn't work for Apple OSs. The DWARF for thread local variables consists of location opcodes that do something like:

DW_OP_const8u (x)
DW_OP_form_tls_address

or 

DW_OP_const8u (x)
DW_OP_GNU_push_tls_address

The "x" is allowed to be anything that is needed to determine the location of the variable. For Linux "x" is the offset within the TLS data for a given executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of the data structure that contains a pthread key that can be used with pthread_getspecific() and the offset needed. 

This fix passes the "x" along to the thread:

virtual lldb::addr_t
lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr);

Then this is passed along to the DynamicLoader::GetThreadLocalData():

virtual lldb::addr_t
lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr);

This allows each DynamicLoader plug-in do the right thing for the current OS.

The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key from the data structure that is in memory and call "void *pthread_getspecific(pthread_key_t key)" to get the value of the thread local storage and it caches it per thread since it never changes.

I had to update the test case to access the thread local data before trying to print it as on Apple OS variants, thread locals are not available unless they have been accessed at least one by the current thread.

I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so that we can ask SBValue objects for their ValueType and be able to tell when we have a thread local variable.

<rdar://problem/23308080>

llvm-svn: 274366
2016-07-01 17:17:23 +00:00
Francis Ricci 7f9fbec3e8 Skip TestDisassembleRawData when remote
Summary:
As this test will create a new target, it will cause all following tests
to fail when running in platform mode, if the new target does not match
the existing architecture (for example, x86 vs x86_64).

Reviewers: zturner, spyffe, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D21906

llvm-svn: 274364
2016-07-01 16:47:44 +00:00
Sean Callanan 3696f86188 Removed the redundant "%d errors parsing expression" error. Nobody keeps score.
<rdar://problem/24306284>

llvm-svn: 274254
2016-06-30 18:00:32 +00:00
Omair Javaid fbfc7170fe Correct watchpoint size test failure on certain devices
I overlooked the possibility of certain targets translating increment statement into a read and write.
In this case we replace increment statement with an assignment.

llvm-svn: 274215
2016-06-30 07:09:46 +00:00
Pavel Labath 7cbd742e3b XFAIL tests which fail with gcc on linux
llvm-svn: 274116
2016-06-29 10:16:14 +00:00
Todd Fiala 3d2c1e6a7c fix invalid assumption about the executable module in Target::Install()
Target::Install() was assuming the module at index 0 was the executable.
This is often true, but not guaranteed to be the case.  The
TestInferiorChanged.py test highlighted this when run against iOS.
After the binary is replaced in the middle of the test, it becomes the
last module in the list.  The rest of the Target::Install() logic then
clobbers the executable file by using whatever happens to be the first
module in the target module list.

This change also marks the TestInferiorChanged.py test as a no-debug-info
test.

llvm-svn: 273960
2016-06-27 23:21:49 +00:00
Greg Clayton d7f71add86 Made templates that have Enumeration values as arguments work correctly.
We were checking for integer types only before this. So I added the ability for CompilerType objects to check for integer and enum types.

Then I searched for places that were using the CompilerType::IsIntegerType(...) function. Many of these places also wanted to be checking for enumeration types as well, so I have fixed those places. These are in the ABI plug-ins where we are figuring out which arguments would go in where in regisers/stack when making a function call, or determining where the return value would live. The real fix for this is to use clang to compiler a CGFunctionInfo and then modify the code to be able to take the IR and a calling convention and have the backend answer the questions correctly for us so we don't need to create a really bad copy of the ABI in each plug-in, but that is beyond the scope of this bug fix.

Also added a test case to ensure this doesn't regress in the future.

llvm-svn: 273750
2016-06-24 23:48:00 +00:00
Francis Ricci a8a044c194 Don't run TestImageListMultiArchitecture during remote test suite
Reviewers: zturner, clayborg, tfiala

Subscribers: sas, lldb-commits

Differential Revision: http://reviews.llvm.org/D21648

llvm-svn: 273720
2016-06-24 20:44:23 +00:00
Sean Callanan 2e6d2d4820 Added a test case for bitfield ivars. It currently fails.
<rdar://problem/17990991>

llvm-svn: 273718
2016-06-24 20:41:18 +00:00
Enrico Granata fbaab6d573 Fix an issue where LLDB would show the key and value of a single entry NSDictionary in the wrong order
Fixes rdar://26478641

llvm-svn: 273695
2016-06-24 17:48:01 +00:00
Sean Callanan 5b42f4b8f4 Handle variadic Objective-C methods from DWARF correctly.
<rdar://problem/22039804>

llvm-svn: 273632
2016-06-24 00:24:40 +00:00
Sean Callanan c17cb815ac Don't run the top-level expression test case with -gmodules.
<rdar://problem/26563587>

llvm-svn: 273622
2016-06-23 22:18:08 +00:00
Sean Callanan d3e2d97229 Test that lldb calls the right 'printf' even when a 'printf' method exists.
This test is currently failing.  We have a bug for it, as noted.

llvm-svn: 273211
2016-06-20 23:01:11 +00:00
Omair Javaid 43507f573d Allow installing watchpoints at less than 8-byte alligned addresses for AArch64 targets
This patch allows LLDB for AArch64 to watch all bytes, words or double words individually on non 8-byte alligned addresses.

This patch also adds tests to verify this functionality.

Differential revision: http://reviews.llvm.org/D21280

llvm-svn: 272916
2016-06-16 16:41:22 +00:00
Todd Fiala 85bc3f83f4 xfail TestWithModuleDebugging.py on macOS
Tracked by:
https://llvm.org/bugs/show_bug.cgi?id=28156

llvm-svn: 272902
2016-06-16 15:22:49 +00:00
Greg Clayton 9e3ee13a1c Fixed C++ template integer parameter types to work correctly when the integer type is signed.
Prior to this we would display the typename for "TestObj<-1>" as "TestObj<4294967295>" when we showed the type. Expression parsing could also fail because we would fail to find the mangled name when evaluating expressions.

The issue was we were losing the signed'ness of the template integer parameter in DWARFASTParserClang.cpp.

<rdar://problem/25577041>

llvm-svn: 272434
2016-06-10 20:56:09 +00:00
Pavel Labath b519f9fa61 Enable some tests on linux
This enables a couple of tests which have been shown to run reliably on the
linux x86 buildbot. If you see a failure after this commit, feel free to add
the xfail back, but please make it as specific as possible (i.e., try to make
it not cover i386/x86_64 with clang-3.5, clang-3.9 or gcc-4.9).

llvm-svn: 272326
2016-06-09 22:39:36 +00:00
Jim Ingham 19e88c1ff6 Add a test for the failure described by pr28055. Mark it as xfail.
llvm-svn: 272189
2016-06-08 19:06:00 +00:00
Pavel Labath f0f62d8451 Revert "Make lldbinline.py regenerate the Makefile each time it builds."
This reverts commit r272024 as it is not windows-compatible.

llvm-svn: 272062
2016-06-07 21:29:46 +00:00
Sean Callanan 968bb72f58 Make lldbinline.py regenerate the Makefile each time it builds.
If a lldbinline test's source file changed language, then the Makefile wasn't
updated.  This was a problem if the Makefile was checked into the repository.

Now lldbinline.py always regenerates the Makefile and asserts if the
newly-generated version is not the same as the one already there.  This ensures
that the repository will never be out of date without a buildbot failing.

http://reviews.llvm.org/D21032

llvm-svn: 272024
2016-06-07 17:22:18 +00:00
Tamas Berghammer 50ce381a5c Fix makefile for TestExternCSymbols
llvm-svn: 271618
2016-06-03 01:03:04 +00:00
Sean Callanan 34ab28a470 Fixed a problem where we couldn't call extern "C" functions.
Some compilers do not mark up C++ functions as extern "C" in the DWARF, so LLDB
has to fall back (if it is about to give up finding a symbol) to using the base
name of the function.

This fix also ensures that we search by full name rather than "auto," which
could cause unrelated C++ names to be found.  Finally, it adds a test case.

<rdar://problem/25094302>

llvm-svn: 271551
2016-06-02 17:59:47 +00:00
Devin Coughlin a10ab76b16 [tsan] Prefer mangled name looking up variable declaration for racy address
For Thread Sanitizer reports, LLDB tries to find a global variable declaration
corresponding to the racy address in order to provide a filename and line
number. This commit changes the lookup of the variable to use the mangled
name for lookup and fall back to the demangled version if unavailable. This
is needed to report locations of races on Swift global variables.

I've also added a test to make sure we look up C++ globals correctly.

rdar://problem/26459401

Differential Revision: http://reviews.llvm.org/D20760

llvm-svn: 271433
2016-06-01 21:32:45 +00:00
Todd Fiala 94eb010fe9 Add "-gmodules" support to the test suite.
This change adds the capability of building test inferiors
with the -gmodules flag to enable module debug info support.
Windows is excluded per @zturner.

Reviewers: granata.enrico, aprantl, zturner, labath

Subscribers: zturner, labath, lldb-commits

Differential Revision: http://reviews.llvm.org/D19998

llvm-svn: 270848
2016-05-26 13:57:03 +00:00
Pavel Labath 0314b00daa Avoid using stdio in TestVirtual
Summary:
using stdio in tests does not work on windows, and it is not completely reliable on linux.
Avoid using stdio in this test, as it is not necessary for this purpose.

Reviewers: clayborg

Subscribers: lldb-commits, zturner

Differential Revision: http://reviews.llvm.org/D20567

llvm-svn: 270831
2016-05-26 08:38:02 +00:00
Enrico Granata fee0aba006 It has been brought to my attention that, given two variables
T x;
U y;

doing

x = *((T*)y)

is undefined behavior, even if sizeof(T) == sizeof(U), due to pointer aliasing rules

Fix up a couple of places in LLDB that were doing this, and transform them into a defined and safe memcpy() operation

Also, add a test case to ensure we didn't regress by doing this w.r.t. tagged pointer NSDate instances

llvm-svn: 270793
2016-05-25 23:19:01 +00:00
Omair Javaid 1b356bf898 Mark some aarch64-linux specific xfails marking bug entries
TestBSDArchives.py and TestWatchLocation.py fail due to unicode error and bug has already been reported for arm and macOSx.

TestConstVariables.py fails because lldb cant figure out frame variable type when used in expr.

llvm-svn: 270780
2016-05-25 22:30:05 +00:00
Enrico Granata f02be230f6 Fix an issue where LLDB would crash if one tried to 'frame variable' an unordered_map more than once in a stop due to the synthetic provider not properly caching the ValueObjects it was returning for the child elements
Fixes rdar://26470909

llvm-svn: 270752
2016-05-25 20:38:33 +00:00
Omair Javaid 0d435b6933 Mark some arm-linux specific xfails marking bug entries
TestCallUserAnonTypedef.py and TestIRInterpreter.py fail to limitation of JIT expressions in handling hard float ABI targets.
TestBSDArchives.py fails due to python unicode error.
TestBuiltinTrap.py fails due to wrong line information generated by some gcc versions.

llvm-svn: 270745
2016-05-25 18:48:39 +00:00
Ed Maste dfbdf80962 xfail TestRedefinitionsInline with older Clang
This fails on FreeBSD 10 with the system compiler, Clang 3.4.1.

llvm.org/pr27845

llvm-svn: 270603
2016-05-24 19:51:11 +00:00
Chaoren Lin 1245c2b39b Make sure TestRedefinitionsInInlines.py actually inlines.
Reviewers: spyffe

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D20540

llvm-svn: 270493
2016-05-23 21:44:34 +00:00
Zachary Turner 76f3def58a xfail TestRedefinitionsInline on Windows.
llvm-svn: 270490
2016-05-23 21:22:11 +00:00
Sean Callanan 5ba3215fe3 Removed the m_decl_objects map from ClangASTContext.
m_decl_objects is problematic because it assumes that each VarDecl has a unique
variable associated with it.  This is not the case in inline contexts.

Also the information in this map can be reconstructed very easily without
maintaining the map.  The rest of the testsuite passes with this cange, and I've
added a testcase covering the inline contexts affected by this.

<rdar://problem/26278502>

llvm-svn: 270474
2016-05-23 18:30:59 +00:00
Zachary Turner fa7f948237 Always rerun all tests on Windows.
There is flakiness somewhere in the core infrastructure on Windows,
so to get the buildbot reliably green we need to mark all tests
as flaky.

llvm-svn: 270460
2016-05-23 17:32:04 +00:00
Kuba Brecka 52ded8072a Reword ThreadSanitizer message for invalid mutex reports.
llvm-svn: 270364
2016-05-22 14:32:45 +00:00
Jim Ingham 906d91e762 Fix error propagation from the Z0 packet in gdb-remote breakpoint setting.
The error was not getting propagated to the caller, so the higher layers thought the breakpoint
was successfully set & resolved.

I added a testcase, but it assumes 0x0 is not a valid place to set a breakpoint.  On most systems
that is true, but if it isn't true of your system, either find another good place and add it to the
test, or x-fail the test.

<rdar://problem/26345962>

llvm-svn: 270014
2016-05-19 02:13:44 +00:00
Omair Javaid bc782a866b xfail TestTopLevelExprs for arm and aarch64 linux
TestTopLevelExprs fails on arm and aarch64 linux similar to behaviour on android.
A bug exists here: llvm.org/pr27787. 

This patch marks xfail on arm and aarch64.

llvm-svn: 269980
2016-05-18 20:45:12 +00:00
Omair Javaid c675cfa8a9 xfail TestWatchLocation.py for arm-linux targets
TestWatchLocation.py fails on arm-linux target due to unicode error in lldb testsuite.
This is a known issue and same test fails on OS X with similar reason.
I have reported a bug and marked this test as xfail for arm-linux targets.

llvm-svn: 269860
2016-05-17 23:01:56 +00:00
Zachary Turner 8d4d151bb2 Allow custom formatting of session log file names.
Differential Revision: http://reviews.llvm.org/D20306

llvm-svn: 269793
2016-05-17 18:02:34 +00:00
Tamas Berghammer 75f8f6e111 xfail TestTopLevelExprs for Android API 21-22 (llvm.org/pr27787)
llvm-svn: 269759
2016-05-17 12:42:25 +00:00
Sean Callanan 84fee5852c Fixed and re-enabled the Clang modules testcase.
Macros work again after Clang r269554.  This testcase just needed some small
tweaks to get it going again.

llvm-svn: 269704
2016-05-16 21:11:21 +00:00
Sean Callanan da255efa2a Test diamond virtual inheritance in top-level expressions.
llvm-svn: 269698
2016-05-16 20:55:10 +00:00
Enrico Granata 429e1f9b1d Make LLDB print out an explicit marker when it's displaying formatters that are part of a disabled category
Fixes rdar://26202006

llvm-svn: 269673
2016-05-16 17:27:26 +00:00
Omair Javaid 32558a1615 Xfail TestCrashDuringStep and TestCreateDuringInstructionStep on arm-linux
Both of above tests fail on arm and bugs have been reported on android already.
Adding arm-linux decorator because android decorator doesnt xfail these test when run on linux. 

llvm-svn: 269647
2016-05-16 11:21:49 +00:00
Saleem Abdulrasool 0eadc53f6d test: remove use of undefined variables
The variables referenced in the print message are not defined.  Simply state
that the requisite script is not found.  Correct grammar to indicate that the
tests are rather likely to fail rather than unlikely to fail.

llvm-svn: 269628
2016-05-16 03:13:12 +00:00
Saleem Abdulrasool c0d0e36197 test: add missing splat
The parameter here is a list, not a string.  Ensure that the we splat the list
into arguments prior to invoke os.path.join.  This would previously fail with a
`startswith` is not a member of `list`.

llvm-svn: 269627
2016-05-16 03:13:08 +00:00
Saleem Abdulrasool 81eadde6ca test: add missing parameter
Add the missing required parameter to the function.  This permits tests to get a
bit further before failing.

llvm-svn: 269626
2016-05-16 03:13:05 +00:00
Todd Fiala 4728cf7e85 surface build error content through test event system
Summary:
print build errors nicely in test output

This test infrastructure change adds a new Python exception
for test subject builds that fail.  The output of the build
command is captured and propagated to both the textual test
output display code and to the test event system.

The ResultsFormatter objects have been modified to do something
more useful with this information.  The xUnit formatter
now replaces the non-informative Python build error stacktrace
with the build error content.  The curses ResultsFormatter
prints a 'B' for build errors rather than 'E'.

The xUnit output, in particular, makes it much easier for
developers to track down test subject build errors that cause
test failures when reports come in from CI.

Reviewers: granata.enrico

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20252

llvm-svn: 269525
2016-05-14 00:42:30 +00:00
Todd Fiala 7c5f7caa20 test infra: catch bad decorators and import-time errors
Summary:
This change enhances the LLDB test infrastructure to convert
load-time exceptions in a given Python test module into errors.
Before this change, specifying a non-existent test decorator,
or otherwise having some load-time error in a python test module,
would not get flagged as an error.

With this change, typos and other load-time errors in a python
test file get converted to errors and reported by the
test runner.

This change also includes test infrastructure tests that include
covering the new work here.  I'm going to wait until we have
these infrastructure tests runnable on the main platforms before
I try to work that into all the normal testing workflows.

The test infrastructure tests can be run by using the standard python module testing practice of doing the following:

cd packages/Python/lldbsuite/test_event
python -m unittest discover -s test/src -p 'Test*.py'

Those tests run the dotest inferior with a known broken test and verify that the errors are caught.  These tests did not pass until I modified dotest.py to capture them properly.

@zturner, if you have the chance, if you could try those steps above (the python -m unittest ... line) on Windows, that would be great if we can address any python2/3/Windows bits there.  I don't think there's anything fancy, but I didn't want to hook it into test flow until I know it works there.

I'll be slowly adding more tests that cover some of the other breakage I've occasionally seen that didn't get collected as part of the summarization.  This is the biggest one I'm aware of.

Reviewers: zturner, labath

Subscribers: zturner, lldb-commits

Differential Revision: http://reviews.llvm.org/D20193

llvm-svn: 269489
2016-05-13 21:36:26 +00:00
Zachary Turner 4fd6a96008 Clean up test results on Windows.
Remove XFAIL from some tests that now pass.
Add XFAIL to some tests that now fail.
Fix a crasher where a null pointer check isn't guarded.
Properly handle all types of errors in SymbolFilePDB.

llvm-svn: 269454
2016-05-13 18:26:30 +00:00
Greg Clayton ff8e6a763f Fix libstdc++ failure where <atomic> is not able to be imported on Darwin systems.
The adding of <atomic> to test_common.h broke 12 tests on Darwin. We work around this by not including <atomic> when building on darwin for libstdc++ tests.

llvm-svn: 269372
2016-05-12 22:33:02 +00:00
Cameron Desrochers 739fc77c01 Added missing makefile from patch D19124 (should fix the corresponding commit rL269340)
llvm-svn: 269366
2016-05-12 22:10:16 +00:00
Marianne Mailhot-Sarrasin 3fe7158174 [LLDB] Added support for PHI nodes to IR interpreter
This allows expressions such as 'i == 1 || i == 2` to be executed using the IR interpreter, instead of relying on JIT code injection (which may not be available on some platforms).

Patch by cameron314

Differential Revision: http://reviews.llvm.org/D19124

llvm-svn: 269340
2016-05-12 20:00:53 +00:00
Omair Javaid 86e0dd5c1c Xfail failing watchpoint tests on aarch64-linux
Some watchpoint tests fail on aarch64-linux as it lacks support for intalling watchpoints which are not alligned at 8bytes boundary.

Marking them as xfail for now. 

llvm-svn: 269187
2016-05-11 13:57:20 +00:00