Commit Graph

3174 Commits

Author SHA1 Message Date
Chaoren Lin f7160f3fba XFail pexpect tests for Windows hosts.
Reviewers: vharron, zturner

Subscribers: lldb-commits

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

llvm-svn: 239414
2015-06-09 17:39:27 +00:00
Chaoren Lin e6eea5d055 Skip TestInferiorChanged if host platform is windows.
Summary: Opened files on Windows cannot be modified, so this test doesn't make sense.

Reviewers: ovyalov, zturner, flackr, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 239359
2015-06-08 22:13:28 +00:00
Bruce Mitchener 1425b47773 [LLDB-MI] Properly detect missing mandatory arguments to MI commands
Summary:
Previously if an MI command had **X** mandatory and **Y** optional arguments you could provide **X** or more optional arguments without providing any of the mandatory arguments, and the argument validation code wouldn't complain.

For example this would pass argument validation even though the mandatory **address** and **count** arguments are missing:

-data-read-memory-bytes --thread 1 --frame 0

Part of the problem was that an empty string was considered a valid value for a mandatory argument, which didn't make much sense.

Patch by Vadim Macagon. Thanks!

Test Plan:
./dotest.py -A x86_64 -C clang --executable $BUILDDIR/bin/lldb tools/lldb-mi/

No unexpected failures on my Ubuntu 14.10 64bit Virtualbox VM.

Reviewers: domipheus, ki.stfu, abidh

Reviewed By: ki.stfu, abidh

Subscribers: brucem, lldb-commits

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

llvm-svn: 239297
2015-06-08 11:15:09 +00:00
Chaoren Lin a4447b338c Update dosep to display dotest command invoked on failure.
llvm-svn: 239258
2015-06-07 18:50:40 +00:00
Chaoren Lin bcd2786a6d Use skipIf instead of skipUnless in TestTerminal for better readability.
llvm-svn: 239220
2015-06-06 14:51:34 +00:00
Chaoren Lin 5d76b1b56e Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.
Summary: Updated `append_to_remote_wd` to work for both remote and local.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239203
2015-06-06 00:25:50 +00:00
Chaoren Lin 05763f5752 Update TestGdbRemoteAbort and TestGdbRemoteSegFault to use `get_signal_number`.
Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 239201
2015-06-06 00:19:01 +00:00
Chaoren Lin bb2cc9cf56 Unique file names for TestStarted and TestFinished.
Summary: This fixes the issue of multiple test suites opening the same file for writing.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 239188
2015-06-05 21:08:24 +00:00
Siva Chandra 77f20fc8d3 [TestGdbRemoteAbort] Skip on API 16 Android devices
Summary:
This change also adds the infrastructure required to specify the API
levels for which tests should be skipped.

Reviewers: chying, labath

Reviewed By: labath

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239183
2015-06-05 19:54:49 +00:00
Siva Chandra 29e0392944 [lldbtest] Use netloc instead of hostname to look up Android device ID.
Summary:
urlparse.ParseResult.hostname has only lowercase characters even if the
input URL had uppercase characters. Since Android device IDs can have
uppercase characters as well, use urlparse.ParseResult.netloc instead
and extract the device ID from it.

This change also improves the error message when lookup of the Android
device's API fails.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239173
2015-06-05 18:07:10 +00:00
Chaoren Lin 52cf8ecc23 Check before using platform specific attributes.
Summary: `os.uname` in TestUniversal and `os.geteuid` in TestTerminal.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 239135
2015-06-05 06:28:43 +00:00
Siva Chandra 8af9166efe [TestChangeProcessGroup] Mark the test as xfail for Android API 16
Summary:
This change adds the infrastructure to mark tests as xfail for specific
Android API levels.

Test Plan: dotest.py TestChangeProcessGroup on an Android API 16 device.

Reviewers: chying, labath, chaoren

Reviewed By: labath, chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239126
2015-06-05 00:22:49 +00:00
Siva Chandra d772ef3d9f [TestGdbRemoteRegisterState] Do not flip ARM *psr register in the test
Summary:
Not all of that register is readable/writable in user mode. This means
that even if the inferior is stopped, parts of the register could be
changing. So, do not flip this register to check if its value can be
restored.

