Commit Graph

2294 Commits

Author SHA1 Message Date
Todd Fiala 9f72b3a1ce Modify debugserver to follow gdb remote $qC protocol definition.
$qC from debugserver now returns the current thread's thread-id (and, like $?, will set a current thread if one is not already selected).  Previously it was returning the current process id.

lldb will now query $qProcessInfo to retrieve the process id.  The process id is now cached lazily and reset like other cached values.  Retrieval of the process id will fall back to the old $qC method for vendor==Apple and os==iOS if the qProcessInfo retrieval fails.

Added a gdb remote protocol-level test to verify that $qProcessInfo reports a valid process id after launching a process, while the process is in the initial stopped state.  Verifies the given process id is a currently valid process on host OSes for which we know how to check (MacOSX, Linux, {Free/Net}BSD).  Ignores the live process check for OSes where we don't know how to do this.  (I saw no portable way to do this in stock Python without pulling in other libs).

llvm-svn: 208241
2014-05-07 19:28:21 +00:00
Todd Fiala f9c3c9fe44 gdbremote testing: added regex support to match packets and propagate/test against previously stored matches.
Added a test validating that $qC after an inferior launch via $A
returns a thread id that an immediately followig $? reports for the
active thread. This is currently skipped on debugserver (the thread
ids don't match) and isn't yet implemented in TOT for llgs.

llvm-svn: 208061
2014-05-06 06:15:23 +00:00
Todd Fiala 6764c00687 Refactored gdb remote protocol testing sequence handling.
Pushed gdbremote protocol sequence expectations into a separate
class and defer matching of llgs/debugserver output to the
sequence entry.  Pre-step to adding regex matching and
grouped content collecting.

No longer require anything before the read/send packet
portion of slurped-up log lines used for setting up
gdb remote test sequences.  Several packet logging options
produce a wide range of content before the read/send packet.

Added helpers to TestLldbGdbServer to clean up test setup
and test expectations matching.

llvm-svn: 207998
2014-05-05 20:54:01 +00:00
Todd Fiala 41c60c818f Added gdb remote protocol tests for no output and inferior non-zero exit code.
Tests added for debugserver and lldb-gdbserver.  lldb-gdbserver marked as
XFAIL on top of tree.

Added build_gdbremote_A_packet test helper to construct a gdbremote A
launch packet from a list of args.

llvm-svn: 207568
2014-04-29 18:21:07 +00:00
Ed Maste 993fa0604d Fix interval recalculation in the event that usleep is interrupted
llvm-svn: 207566
2014-04-29 18:09:44 +00:00
Ed Maste 5c4661881b Add decorator for FreeBSD buildbot failure
llvm.org/pr19605

llvm-svn: 207557
2014-04-29 17:00:45 +00:00
Todd Fiala 56b25f74ce Added debugserver/llgs protocol test for output and clean exit.
Tests for $vCont;c program start, $O output and $W status code.
@llgs_test variant currently marked as expected fail.

llvm-svn: 207492
2014-04-29 05:01:01 +00:00
Todd Fiala 9164d9b304 Fixed up lldb-gdbserver to match slightly different debugserver listener host:port message.
Fixed up typo in lldb-gdbserver name missed when working on the OS X side earlier today for debugserver support.

llvm-svn: 207398
2014-04-28 06:04:46 +00:00
Todd Fiala a41d48cac8 Added two new test types: @debugserver_test and @llgs_test.
TestLldbGdbServer now supports both lldb-gdbserver (llgs) and
debugserver tests.  Similar to the dsym/dwarf tests, they allow
running the same underlying gdb remote protocol tests against
lldb-gdbserver and debugserver.  This will help make sure the
protocol-level tests for lldb-gdbserver faithfully represent
what debugserver does on OS X.

Switched back gdb remote protocol test logging to warning
and above (accidentally submitted it at debug level in a
recent commit).

llvm-svn: 207395
2014-04-28 04:49:40 +00:00
Todd Fiala 260323dba6 Added TestLldbGdbServer test for A start exe packet.
Fixed up bug in XFAIL tests where I appended an array when I intended to merge an array.

llvm-svn: 207285
2014-04-25 23:08:24 +00:00
Todd Fiala 98118c38a3 Prevent TestLldbGdbServer shutdown cleanup failures from failing the test.
Adds try/except blocks around clean-up code. Prevents a race between gdb
remote kill command reception by llgs (which leads llgs to shut down)
and the pexpect server kill (which can fail if the kill command handling
completes first). Warnings are emitted on the logger for any clean-up
code that fails.

llvm-svn: 207273
2014-04-25 21:09:28 +00:00
Todd Fiala 6817df65f0 Modify TestSettings test for stderr.txt/stdout.txt to ignore an
optional path prior to the file base name.

On Linux x86_64 (Ubuntu 12.04) I am sometimes getting a full path
on the stderr.txt.  This changes the test for target.error-path and
target.output-path settings to ignore any optional directory before
the expected file base name.

llvm-svn: 207272
2014-04-25 21:04:48 +00:00
Jason Molenda b9ffa98cab Add a new SBThread::GetQueue() method to get the queue that is
currently associated with a given thread, on relevant targets.

Change the queue detection code to verify that the queues 
associated with all live threads are included in the list.
<rdar://problem/16411314> 

llvm-svn: 207160
2014-04-25 00:01:15 +00:00
Ed Maste 433790a69c Remove duplication in expectedFailure* decorators
Differential Revision: http://reviews.llvm.org/D3452

llvm-svn: 206976
2014-04-23 12:55:41 +00:00
Todd Fiala ed7a08ec7f Added a packet-playback test facility for lldb-gdbserver and a few starter tests.
lldbgdbserverutils.py has a new expect_lldb_gdbserver_replay() method
that plays back gdb remote send/receive packets. These packets are the
log lines that come from running the 'log enable gdb-remote packets',
either from the lldb-gdbserver side or the lldb side. There's a flag
to flip which side is the send (lldb-gdbserver input or lldb-gdbserver
output).

This first checkin tests the initial gdbremote handshake, the ability
to turn on the no-ack mode communication style, thread suffix support,
and list threads in stop reply support. The last two are marked xfail
as top of tree does not yet support these.

 --This line, and those below, will be ignored--

M    test/tools/lldb-gdbserver/TestLldbGdbServer.py
M    test/tools/lldb-gdbserver/lldbgdbserverutils.py

llvm-svn: 206930
2014-04-22 23:16:53 +00:00
Ed Maste ec4f47ed1c Switch to Darwin decorator for tests that XPASS on FreeBSD
Since these tests pass on (at least some) other platforms, change the
decorators to @expectedFailureDwarwin.  Tested on FreeBSD with Clang 3.4
and libc++.

rdar://9980907
rdar://15367233

llvm-svn: 206895
2014-04-22 13:42:05 +00:00
Todd Fiala 5d66da70d8 TestPtrRef2Typedef.py change - take 2.
Our build is still getting this test to fail with the presence of const in
'(Foo &const) y = 0x' and '(Foo &&const) z = 0x'.  This change simply changes
the match substrings to ignore the portion after the final '&' and before the
closing ')'.  This should cover the presence (or absence) of the const qualifier.

llvm-svn: 206762
2014-04-21 17:09:35 +00:00
Ed Maste 7bff0b690e Remove decorator for now-passing test
The underlying issue was actually a Clang bug, now fixed.  The test now
reports XPASS for me locally and on the buildbot.

llvm.org/pr17183 (LLDB)
llvm.org/pr18950 (Clang)

llvm-svn: 206761
2014-04-21 15:24:07 +00:00
Ed Maste b6209ad8a6 Add a comment to tests that XPASS on FreeBSD
Perhaps these should be @expectedFailureDarwin instead of
@unittest2.expectedFailure (applying to all hosts); I'm not aware of
the details in the rdars.

Just add a comment for now, for the benefit of anyone investigating
FreeBSD test issues in the future.

rdar://9980907
rdar://15367233

llvm-svn: 206760
2014-04-21 15:19:18 +00:00
Ed Maste 626303568b Remove decorator for now-passing test
I am not sure if this is due to an LLDB change, or the fact that FreeBSD
now has Clang 3.4.

llvm.org/pr19075

llvm-svn: 206757
2014-04-21 14:43:18 +00:00
Ed Maste 1a85845b49 Revert "Fix TestPtrRef2Typedef with new const adornment on expected ref type."
The additional "const" breaks the FreeBSD buildbot, and does not appear
to be due to a LLVM or Clang change.  Revert the change while
investigating further.

This reverts revision 206619.

llvm-svn: 206751
2014-04-21 14:10:38 +00:00
Todd Fiala 132b880558 Added a basic connection test for lldb-gdbserver.
The lldb-gdbserver tests are skipped if the lldb-gdbserver exe cannot be found (currently only built for Linux and FreeBSD).  The lldb-gdbserver exe is found by the LLDB_EXEC environment variable, using the same dir as the lldb exe, and then replacing lldb with lldb-gdbserver.

llvm-svn: 206731
2014-04-21 05:30:08 +00:00
Todd Fiala 31cb1b547d Marked TestAttachResume.process_attach_continue_interrupt_detach() as XFAIL on Linux per pr19478.
llvm-svn: 206620
2014-04-18 17:07:09 +00:00
Todd Fiala 18f4540f61 Fix TestPtrRef2Typedef with new const adornment on expected ref type.
llvm-svn: 206619
2014-04-18 17:04:21 +00:00
Enrico Granata 1ac6296376 <rdar://problem/12055586>
Enable data formatters to see-through pointers/references to typedefs

For instance, if Foo is a typedef to Bar, and there is a formatter for any/all of Bar*, Bar&, Bar&&, then Foo*, Foo&, and Foo&& should pick these up if Foo-specific formatters don't exist

llvm-svn: 205939
2014-04-10 00:14:07 +00:00
Ed Maste 6562983234 Do not rely on invalid pthread API use in thread test
Calling mutex_lock from one thread and then mutex_unlock from another is
not permitted.  Replace the awkward mutex usage with a mutex and
condition variable.

llvm.org/pr18061                                                            

llvm-svn: 205900
2014-04-09 14:48:25 +00:00
Ed Maste 8b2c281a75 Correct typo: waychpoint -> watchpoint
llvm-svn: 205719
2014-04-07 16:33:53 +00:00
Ed Maste e63b5125e0 Add decorator for FreeBSD DynamicValueTestCase failure
Not yet root-caused, but I presume it is the same issue that affects
Linux.

llvm-svn: 205712
2014-04-07 13:42:05 +00:00
Ed Maste 99ed6dfa00 Add failure decorators
These tests started failing on FreeBSD after r205497 "Make the fail
messages"

llvm.org/pr19347

llvm-svn: 205652
2014-04-04 21:16:39 +00:00
Jim Ingham 6c9ed91cca Make the fail messages
llvm-svn: 205497
2014-04-03 01:26:14 +00:00
Jim Ingham 6cc0d2f61d Print the new eStopReasonExec in stop_reason_to_str.
llvm-svn: 205496
2014-04-03 01:25:28 +00:00
Jim Ingham 24e84d2c87 I removed SetCallback from the Python API's since it wasn't actually useful, and added SetScriptCallbackFunction,
and SetScriptCallbackBody.  So add these to the default constructor test case.

llvm-svn: 205494
2014-04-03 00:50:56 +00:00
Ed Maste abd482a650 Add decorator for pr19311 on FreeBSD
A breakpoint at the resume address for "continue" is skipped.  This is
presumably the root cause for the Linux failure as well.

llvm-svn: 205482
2014-04-02 23:01:04 +00:00
Enrico Granata c1fb7bd33e rdar://16424649
Clean up the DynamicValueTestCase

Namely, I split off the part of the test that validates child counts to a separate test

llvm-svn: 205450
2014-04-02 18:55:29 +00:00
Ed Maste e7f59bb04d Add annotation for failure from new Attach/Resume test case on FreeBSD
llvm-svn: 205427
2014-04-02 14:45:46 +00:00
Andrew MacPherson 82aae0d835 Use getpgid() with waitpid() in case the process pgid is not equal to its pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala.
llvm-svn: 205405
2014-04-02 06:57:45 +00:00
Jim Ingham 7d8f86ceae Test case for the previous commit.
llvm-svn: 205381
2014-04-02 01:05:27 +00:00
Enrico Granata a4d5fc3841 Use continue instead of next
llvm-svn: 205354
2014-04-01 19:37:14 +00:00
Ed Maste c97323ea8b Use libc++ on FreeBSD as on Darwin
llvm-svn: 205345
2014-04-01 18:47:58 +00:00
Ed Maste 1087f2980d Add errno import missed in r205246
llvm-svn: 205306
2014-04-01 12:49:21 +00:00
Ed Maste ce5ac7d776 Workaround test trace output dir creation race condition
Since dosep.ty started invoking multiple tests in parallel, the FreeBSD
buildbot occasionally has a failure due to os.mkdir returning EEXIST.
Silently ignore that exception, but reraise any other.

llvm-svn: 205246
2014-03-31 20:36:38 +00:00
Jason Molenda a332978b2a lldb arm64 import.
These changes were written by Greg Clayton, Jim Ingham, Jason Molenda.

It builds cleanly against TOT llvm with xcodebuild.  I updated the
cmake files by visual inspection but did not try a build.  I haven't
built these sources on any non-Mac platforms - I don't think this
patch adds any code that requires darwin, but please let me know if
I missed something.

In debugserver, MachProcess.cpp and MachTask.cpp were renamed to
MachProcess.mm and MachTask.mm as they picked up some new Objective-C
code needed to launch processes when running on iOS.

llvm-svn: 205113
2014-03-29 18:54:20 +00:00
Jim Ingham 914f4e7092 Add the ability from the SB API's to set the "one thread" timeout
for expression evaluations that try one and then all threads.

<rdar://problem/15598528>

llvm-svn: 205060
2014-03-28 21:58:28 +00:00
Ed Maste fdb85d8dc3 Remove annotation for llvm.org/pr19241
The issue has been fixed by r204745 and r204750

llvm-svn: 204779
2014-03-26 02:45:44 +00:00
Enrico Granata dd75b8556d Add a test case for the previous commit
llvm-svn: 204763
2014-03-25 22:09:24 +00:00
Enrico Granata f6601d0498 Make sure this test has a looser dependency on the exact class generated here.. it is going to be some sort of NS-provided String, but let's not bet on the details
llvm-svn: 204761
2014-03-25 21:59:40 +00:00
Todd Fiala e373b68977 Fixed up intermittently failing tests to skip on Linux.
Also added 'import sys' on some tests that are using non-standard
unittest2.skipUnless blocks with code that is intended to do things
that we have more specializes @* attributes for.  These skip
conditions were failing to execute due to missing import, causing
darwin-only tests to run on Linux regardless.  Will file a bug for
that separately.

llvm-svn: 204747
2014-03-25 18:55:48 +00:00
Ed Maste 03c9207c34 Update 'running threaded' messages after option parsing change
"Running multithreaded with n threads (from LLDB_TEST_THREADS)" is
incorrect in the common case, because the thread count is now obtained
from a --threads option, or a default of multiprocessing.cpu_count().

I left the messages in for now as there are some intermittent issues
that happen while running tests multithreaded and it may help in
triaging those.  We may wish to just remove them later on.

llvm-svn: 204725
2014-03-25 15:17:23 +00:00
Ed Maste 8c3e9b2515 Add expected failure annotation for llvm.org/pr19241
llvm-svn: 204718
2014-03-25 13:15:21 +00:00
Greg Clayton 2256d0dced Add a "--threads N" option instead of having to use an environment variable. It also now defaults to running with the number of CPUs on the machine.
llvm-svn: 204681
2014-03-24 23:01:57 +00:00