Reviewers: tberghammer, chaoren

Reviewed By: tberghammer

Subscribers: rengolin, aemerson, lldb-commits

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

llvm-svn: 239104
2015-06-04 22:04:04 +00:00
Ed Maste 8eeb3e290d Skip test failing on FreeBSD buildbot due to pexepect issues
The pexpect exception is not handled by expectedFailureFreeBSD, so just
skip the test for now.

llvm.org/pr22784

llvm-svn: 238977
2015-06-03 21:21:40 +00:00
Ed Maste dc8dd07e17 XFAIL TestPlatformCommand test failing on the FreeBSD buildbot
llvm.org/pr23747

llvm-svn: 238976
2015-06-03 21:21:00 +00:00
Enrico Granata d595733617 Fix a bug where trying to Dump() a ValueObject would use the static/non-synthetic version of the value even if the ValueObject one actually called Dump() on turned out to be dynamic and/or synthetic
This was of course overridable by using DumpValueObjectOptions, but the default should be saner and the previous behavior made for a few fun investigations....

rdar://problem/21065149

llvm-svn: 238961
2015-06-03 20:43:54 +00:00
Greg Clayton b2e0c11982 Fixed "format-string" based settings so they can have quotes on them without leaving the quotes in the format string:
(lldb) settings set thread-format "abc"
(lldb) settings set thread-format 'abc'
(lldb) settings set thread-format abc

We strip the quotes before processing the format string and return an "error: mismatched quotes" if mismatched quotes are given.

<rdar://problem/21210789>

llvm-svn: 238896
2015-06-03 02:02:48 +00:00
Chaoren Lin e79b472162 Update TestConcurrentEvents to use UnixSignals instead of python signals.
Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 238872
2015-06-02 21:54:22 +00:00
Greg Clayton 5e3f20d791 Fixed the logic to determine the TRIPLE_VERSION correctly when it isn't specified.
llvm-svn: 238871
2015-06-02 21:42:31 +00:00
Greg Clayton 315b88d0cf Added the ability for the "make" command to take a triple:
% cd lldb/test/lang/c/array_types
% make TRIPLE=x86_64-apple-ios
% make clean
% make TRIPLE=x86_64-apple-ios8.1
% make clean
% make TRIPLE=armv7-apple-ios
% make clean
% make TRIPLE=armv7-apple-ios8.1
% make clean

The TRIPLE variable will automatically set the following variables:
    SDKROOT if it isn't specified manually
    ARCH will be set to the architecture from the triple
    CFLAGS will include the extras needed for the triple which are set in TRIPLE_CFLAGS
    TRIPLE_VENDOR set to the triple vendor ("apple" in the above cases)
    TRIPLE_OS set to the triple OS ("ios" in the above cases)
    TRIPLE_VERSION set to the version that was specified, or automatically set to the SDK version if it is missing

This allows you to change directory into any test case on MacOSX and quickly build for desktop:

% make

iOS simulator:

% make TRIPLE=x86_64-apple-ios

or iOS device:

% make TRIPLE=armv7-apple-ios

llvm-svn: 238869
2015-06-02 21:38:10 +00:00
Chaoren Lin c168c92b78 Use wildcard instead of relying on shell globbing.
Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 238859
2015-06-02 19:07:26 +00:00
Chaoren Lin 264e542083 Check that debugger is valid before enumerating targets.
Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238857
2015-06-02 18:31:57 +00:00
Ed Maste e1abaf870f TestGlobalVariables no longer fails on FreeBSD
It has passed since ~ r223393.

llvm.org/21599

llvm-svn: 238856
2015-06-02 18:29:42 +00:00
Chaoren Lin 677acee503 Use new get_signal_number utility function for tests.
Summary:
This fixes TestLldbGdbServer and TestSendSignal from Windows to Android.
This change depends on D10171.

Reviewers: clayborg, ovyalov

Reviewed By: clayborg, ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238852
2015-06-02 17:01:13 +00:00
Chaoren Lin f59d050968 Added utility function to get correct signal number from remote platform.
Summary:
This change adds a utility that uses the `kill -l` command to get the
correct signal number. Falls back to using `SBUnixSignals`, and finally
`signal.SIG<signal>` if all else fails.

Reviewers: tberghammer, clayborg, ovyalov

Reviewed By: clayborg, ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238850
2015-06-02 16:46:28 +00:00
Chaoren Lin 7d76a13bf3 Fix OBJCOPY and AR for Android.
Summary:
Previously, OBJCOPY was empty because of the missing comma,
and ar was just `ar`.

Reviewers: ovyalov, tberghammer

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 238849
2015-06-02 16:43:19 +00:00
Tamas Berghammer 0b11db50dd Mark TestHelloWorld as XTIMEOUT for Linux
It is times out on the build bot ~10% of the times

llvm-svn: 238836
2015-06-02 14:45:25 +00:00
Ed Maste c5603ec44c Skip TestChangeProcessGroup on FreeBSD for now
It consistently times out. The test is already XTIMEOUT'd, but causes
tests to take an extra 5 minutes waiting for the timeout to expire.

llvm.org/pr23731

llvm-svn: 238833
2015-06-02 14:11:25 +00:00
Pavel Labath 8e9c266a77 Un-enable TestEvents test on linux
Test still seems to fail about 1/10 runs. Skipping the test, but it a more greppable fashion.

llvm-svn: 238826
2015-06-02 12:50:25 +00:00
Pavel Labath e0f9708410 Enable TestEvents test on linux
This test was very inconspicuosly skipped on linux, when it was crashing for local debugging. It
seems to work fine with LLGS, so I'm enabling it.

llvm-svn: 238816
2015-06-02 10:19:33 +00:00
Adrian McCarthy 3ae7492b2d Fix TestJoinAfterBreak test on Windows
llvm-svn: 238787
2015-06-01 21:51:50 +00:00
Chaoren Lin 273aea894f Dump error if dotest itself fails and no tests were run.
Reviewers: zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 238771
2015-06-01 19:06:01 +00:00
Chaoren Lin 5e3ab2b95f Updated dosep.py to output progress and dump std{out,err} on test failure.
Reviewers: vharron, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 238765
2015-06-01 17:49:25 +00:00
Ed Maste 85f84e0b74 XFAIL additional signal vs exception tests failing on FreeBSD
We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238616
2015-05-29 21:42:53 +00:00
Ed Maste 0b8bbc6dfd XFAIL TestHandleSegv on FreeBSD
We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238615
2015-05-29 21:34:12 +00:00
Ed Maste 375432e4d8 Improve test for g++ 4.6
Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

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

llvm-svn: 238603
2015-05-29 19:52:02 +00:00
Ed Maste 36cbc0901f TestHandleSegv: also assert that we have a thread
If get_stopped_thread(... eStopReasonSignal) returns no thread, the
thread.IsValid assertion would throw AttributeError: 'NoneType' object
has no attribute 'IsValid'.

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

llvm-svn: 238600
2015-05-29 19:38:41 +00:00
Chaoren Lin 9d2b7f982c Fix hanging test suite when dosep.py is invoked directly.
Reviewers: zturner, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238594
2015-05-29 18:43:46 +00:00
Hafiz Abid Qadeer ba9614f643 Improve handling of print value argument in -stack-list-* commands.
It was reviewed in http://reviews.llvm.org/D10106.
Patch by paulmaybee.

llvm-svn: 238572
2015-05-29 16:48:40 +00:00
Pavel Labath 674bc7b0c4 XFAIL two tests for android
bug #23694

llvm-svn: 238558
2015-05-29 14:54:46 +00:00
Pavel Labath c4e25c9648 Report inferior SIGSEGV as a signal instead of an exception on linux
Summary:
Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception"
to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the
user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since
LLDB was unable to reinject this signal back into the inferior.

This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the
test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it
uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with
signal=SIGSEGV.

I have also added the ability to set the description of StopInfoUnixSignal using the description
field of the gdb-remote packet. The linux stub uses this to display additional information about
the segfault (invalid address, address access protected, etc.).

Test Plan: All tests pass on linux and osx.

Reviewers: ovyalov, clayborg, emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 238549
2015-05-29 10:13:03 +00:00
Siva Chandra de4c598ccf [TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"
Summary:
Old Android devices, for example API 16, do not have the "readlink"
command. To take care of such devices, this commit changes to use "ls -l"
instead of "readlink" to get the lldb-server exe path.

The tests fixed with this change for an Android API 16 arm device are:

TestGdbRemoteAttach
TestGdbRemoteAuxvSupport
TestGdbRemoteExpeditedRegisters
TestGdbRemoteKill
TestGdbRemoteProcessInfo
TestGdbRemoteSegFault
TestGdbRemoteThreadsInStopReply
TestGdbRemote_qThreadStopInfo

Further, all tests in TestLldbGdbServer pass (previously erroring out),
except one which times out.

Test Plan:
Run dosep.py with 8 test threads targetting Android API 16
device.

Reviewers: vharron, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 238532
2015-05-29 00:14:16 +00:00
Greg Clayton b30c50c8fa Add a new "qEcho" packet with the following format:
qEcho:%s

where '%s' is any valid string. The response to this packet is the exact packet itself with no changes, just reply with what you received!

This will help us to recover from packets timing out much more gracefully. Currently if a packet times out, LLDB quickly will hose up the debug session. For example, if we send a "abc" packet and we expect "ABC" back in response, but the "abc" command takes longer than the current timeout value this will happen:


--> "abc"
<-- <<<error: timeout>>>

Now we want to send "def" and get "DEF" back:

--> "def"
<-- "ABC"

We got the wrong response for the "def" packet because we didn't sync up with the server to clear any current responses from previously issues commands.

The fix is to modify GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock() so that when it gets a timeout, it syncs itself up with the client by sending a "qEcho:%u" where %u is an increasing integer, one for each time we timeout. We then wait for 3 timeout periods to sync back up. So the above "abc" session would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- "abc"
<-- "qEcho:1"

The first timeout is from trying to get the response, then we know we timed out and we send the "qEcho:1" packet and wait for 3 timeout periods to get back in sync knowing that we might actually get the response for the "abc" packet in the mean time...

In this case we would actually succeed in getting the response for "abc". But lets say the remote GDB server is deadlocked and will never response, it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second

We then disconnect and say we lost connection.

We might also have a bad GDB server that just dropped the "abc" packet on the floor. We can still recover in this case and it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- "qEcho:1"

Then we know our remote GDB server is still alive and well, and it just dropped the "abc" response on the floor and we can continue to debug.

<rdar://problem/21082939>

llvm-svn: 238530
2015-05-29 00:01:55 +00:00
Chaoren Lin 9acea45e19 Fix TestMultithreaded.
llvm-svn: 238529
2015-05-29 00:01:15 +00:00
Ying Chen 10ed1a9ce7 Add "Failing Tests .." line to dosep logs
Summary:
-Buildbot parser depends on this line as start flag
-Will remove the dependency from buildbot parser, but it takes some time to take effect
-Will remove this line from printout after buildbot master reconfig

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238527
2015-05-28 23:51:49 +00:00
Chaoren Lin 45c17ff6c2 Remove warning when testing for timeout command.
llvm-svn: 238522
2015-05-28 23:00:10 +00:00
Sean Callanan cc3489f662 Added a test that makes sure that structs returned
from expressions return intact.

<rdar://problem/21146609>

llvm-svn: 238512
2015-05-28 21:58:52 +00:00
Chaoren Lin 842b214ac1 Simplify regex in TestDataFormatterUnordered.py for better readability.
Summary:
Using `(match){3}` instead of `matchmatchmatch`.
This is an update to D10078.

Test Plan: no change in test behavior.

Reviewers: clayborg, sivachandra

Reviewed By: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238510
2015-05-28 21:52:07 +00:00
Ying Chen 1135e709c0 Skip ThreadStateTestCase.test_state_after_continue_with_dwarf on Darwin
Summary:
- This test cause Python crash randomly on darwin builder
- Tracked by bug 'llvm.org/pr23669'

Test Plan: ./dotest.py -m --executable /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/lldb --framework /Users/lldb_build/testSlave/buildDir/lldb.src/build/Debug/LLDB.framework -A x86_64 -C clang -p TestThreadStates.py

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238495
2015-05-28 21:03:26 +00:00
Zachary Turner c7a7c8acca Refactor test runner to print sub-test-case pass/fail rate.
llvm-svn: 238467
2015-05-28 19:56:26 +00:00