Commit Graph

2333 Commits

Author SHA1 Message Date
Greg Clayton 5fb8f79738 Fixed internal code to not link against and code from "lldb/API/*".
lldb_private::Debugger was #including some "lldb/API" header files which causes tools (lldb-platform and lldb-gdbserver) that link against the internals only (no API layer) to fail to link depending on which calls were being used.

Also fixed the current working directory so that it gets set correctly for remote test suite runs. Now the remote working directory is set to: "ARCH/TESTNUM/..." where ARCH is the current architecture name and "TESTNUM" is the current test number. 

Fixed the "lldb-platform" and "lldb-gdbserver" to not warn about mismatched visibility settings by having each have their own exports file which contains nothing. This forces all symbols to not be exported, and also quiets the linker warnings.

llvm-svn: 196141
2013-12-02 19:35:49 +00:00
Ed Maste 094e1653cb test: Decorators for pr17910
A number of tests fail to build on FreeBSD because the test build script
defaults to libstdc++ for clang.  On FreeBSD the libstdc++ is rather old
and libc++ should be used instead.

(These tests previously had an @expectedFailureFreeBSD decorator for
pr16696, the umbrella PR for the lack of threaded inferior support on
FreeBSD.  The work to add that support will be committed soon.)

llvm-svn: 196101
2013-12-02 14:26:57 +00:00
Ed Maste 0d092a446b Add decorator for FreeBSD failing test due to pr18061
The test code locks mutexes from one thread and unlocks them from a
different one, which is not valid (it's either undefined behaviour or is
required to return an error).

See http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

llvm-svn: 195707
2013-11-26 01:11:14 +00:00
Ed Maste a2b2465e45 test: Fix punctuation in exceptions for log env vars
The Exception text was missing a closing parenthesis, and for consistency
with other Exceptions it should not end with a period.

llvm-svn: 195659
2013-11-25 16:57:16 +00:00
Ed Maste 07b8d259dd test: Add decorator for FreeBSD watchpoint failure
Watchpoints have not yet been implemented for FreeBSD.
llvm.org/pr16706

llvm-svn: 195649
2013-11-25 15:38:26 +00:00
Greg Clayton fb90931b60 Improved platform support.
Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software).

Host::MakeDirectory() now can make as many intermediate directories as needed.

The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. 

Added a common function that can be used to create the short option string for getopt_long calls.

llvm-svn: 195541
2013-11-23 01:58:15 +00:00
Greg Clayton b39751bc9f Patch from Todd Fiala for http://llvm.org/bugs/show_bug.cgi?id=17961
llvm-svn: 195500
2013-11-22 21:05:25 +00:00
Ed Maste bf9b24edc3 Disable stop-hook test on FreeBSD as on Linux
It fails on the buildbot, so skip for now to reduce the noise.

llvm.org/pr15037

llvm-svn: 195459
2013-11-22 13:54:58 +00:00
Ed Maste 53ae4b1433 Remove decorators for llvm.org/pr17225
This issue is no longer reproducible, presumably due to changes in clang.

llvm-svn: 195458
2013-11-22 13:46:43 +00:00
Ed Maste f9c2c989de Annotate test that fails on the FreeBSD buildbot
llvm.org/pr17807

llvm-svn: 195361
2013-11-21 14:23:15 +00:00
Ed Maste 21ad67b4ef test: Remove annotation for now-fixed FreeBSD issue pr15302
The failure to demangle 'anonymous namespace' on FreeBSD is fixed (twice)

- the failure in FreeBSD's in-tree __cxa_demangle has been addressed

- FreeBSD now uses the copy of the demangler built into lldb, due to other
  remaining limitations in the in-tree __cxa_demangle

llvm.org/pr15302

llvm-svn: 194855
2013-11-15 21:33:30 +00:00
Ed Maste ddb573063d Remove FreeBSD test failure annotations for llvm.org/pr17213
This was a FreeBSD kernel issue, now fixed.

llvm-svn: 194842
2013-11-15 19:15:43 +00:00
Ed Maste af12ff28a1 Remove annotations for pr17184 (now fixed)
This failure was due to a limitation in the FreeBSD kernel that has now been
addressed.  (llvm.org/pr17226 has the details.)

llvm-svn: 194731
2013-11-14 21:29:58 +00:00
Ed Maste 4ae8c9e507 Update failing FreeBSD test annotations (pr17932, pr17933)
After solving the issue in llvm.org/pr17226 these two tests still fail,
now for other reasons.

llvm-svn: 194729
2013-11-14 21:27:34 +00:00
Ed Maste 1e46620b4f Mark two FreeBSD tests failing due to llvm.org/pr15989
After solving llvm.org/pr17226 these two tests now fail for the same reason
they do on Linux.

llvm-svn: 194726
2013-11-14 20:25:29 +00:00
Jim Ingham 6fbc48bc42 This patch does a couple of things.
It completes the job of using EvaluateExpressionOptions consistently throughout
the inferior function calling mechanism in lldb begun in Greg's patch r194009. 

It removes a handful of alternate calls into the ClangUserExpression/ClangFunction/ThreadPlanCallFunction which
were there for convenience.  Using the EvaluateExpressionOptions removes the need for them.

Using that it gets the --debug option from Greg's patch to work cleanly.

It also adds another EvaluateExpressionOption to not trap exceptions when running expressions.  You shouldn't
use this option unless you KNOW your expression can't throw beyond itself.  This is:

<rdar://problem/15374885>

At present this is only available through the SB API's or python.

It fixes a bug where function calls would unset the ObjC & C++ exception breakpoints without checking whether
they were set by somebody else already.

llvm-svn: 194182
2013-11-07 00:11:47 +00:00
Greg Clayton 095eeaa025 <rdar://problem/15367122>
Fixed the test case for "test/functionalities/exec/TestExec.py" on Darwin.

The issue was breakpoints were persisting and causing problems. When we exec, we need to clear out the process and target and start fresh with nothing and let the breakpoints populate themselves again. This patch correctly clears out the breakpoints and also flushes the process so that the objects (process/thread/frame) give out valid information.

llvm-svn: 194106
2013-11-05 23:28:00 +00:00
Enrico Granata e397a94c5d <rdar://problem/15368142>
For this test case, one needs to get the name of the symbol since we don't have debug info to generate an SBFunction

llvm-svn: 193879
2013-11-01 18:48:03 +00:00
Enrico Granata e615d20041 Use 0x00... as the magic constant to write in st0. That should be reliably 0 regardless of OS/hardware
llvm-svn: 193877
2013-11-01 18:19:05 +00:00
Enrico Granata 4c379c2b8d Skip this test case pending figuring out why it fails
llvm-svn: 193844
2013-11-01 01:00:57 +00:00
Enrico Granata 03e474bcef This only fails on Darwin ; thanks Jim for pointing that out
llvm-svn: 193843
2013-11-01 00:57:53 +00:00
Enrico Granata 60bd35012a This test is expected to fail pending proper support
llvm-svn: 193831
2013-10-31 23:43:42 +00:00
Enrico Granata 3a48185f79 Thread::SetState() is not being called upon hitting the breakpoint
Given that, this test will never pass
Marking as expected failure pending a fix

llvm-svn: 193830
2013-10-31 23:36:47 +00:00
Enrico Granata 2dba1135db Fix this test to work with either st0 or stmm0
llvm-svn: 193829
2013-10-31 23:25:47 +00:00
Enrico Granata 667a911901 This test is failing because expressions involving dlopen() currently do not work
Mark it as expected to fail pending a fix

llvm-svn: 193828
2013-10-31 23:19:13 +00:00
Enrico Granata 7eeda58588 Fix this test to be consistent in whether a process will or will not be there
llvm-svn: 193827
2013-10-31 23:14:48 +00:00
Enrico Granata 7037b3f915 Another instance of the same test failing
llvm-svn: 193826
2013-10-31 23:07:41 +00:00
Enrico Granata 4510a159c2 Another instance of the same test failing
llvm-svn: 193825
2013-10-31 23:06:54 +00:00
Enrico Granata 4a2dc3b01b Mark this as an expected failure
llvm-svn: 193824
2013-10-31 23:05:35 +00:00
Enrico Granata c955ac3723 This test is currently expected to fail, mark it as such pending fixes
llvm-svn: 193822
2013-10-31 22:55:55 +00:00
Enrico Granata 0ede1094bf Workaround the DWARF info is anticipating the derived class assignment issue in this test case for now
llvm-svn: 193821
2013-10-31 22:49:31 +00:00
Andrew Kaylor 70ce6d2e62 Marking dynamic value test as expected failure on Linux.
llvm-svn: 193809
2013-10-31 22:07:11 +00:00
Andrew Kaylor 7268e6ef9d Fix dynamic value test to build correctly on Linux with C++11 features.
llvm-svn: 193793
2013-10-31 19:42:35 +00:00
Ed Maste fb15ba6879 Tls test fails on FreeBSD due to llvm.org/pr16696
(Threaded inferior debugging not yet available on FreeBSD.)

llvm-svn: 193771
2013-10-31 17:21:15 +00:00
Andrew Kaylor ba8ce0414e Removing expected failure decorator for a test that's passing.
llvm-svn: 193715
2013-10-30 21:05:36 +00:00
Enrico Granata 38c546320c <rdar://problem/15045059>
One of the things that dynamic typing affects is the count of children a type has
Clear out the flag that makes us blindly believe the children count when a dynamic type change is detected

llvm-svn: 193663
2013-10-30 00:04:29 +00:00
Enrico Granata df7c7f99ba Fixing an issue in yesterday's dynamic type changes where we would not craft a valid SBType given debug information
Added a test case to help us detect regression in this realm

llvm-svn: 193631
2013-10-29 17:42:02 +00:00
Andrew Kaylor 2c206688db Fixing TestAnonymous to build dwarf where it says it will.
llvm-svn: 193628
2013-10-29 17:09:59 +00:00
Enrico Granata dc4db5a6eb <rdar://problem/15144376>
This commit reimplements the TypeImpl class (the class that backs SBType) in terms of a static,dynamic type pair

This is useful for those cases when the dynamic type of an ObjC variable can only be obtained in terms of an "hollow" type with no ivars
In that case, we could either go with the static type (+iVar information) or with the dynamic type (+inheritance chain)

With the new TypeImpl implementation, we try to combine these two sources of information in order to extract as much information as possible
This should improve the functionality of tools that are using the SBType API to do extensive dynamic type inspection

llvm-svn: 193564
2013-10-29 00:28:35 +00:00
Jim Ingham be40554915 ValueObject and SBValue's GetChildMemberWithName should look through anonymous structs
and unions the same way that C would.

<rdar://problem/11987906>

llvm-svn: 193016
2013-10-18 23:53:55 +00:00
Enrico Granata 52b4b6cddc This is the last piece of work for "formats in categories": we now cache formats as well as summaries and synthetics
llvm-svn: 192928
2013-10-17 22:27:19 +00:00
Richard Mitton 0a55835755 Added support for reading thread-local storage variables, as defined using the __thread modifier.
To make this work this patch extends LLDB to:

- Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list.

- Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines.

- Make DWARF expressions track which module they originated from.

- Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here.

- Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here:

  1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target.

  2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out.

  3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized.

  However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used.

Test case included.

llvm-svn: 192922
2013-10-17 21:14:00 +00:00
Richard Mitton ec8b282bde Rearranged linker flags for test suite.
Some linkers (GNU ld) are picky about library order, so if we import libraries as part of our LDFLAGS then that needs to come after any DYLIB_NAME which might require that library.

llvm-svn: 192917
2013-10-17 20:09:33 +00:00
Enrico Granata ce451cc300 <rdar://problem/15235492>
Extend DummySyntheticProvider to actually use debug-info vended children as the source of information
Make Python synthetic children either be valid, or fallback to the dummy, like their C++ counterparts

This allows LLDB to actually stop bailing out upon encountering an invalid synthetic children provider front-end, and still displaying the non synthetized ivar info

llvm-svn: 192741
2013-10-15 22:42:14 +00:00
Ed Maste 795d2b9f95 Expected FreeBSD failure due to pr 17430
llvm-svn: 192467
2013-10-11 17:24:16 +00:00
Michael Sartain 15c07b90c0 Re-enable test_convenience_registers_16bit_with_process_attach test for Linux.
Remove 32-bit POSIX register hack in ConvertBetweenRegisterKinds.

llvm-svn: 192306
2013-10-09 17:44:52 +00:00
Michael Sartain 704bf8912e Clean up RegisterContextPOSIX i386 code.
Use 32-bit register enums without gaps on 64-bit hosts.
Don't show 64-bit registers when debugging 32-bit targets.
Add psuedo gpr registers (ax, ah, al, etc.)
Add mmx registers.
Fix TestRegisters.py to not read ymm15 register on 32-bit targets.
Fill out and move gcc/dwarf/gdb register enums to RegisterContext_x86.h

llvm-svn: 192263
2013-10-09 01:28:57 +00:00
Enrico Granata 99c8f7ae79 <rdar://problem/15180638>
Making GetNumberOfDirectBaseClasses() work for ObjC pointers, and for classes for which we don't have full debug info

llvm-svn: 192255
2013-10-09 00:13:17 +00:00
Ed Maste 05f5a1d3df Mark tests failing on FreeBSD after r191996
llvm-svn: 192134
2013-10-07 21:25:48 +00:00
Ashok Thirumurthi 52fbac7d90 xfail for gcc tests due to pr17499 (regressions due to r191966).
llvm-svn: 192132
2013-10-07 21:00:29 +00:00
Enrico Granata a29cb0bada <rdar://problem/12042982>
This radar extends the notion of one-liner summaries to automagically apply in a few interesting cases

More specifically, this checkin changes the printout of ValueObjects to print on one-line (as if type summary add -c had been applied) iff:
this ValueObject does not have a summary
its children have no synthetic children
its children are not a non-empty base class without a summary
its children do not have a summary that asks for children to show up
the aggregate length of all the names of all the children is <= 50 characters
you did not ask to see the types during a printout
your pointer depth is 0

This is meant to simplify the way LLDB shows data on screen for small structs and similarly compact data types (e.g. std::pair<int,int> anyone?)

Feedback is especially welcome on how the feature feels and corner cases where we should apply this printout and don't (or viceversa, we are applying it when we shouldn't be)

llvm-svn: 191996
2013-10-04 23:14:13 +00:00
Richard Mitton 5c98c9a216 Fixed TestSettings.py to correctly restore the frame format string.
This fixes TestBreakpointCommand.

llvm-svn: 191868
2013-10-03 01:50:35 +00:00
Matt Kopec cc363a78ac Mark watchpoint test as still failing on i386 Linux.
llvm-svn: 191717
2013-10-01 00:02:41 +00:00
Matt Kopec 326bfc5a9e Enabling 32-bit tests for clang on Linux by default (ie. for the buildbot.).
llvm-svn: 191714
2013-09-30 23:33:43 +00:00
Daniel Malea f6dfe33492 Fix race condition in TestConvenienceVariables.py
- test wasn't checking for a stop reason before issuing the 'script' command
- should resolve intermittent failure on the Linux GCC buildbot

llvm-svn: 191708
2013-09-30 22:54:27 +00:00
Daniel Malea f3903a5ced Disable TestStopHookMultipleThreads.py (on Linux) due to llvm.org/pr15037
- stop hooks sometimes fail to fire on Linux

llvm-svn: 191704
2013-09-30 21:32:25 +00:00
Enrico Granata 6ca84e3758 This test uses ObjC so it should not run on anything != Darwin
llvm-svn: 191698
2013-09-30 20:55:00 +00:00
Enrico Granata eff67bc49e Test case for the previous checkin
llvm-svn: 191697
2013-09-30 20:39:21 +00:00
Enrico Granata 4d93b8cdf3 <rdar://problem/14393032>
DumpValueObject() 2.0

This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
 When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
    1 = 2;
    2 = 3;
}

 When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
    1 = 2;
    2 = 3;
}

- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5 

On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed

Test case to follow

llvm-svn: 191694
2013-09-30 19:11:51 +00:00
Matt Kopec ee969f9f27 Mark 32/64-bit tests as expected fail after root causing and referencing bugzilla.
Fix TestFrames.py error to check against a None pc value.

llvm-svn: 191470
2013-09-26 23:30:59 +00:00
Matt Kopec cc64cc1773 Fix the thread jump test case for 32-bit inferiors. A jump was going back to a function call using a source line number. However, the parameters being passed to the function were setup before the instruction we jumped to. In other words, the source line was associated with assembly after the function parameters had been setup for the function to be called.
llvm-svn: 191457
2013-09-26 20:54:17 +00:00
Ashok Thirumurthi 8b5773053b Fix the partial backtrace in a recursive inferior compiled with -fomit-frame-pointer.
- Removes the block in UnwindLLDB::AddOneMoreFrame that tests for a bad stack setup,
since it is neither correct (tests the FP GPR), complete (doesn't consider multi-frame
cycles), nor reachable (the construction of RegisterContextLLDB will fail in the case 
where either of the two (why just two?) previous frames have the same canonical frame
address as the frame that we propose adding to the stack).

llvm-svn: 191430
2013-09-26 14:35:59 +00:00
Richard Mitton 0d40120615 Changed fuzz tests to not print their values (we only need to test if access to them does not crash).
This fixes the 'No value' string appearing in the dotest results.

llvm-svn: 191399
2013-09-25 20:48:03 +00:00
Richard Mitton d36c8d23a5 Added a simple legend to the unit test 'dots' output, to aid understandability.
llvm-svn: 191398
2013-09-25 20:47:51 +00:00
Daniel Malea 46a72bb3bf Enable tests affected by llvm.org/pr14637
- to verify that r191392 has the desired effect

llvm-svn: 191396
2013-09-25 19:43:18 +00:00
Matt Kopec 7663b3a9d0 Add support for TestPluginComands on Linux. Also, rework makefile dsym target.
llvm-svn: 191383
2013-09-25 17:44:00 +00:00
Ashok Thirumurthi bb82b84c34 Cache and restore the frame-format, so that test_set_frame_format doesn't modify the default, as required for TestInferiorAssert.py.
- Also fixes this test case to set/verify a non-default frame-format and explain the intent.

llvm-svn: 191378
2013-09-25 15:30:14 +00:00
Ashok Thirumurthi 5e644d9737 Fix an xpass on the buildbots by relaxing a test for PC location in the disassembly.
llvm-svn: 191321
2013-09-24 18:03:57 +00:00
Ashok Thirumurthi 35729bb1f8 Adds an option to resolve a symbol from an address that can be used
to build out the symbol table as addresses are used, and implements
the mechanism for ELF to add stripped symbols from eh_frame.

Uses this mechanism to allow disassembly for addresses corresponding
to stripped symbols for ELF, and provide hooks to implement this for
PE COFF.

Also removes eSymbolContextTailCall in favor of an option for
ResolveSymbolContextForAddress for consistency with the documentation
for eSymbolContextEverything.  Essentially, this is just an option for
interpreting the so_addr.
                  

llvm-svn: 191307
2013-09-24 15:34:13 +00:00
Ashok Thirumurthi 2568f45939 Fix lldb regressions due to r190812 in the case where debug info is present.
Specifically, allows the unwinder to handle the case where sc.function
gets resolved with a pc that is one past the address range of the function
(consistent with a tail call).  However, there is no matching symbol.

Adds eSymbolContextTailCall to provide callers with control over the scope
of symbol resolution and to allow ResolveSymbolContextForAddress to handle
tail calls since this routine is common to unwind and disassembly.

llvm-svn: 191102
2013-09-20 19:05:10 +00:00
Ashok Thirumurthi b742879c35 Add an xfail test as 'expr myfloat' can add digits consistent
with the closest available 32-bit floating point representation.

llvm-svn: 191101
2013-09-20 19:01:20 +00:00
Daniel Malea e106cded61 Disable TestInferiorAssert (due to llvm.org/pr17276)
- last remaining failure on the clang buildbot

llvm-svn: 191047
2013-09-19 22:41:36 +00:00
Daniel Malea 105b2a4bc3 Make threading tests not depend on the currently selected thread
- tests are now anostic to the currently selected thread, as that is a frontend (i.e. driver) decision
- this is in preparation to a fix to POSIXThread::BreakNotify that will be committed shortly

Reviewed by: Matt Kopec

llvm-svn: 191041
2013-09-19 22:00:07 +00:00
Daniel Malea 38a7d6fc7a Disabling test broken (on GCC buildbot) due to http://llvm.org/pr14637
- prompt disappears with older libedit versions
- will re-enable once we have a recent libedit on the buildbot in question

llvm-svn: 190889
2013-09-17 21:44:15 +00:00
Matt Kopec cccf2cc8c1 Rename shared libraries for TestLoadUnload.py due to potential shared library name clashes.
llvm-svn: 190884
2013-09-17 20:57:15 +00:00
Daniel Malea 7d0d66924f Update Linux bug tracker link in TestPrintStackTraces
- now fails due to llvm.org/pr15415 (partial stack trace while stopped inside read() call)

llvm-svn: 190867
2013-09-17 16:30:30 +00:00
Daniel Malea f04a22d9dc Re-enabling TestStopHookMultipleThreads
- original bug llvm.org/pr14323 is long closed

llvm-svn: 190865
2013-09-17 16:06:30 +00:00
Daniel Malea 1efb418c9d Improve stability of Linux ProcessMonitor by not using fds for synchronization:
- ProcessMonitor::[Do|Serve]Operation no longer depend on file descriptors!
- removed unused member functions CloseFD and EnableIPC
- add semaphores to signal when an Operation is ready to be processed/complete.

This commit fixes a bug that was identified under stress-testing (i.e. build
LLVM while running tests) that led to LLDB becoming unresponsive because the
read/write operations on file descriptors in ProcessMonitor were not checked.

Other test runner improvement/convenience:
- pickup environment variables LLDB_LINUX_LOG and LLDB_LINUX_LOG_OPTIONS to
  enable (Linux) logging when running the test suite. Example usage:

        $ LLDB_LINUX_LOG="mylog.txt" LLDB_LINUX_LOG_OPTIONS="process thread" python dotest.py

llvm-svn: 190820
2013-09-16 23:12:18 +00:00
Matt Kopec 84fee88b98 Add test suite support for TestLoadUnload.py for Linux.
llvm-svn: 190815
2013-09-16 22:34:36 +00:00
Ed Maste 3dfe99ca7e Skip tests that segfault or are inconsistent on FreeBSD
I now see no unexpected failures on FreeBSD on a local run of the test
suite.

llvm.org/pr17214
llvm.org/pr17225
llvm.org/pr17231
llvm.org/pr17232
llvm.org/pr17233

llvm-svn: 190709
2013-09-13 17:35:13 +00:00
Ed Maste 34bdbbdf97 test: Update FreeBSD failure decorators
llvm.org/pr15261 missing size for static arrays
llvm.org/pr15278 expressions generating signals
llvm.org/pr15824 thread states aren't properly maintained
llvm.org/pr16696 threaded inferior debugging not yet on FreeBSD
llvm.org/pr17214 inline stepping fails on FreeBSD
llvm.org/pr17225 Clang assertion failure
llvm.org/pr17226 frame info lost after failed expression evaluation
llvm.org/pr17228 test timeout

The first three are existing Linux issues that also affect FreeBSD.

llvm-svn: 190698
2013-09-13 15:34:59 +00:00
Ed Maste a837c8224d Rename test class to match test target language
llvm-svn: 190695
2013-09-13 14:55:25 +00:00
Ed Maste 16a4d8c15d test: Add @expectedFailureFreeBSD decorator
llvm.org/pr17213 Expression evaluation fails on FreeBSD in some cases

llvm-svn: 190622
2013-09-12 18:37:42 +00:00
Richard Mitton f86248d9ba Added a 'jump' command, similar to GDBs.
This allows the PC to be directly changed to a different line.
It's similar to the example python script in examples/python/jump.py, except implemented as a builtin.

Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function)

llvm-svn: 190572
2013-09-12 02:20:34 +00:00
Enrico Granata e2e220a805 <rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided

llvm-svn: 190564
2013-09-12 00:48:47 +00:00
Ed Maste 0afb78a83e test: Add @expectedFailureFreeBSD decorators
llvm.org/pr17184 expression interpreter fails for crash/assert tests

llvm-svn: 190416
2013-09-10 17:15:05 +00:00
Ed Maste fcd4caac8c test: Add @expectedFailureFreeBSD decorators
http://llvm.org/pr17183 expression w/ varargs printf() fails
http://llvm.org/pr15302 'anonymous namespace' prefix missing

llvm-svn: 190415
2013-09-10 16:25:05 +00:00
Daniel Malea 4a204d26c5 Disabling tests affected by llvm.org/pr16170 on Linux
- occasional lldb hangs are causing noisy buildbots and trouble in the (Debian/Ubuntu) package builder

llvm-svn: 190355
2013-09-09 21:28:44 +00:00
Ed Maste 437f8f665a test: Handle libc++ shared lib name on FreeBSD
(I didn't take a guess at the Linux names, as these tests are currently
skipped with the comment "No standard locations for libc++ on Linux.")

llvm-svn: 190307
2013-09-09 14:04:04 +00:00
Ed Maste 101dc713e7 Enable register log for FreeBSD tests
llvm-svn: 190287
2013-09-09 01:19:22 +00:00
Ed Maste a0e4e75b53 Set shared library path on FreeBSD as on Linux for tests
llvm-svn: 190286
2013-09-09 01:16:43 +00:00
Ed Maste e3641c5d1f Set shared library path on FreeBSD as on Linux for tests
llvm-svn: 190285
2013-09-09 00:40:46 +00:00
Matt Kopec 76d8abd173 Re-enable some locally passing tests on Linux and see how they behave on the buildbots.
llvm-svn: 190214
2013-09-06 22:33:49 +00:00
Daniel Malea 539375aefd Re-enable TestRegisters and TestTargetWatchAddress on Linux
- TestRegisters passes locally (llvm.org/pr16301 no longer reproduces) -- verifying this on buildbots
- TestTargetWatchAddress also passes locally, and referenced llvm.org/pr14323 which is now closed

llvm-svn: 190104
2013-09-05 21:51:01 +00:00
Ed Maste 7c56667d30 Restore -- "end of args" marker for shell
I accidentally dropped this in r189879 in the change from /bin/bash to
/bin/sh.

llvm-svn: 190103
2013-09-05 21:38:45 +00:00
Daniel Malea d4905b0ef9 Fix minor bugs in TestExprs and TestAliases to fix buildbot breakage
- 'run' alias no longer includes the '--' for positional arguments... does not seem like a real bug.
- 2.234f is not a great number for the float tests (due to precision/printing issues) so use 0.5f instead

llvm-svn: 190100
2013-09-05 21:24:14 +00:00
Ed Maste 2a1eb4318d Use getwd(0) on FreeBSD as on OS X.
llvm-svn: 190070
2013-09-05 17:05:37 +00:00
Andrew Kaylor 7d2abdf017 Fixing a problem with inferior exit caused by signal
llvm-svn: 189953
2013-09-04 16:06:04 +00:00
Ed Maste b8ca4a2c1a Switch '/bin/bash' to '/bin/sh'
/bin/sh is more portable, and all systems with /bin/bash are expected to
have /bin/sh as well, even if only a link to bash.

Review: http://llvm-reviews.chandlerc.com/D1576
llvm-svn: 189879
2013-09-03 23:04:53 +00:00
Ed Maste 8607c24638 Attach by name tests now pass on FreeBSD
A FreeBSD implementation of Host::FindProcesses was added in r189295.
Contrary to my earlier report of failing tests it seems all attach by
name tests now pass.

http://www.llvm.org/pr16699

llvm-svn: 189680
2013-08-30 15:35:32 +00:00
Ed Maste 6f9c7743cd Skip two tests that hang the FreeBSD buildbot
llvm.org/pr16684

llvm-svn: 189679
2013-08-30 15:34:41 +00:00
Ashok Thirumurthi 89457cfc67 Skipping two tests that hang consistently on Linux while investigating the issue in more depth.
llvm-svn: 189678
2013-08-30 15:27:30 +00:00
Ed Maste fcdab16d24 Expression evaluation works on FreeBSD after switch to MCJIT
http://www.llvm.org/pr16697

llvm-svn: 189668
2013-08-30 14:05:22 +00:00
Ed Maste 119ce53202 Remove annotation for a test that now passes on FreeBSD
A FreeBSD implementation of Host::FindProcesses was added in r189295.
Note that some tests still fail as the implementation returns a truncated
name for processes with long names.

http://www.llvm.org/pr16699

llvm-svn: 189667
2013-08-30 13:25:37 +00:00
Daniel Malea bb247fb58a Fix 'platform shell' command for Linux host and remote lldb-platform connections
- add default timeout of 10s (unil qPlatform_RunCommand supports timeout packets and CommandObjectPlatform is updated to read a timeout flag/setting)
- add a few tests for platform shell

llvm-svn: 189405
2013-08-27 21:01:01 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Richard Mitton f2bef0b15d Fixed DataExtractor to correctly display Intel extended doubles.
This means that "register read stmm0 --format f" actually works now.

This is a little messy but LLDB assumes 'long double' is portable, when it is not.

llvm-svn: 188698
2013-08-19 19:39:03 +00:00
Jason Molenda 680a7d7703 A new test case which adds a dSYM to an executable mid-debug session
where the executable has been slid.  This detects the regression fixed in
r188289.

llvm-svn: 188443
2013-08-15 02:49:16 +00:00
Sylvestre Ledru 01c284af95 Fix a typo.
Patch by Abid, Hafiz

llvm-svn: 188270
2013-08-13 14:06:16 +00:00
Daniel Malea d79ae05080 New settings: target.use-hex-immediates and target.hex-immediates-style
- Immediates can be shown as hex (either Intel or MASM style)
- See TestSettings.py for usage examples
- Verified to cause no regressions on Linux x86_64 (Ubuntu 12.10)

Patch by Richard Mitton!

llvm-svn: 187921
2013-08-07 21:54:09 +00:00
Daniel Malea 65b4b97f1b Re-enable check previously disabled due to llvm.org/pr16603
llvm-svn: 187890
2013-08-07 15:21:08 +00:00
Daniel Malea adaaec9aea Centralizing Intel compiler detection logic in lldbtest.py to avoid duplication in the future.
- Addresses review comments from Stefanus!

llvm-svn: 187816
2013-08-06 20:51:41 +00:00
Daniel Malea 433299d015 Support one more flavour of Intel compiler in TestThreadStepOut
- Thanks to Matt Kopec for noticing the failure!

llvm-svn: 187815
2013-08-06 20:39:27 +00:00
Matt Kopec 3449bb4484 Mark remaining failing test on icc as expected fail..
llvm-svn: 187814
2013-08-06 20:15:03 +00:00
Daniel Malea 9115f07465 Allow building test suite with non-default libc++
- add new "--libcxx" parameter to dotest.py to specify path to custom libc++

llvm-svn: 187802
2013-08-06 15:02:32 +00:00
Daniel Malea 14b3d361f8 Test compatibility improvements for ICC
- update TestThreadStepOut.py to work with Intel compilers
- fix typo in TestConcurrentEvents

llvm-svn: 187801
2013-08-06 15:00:23 +00:00
Andrew Kaylor bd6389b11f Additional fixes/xfails for icc tests
llvm-svn: 187730
2013-08-05 17:12:35 +00:00
Matt Kopec 9c99030dea Mark additional icc test failures as expected fail.
llvm-svn: 187660
2013-08-02 17:53:28 +00:00
Daniel Malea 4c1fadbb44 Disable test on Mac OS X due to llvm.org/pr16769
llvm-svn: 187603
2013-08-01 20:03:36 +00:00
Ashok Thirumurthi 1db108972b Updates TestLongjump to ensure that compiler optimizations don't affect the
mapping of source to assembly so that the same test script can be used
with more compilers.

Patch by Andy Kaylor!

Also marks the LLDB test of template parameters as xfail on icc.

llvm-svn: 187600
2013-08-01 18:52:01 +00:00
Michael Sartain c205243e8b Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
This fixes threadname logging (--thread-name)
Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging

llvm-svn: 187599
2013-08-01 18:51:08 +00:00
Stefanus Du Toit 6809d79cc6 Allow test categories to be skipped.
This adds a new parameter, --skip-category, that can be used to list
categories that should be skipped. For example, to run all tests except for
Objective-C ones, one can now write:

  ./dotest.py --skip-category objc [...]

llvm-svn: 187590
2013-08-01 17:59:20 +00:00
Matt Kopec 5d4bc2a3c3 Update failing tests on Linux for clang and gcc to only fail on Linux instead of all platforms.
Thanks Stefanus!

llvm-svn: 187585
2013-08-01 17:22:24 +00:00
Matt Kopec 34237a5fd3 Mark some tests as explicitly failing on clang/gcc as they pass on icc.
Also, rework the signed types test to check for signed or char type in the output as char is signed by default.

llvm-svn: 187533
2013-07-31 21:52:25 +00:00
Matt Kopec 9a9aa228a8 Add the LD_LIBRARY_PATH to target.env-vars for tests expecting libimf.so when testing with ICC.
Patch from Andy Kaylor.

llvm-svn: 187520
2013-07-31 20:13:04 +00:00
Ashok Thirumurthi 130a5593a8 Adds a test for 'target module dump symfile' to the LLDB suite.
TODO: Improve coverage of SBTypeMember and of 'target module dump'.
llvm-svn: 187519
2013-07-31 20:01:04 +00:00
Matt Kopec 6460b6e509 Mark additional ICC failing tests as expected fail.
llvm-svn: 187507
2013-07-31 17:56:22 +00:00
Matt Kopec d527154ab3 Update break conditions test to have consistent behaviour on all test suite compilers.
Also update comment in const variables test to reflect ICC status.

llvm-svn: 187501
2013-07-31 16:27:27 +00:00
Matt Kopec 540f3ed0f0 Set an extra debug flag when testing with ICC so that it generates the correct debug info for inlined tests.
llvm-svn: 187500
2013-07-31 16:10:03 +00:00
Ashok Thirumurthi dea0e6326b Updated the LLDB rvalue reference test to cross-reference with a bugzilla report,
provide more detail on compiler compatibility, and to illustrate that this is
an issue with expression evaluation.

- Note that clang doesn't emit DW_TAG_const_type, which might be okay if there's
no such thing as a non-const rvalue reference.  How about foo(make_int())?

llvm-svn: 187499
2013-07-31 15:58:01 +00:00
Daniel Malea 7dadf4999a Assorted test suite fixes as a result of GCC 4.8 validation efforts
- disable some TestConcurrentEvents cases (which are affected by llvm.org/pr16714 -- watchpoints in multithreaded programs)
- relax number-of-bp-locations check in TestUniqueTypes/TestUnsignedTypes
- skip TestDataFormatterStdVector cases with GCC 4.8 (known failure due to llvm.org/pr15301)
- workaround for race condition in TestHelloWorld.py
- update TestSettings.py to work on distros (like Fedora) that have /bin/cat hardlinked to /usr/bin/cat

After these changes, the test suite should run cleanly against GCC 4.8 (with DWARF v4)!

llvm-svn: 187451
2013-07-30 21:34:44 +00:00
Daniel Malea bbd174b6f0 Fix problematic override _exc_info_to_string
- pass through to base-class implementation when raised exception is not from an LLDBTest
- should make the test suite errors a little easier to root-cause

llvm-svn: 187450
2013-07-30 21:28:32 +00:00
Stefanus Du Toit 8742add4b1 Add missing -Xlinker to order test.
Both the parameter itself and the argument to the parameter must be prefixed
with -Xlinker so that they are passed properly.

llvm-svn: 187432
2013-07-30 19:19:55 +00:00
Stefanus Du Toit 0400444e24 Use -Wl to specify -rpath correctly.
llvm-svn: 187431
2013-07-30 19:19:49 +00:00
Stefanus Du Toit f1620efc4a Use the correct compiler to compute dependencies.
This uses $(CXX) instead of $(CC) to generate the .d files for tests built
with Makefiles.

llvm-svn: 187426
2013-07-30 17:33:30 +00:00
Ed Maste ed71850ab2 tests: process connect needs "-p gdb-remote" on FreeBSD as on Linux
llvm-svn: 187418
2013-07-30 13:25:27 +00:00
Ed Maste 0d3ef27418 tests: Mark expected FreeBSD failures due to pr14424
These tests fail on FreeBSD due to missing build support, the same reason
they fail on Linux.

llvm-svn: 187416
2013-07-30 13:12:58 +00:00
Ed Maste 043370524d tests: Mark expected FreeBSD failures due to pr16697
llvm-svn: 187415
2013-07-30 13:08:24 +00:00
Daniel Malea 4d3de853a2 Fix TestConcurrentEvents to behave nicely with GCC 4.8
- newer gcc generates additional debuginfo for function exit (stack object desctruction) which was causing tests to fail
- work-around consists of not declaring any stack objects in main()

llvm-svn: 187389
2013-07-29 23:13:08 +00:00
Ed Maste 372c24d9f2 tests: Build test code on FreeBSD the same way as on Linux
llvm-svn: 187155
2013-07-25 21:02:34 +00:00
Ed Maste 6c00f6d54a tests: Mark expected FreeBSD failures due to pr16699
FreeBSD's Host class doesn't yet return a list of running processes,
so 'platform process list' fails and attach by process name does not
work.

llvm-svn: 187142
2013-07-25 18:36:09 +00:00
Ed Maste 861fc207a9 tests: Mark expected FreeBSD failures due to pr16706
Watchpoints are not yet working on FreeBSD

llvm-svn: 187134
2013-07-25 17:23:10 +00:00
Ed Maste d6107f2968 tests: Mark expected FreeBSD failures due to pr16696
Live debugging for threaded inferiors is not yet implemented on FreeBSD

llvm-svn: 187131
2013-07-25 17:17:15 +00:00
Ed Maste 6584e65d17 Skip dead-strip test also on FreeBSD
-dead_strip isn't supported by FreeBSD's ld.

llvm-svn: 187129
2013-07-25 16:53:38 +00:00
Ed Maste 2728793068 Annote expected failures on FreeBSD due to pr14540
PR title updated to indicate that FreeBSD is also affected: Backtrace
command does not display c++ member function names on Linux or FreeBSD

llvm-svn: 187127
2013-07-25 16:08:48 +00:00
Ed Maste 4d90f0f2c3 Fix test execution on FreeBSD versions other than 9.x
The tests use a plugin based on the name from sys.platform.
Unfortunately that string includes the major version number in
Python 2.7, so the tests would look for builder_freebsd9.py,
builder_freebsd10.py, etc.

The issue doesn't affect Linux as Python returns 'linux2' also
on Linux 3.x -- see http://bugs.python.org/issue12326 for details.

It seems later versions of Python will drop the major version
number, so adopt this convention now for FreeBSD.

llvm-svn: 187121
2013-07-25 13:24:34 +00:00
Matt Kopec f2430f5d2d Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.
llvm-svn: 187080
2013-07-24 21:39:24 +00:00
Ed Maste fac86fd06f tests: Mark expected FreeBSD failures due to pr16696
Live debugging of threaded inferiors is currently unimplemented for
FreeBSD.

llvm-svn: 187077
2013-07-24 21:09:24 +00:00
Ed Maste 1b2ed703fe tests: Mark expected FreeBSD failures due to pr16697
These fail due to:
error: Expression can't be run, because there is no JIT compiled function

llvm-svn: 187072
2013-07-24 20:30:34 +00:00
Ed Maste 8ed8689132 test_iter_registers is expected to fail on FreeBSD
Added comment to llvm.org/pr14600 that it fails on FreeBSD in the same way
as Linux.

llvm-svn: 187070
2013-07-24 19:49:20 +00:00
Ed Maste 24a7f7d714 Add expectedFailureFreeBSD test wrapper
llvm-svn: 187069
2013-07-24 19:47:08 +00:00
Stefanus Du Toit 2e36aaeaa7 Don't rely on C99 for loop initializers in test case
This allows compilation of the test case with GCC 4.8.

llvm-svn: 187057
2013-07-24 17:48:04 +00:00
Ashok Thirumurthi 073842bde1 Updating tests that fail with ICC 13.1 because of the different mapping of assembly to DWARF.
llvm-svn: 187035
2013-07-24 13:24:06 +00:00
Matt Kopec 8a052b9414 Fix rvalue test makefile.
llvm-svn: 186992
2013-07-23 22:08:15 +00:00
Ed Maste 8a0f8238b8 Skip test reported to hang the FreeBSD buildbot
llvm-svn: 186979
2013-07-23 19:19:23 +00:00
Ashok Thirumurthi cd20ee8369 Adds a test for "disassemble -a" after an assert, which can fail with ELF
because a synthetic symbol hasn't been provided for stripped function symbols.

llvm-svn: 186959
2013-07-23 17:20:17 +00:00
Ashok Thirumurthi d4b5a0f53f Reworked the test decorators to match the test results on the buildbots.
llvm-svn: 186717
2013-07-19 20:22:43 +00:00
Ashok Thirumurthi d54b12fcbc Updated the test suite to fix xpasses on the gcc buildbot primarily due to r186347 (thanks Greg!).
Your mileage may vary depending on the gcc and stl versions in use (see llvm.org/pr15301).

llvm-svn: 186706
2013-07-19 18:46:55 +00:00
Ashok Thirumurthi 044c36a21c Fix the partial backtrace when using a combination of stripped function symbols
and -fomit-frame-pointer.

- Parses eh_frame FDEs to determine the function address and size so that
the call frame parsing can continue.

Note: This code path is specific to ELF and PECOFF, because ObjectFileMachO
uses LCT_FunctionStarts to efficiently populate the symbol table.

Thanks to Jason Molenda for the review!

llvm-svn: 186585
2013-07-18 15:05:56 +00:00
Daniel Malea 7987088a8a Add tests for 'thread step out' for multithreaded programs
- test with python API
- test with command interpreter
- test stepping a single (selected) thread
- test stepping all threads in the program

llvm-svn: 186446
2013-07-16 19:41:37 +00:00
Sean Callanan 0e016fe31b Fixed a problem in IRForTarget where we would not
delete a constant after we replaced it with a
dynamically-computed value.  Also ensured that we
replace all users of the constant if there are
multiple ones.  Added a testcase.

<rdar://problem/14379043>

llvm-svn: 186363
2013-07-15 23:31:47 +00:00
Ashok Thirumurthi c3ae8e63f9 Adds a passing test for step-over and step-out when the inferior is about to call longjmp (non-local goto) in a single-threaded inferior.
llvm-svn: 186325
2013-07-15 15:05:33 +00:00
Daniel Malea 687d94571c Work-around for GCC issue where setting a breakpoint on a vector definition also adds a breakpoint on the d'tor call
llvm-svn: 186193
2013-07-12 19:46:47 +00:00
Daniel Malea 829942585d Fix gcc buildbot failures, re-enable tests disabled due to llvm.org/pr16575
llvm-svn: 186166
2013-07-12 16:02:25 +00:00
Jim Ingham f1715ab270 Get debugserver to call task_set_state to prime the control registers so that watchpoints
take for threads created while the program is running.  Remove the testcase skips from TestConcurrentEvents.py,
since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem -
so it doesn't artificially break on new thread creation before the watchpoint triggers.

llvm.org/pr16566
<rdar://problem/14383244>

llvm-svn: 186132
2013-07-11 23:20:35 +00:00
Greg Clayton 57ee306789 Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.

llvm-svn: 186130
2013-07-11 22:46:58 +00:00
Daniel Malea 37002ad30e Tentatively re-enabling TestBreakAfterJoin on Linux
- Unable to reproduce llvm.org/pr16170 locally

llvm-svn: 186129
2013-07-11 22:40:52 +00:00
Daniel Malea 10691b1d36 Enable Mac OS X tests disabled due to llvm.org/pr16567
- thread count remains correct now that we use pthread_kill() instead of kill() to deliver signals

llvm-svn: 186126
2013-07-11 22:28:17 +00:00
Daniel Malea 7df860a629 Improve TestConcurrentEvents.py
- code cleanup, improved reporting when failures take place
- ensure known thread is interrupted by using pthread_kill() instead of kill() in the signal worker thread
- above should avoid llvm.org/pr16567 on Mac OS X (though kill() could still cause threads to pop out of existance temporarily)
- added an additional check that all threads have exited after worker threads are all join()ed
- logged llvm.org/pr16603 for the new Linux bug discovered

llvm-svn: 186124
2013-07-11 22:14:47 +00:00
Enrico Granata eff81a471a Second attempt at getting the PyCallable changes in trunk
Thanks to Daniel Malea for helping test this patch for Linux happiness!

llvm-svn: 185965
2013-07-09 20:14:26 +00:00
Daniel Malea 6c4a0f0816 Cleanup in TestConcurrentEvents.py
- re-enable tests fixed by Matt's commit this morning (addressed llvm.org/pr16567)
- disabled tests affected by new bug llvm.org/pr16575
- removed some commented out code in inferior

llvm-svn: 185951
2013-07-09 17:36:18 +00:00
Andrew Kaylor 5743f1aafc Change TestRegisters.py attach case to attach to a.out and enable that test case
llvm-svn: 185947
2013-07-09 16:48:30 +00:00
Ed Maste a7f13f0510 Update exception to match decorator name
llvm-svn: 185891
2013-07-09 00:24:52 +00:00
Daniel Malea b3d41a278b Add TestConcurrentEvents test for LLDB's handling of inferior threads
- Test verifies LLDB's handling of inferiors with threads that: hit breakpoints,
  modfiy variables that have watchpoints set, generate user signals, and crash.
- Add a few "stress tests" (with ~100 threads) -- run these with "-l" dotest.py
  flag.
- Fix stop_reason_to_str helper in lldbutil to handle eStopReasonThreadExited.
- Add sort_stopped_threads helper to lldbutil to separate thread lists based
  on stop reason.

Logged llvm.org/pr16566 and llvm.org/pr16567 for bugs exposed.

llvm-svn: 185889
2013-07-09 00:08:01 +00:00
Daniel Malea fb7ace71cf Remove @expectedFailureGcc from TestInlineStepping as function prologue bug is not reproducible anymore.
llvm-svn: 185579
2013-07-03 20:51:44 +00:00
Daniel Malea cb3ded043c Skip Test-rdar-9974002 with Clang 3.4 (due to llvm.org/pr16214)
- should resolve remaining failures on clang buildbot

llvm-svn: 185576
2013-07-03 20:44:40 +00:00
Daniel Malea 804bdb3ead Add missing -std=c99 flag to appease GCC 4.6
- this issue was detected on recent GCC buildbot runs

llvm-svn: 185571
2013-07-03 19:34:25 +00:00
Daniel Malea e7322b3a6f Re-apply TestHelp.py fix
llvm-svn: 185570
2013-07-03 19:29:46 +00:00
Daniel Malea 7a433802cf Fix python 2.6 compatibility issue introduced by r184615
- argparse_compat library does not support reading environment variables
- should unblock Linux GCC buildbot from running tests again

llvm-svn: 185567
2013-07-03 18:50:03 +00:00
Daniel Malea 9a71a7d81b Revert commits that cause broken builds on GCC buildbots
- build fails due to PyCallable template definition inside an extern "C" scope

This commit reverts 185240, 184893 and 184608.

llvm-svn: 185560
2013-07-03 17:58:31 +00:00
Michael Sartain 802b055e78 Add split symbol support to test makefile & add linux split symbol test case.
llvm-svn: 185455
2013-07-02 18:13:13 +00:00
Enrico Granata 7934a878a0 More useful printout of arguments after the recent changes to support LLDB_TEST_ARGUMENTS
llvm-svn: 185246
2013-06-29 01:53:55 +00:00
Enrico Granata b4675a4e12 <rdar://problem/14266411>
The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened

This checkin changes that:
- SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string
- script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed

If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior

llvm-svn: 184893
2013-06-25 23:43:28 +00:00
Daniel Malea 795cc3afc3 Fix undefined behaviour in data formatter test -- ensure char* null-terminated
so LLDB does not read off the end of the array.

llvm-svn: 184877
2013-06-25 20:54:24 +00:00
Ed Maste 3d3295daab Skip dsym tests also on FreeBSD
llvm-svn: 184874
2013-06-25 19:59:56 +00:00
Ed Maste 09617a5d03 Skip tests that hang on FreeBSD
There's still significant work to do in the FreeBSD port, so no point
in a pr for these yet.

llvm-svn: 184871
2013-06-25 19:11:36 +00:00
Ed Maste 81ca910af7 Tests require GNU make, called gmake on FreeBSD
llvm-svn: 184748
2013-06-24 15:40:27 +00:00
Enrico Granata 091dd7be12 Test suite support for setting arguments through the environment
Set your env variable LLDB_TEST_ARGUMENTS to one or more options to be passed to the lldb test suite and those will be picked automatically

No more fighting about whether the progress bar is good or bad :-)

llvm-svn: 184615
2013-06-22 00:15:25 +00:00
Enrico Granata 57a8ca3a06 make command history test case run silently regardless of import status of module foo
llvm-svn: 184613
2013-06-22 00:01:21 +00:00
Enrico Granata c20eed4280 Lots of cleanup on the SWIG wrapping layer
Now, the way SWIG wrappers call into Python is through a utility PyCallable object, which overloads operator () to look like a normal function call
Plus, using the SBTypeToSWIGWrapper() family of functions, we can call python functions transparently as if they were plain C functions
Using this new technique should make adding new Python call points easier and quicker

The PyCallable is a generally useful facility, and we might want to consider moving it to a separate layer where other parts of LLDB can use it

llvm-svn: 184608
2013-06-21 23:27:16 +00:00
Sean Callanan a4e8105bfd Fixed a problem with materialization and
dematerialization of registers that caused
conditional breakpoint expressions not to
work properly.  Also added a testcase.

<rdar://problem/14129252>

llvm-svn: 184451
2013-06-20 18:42:16 +00:00
Enrico Granata 6d2cfb80ba Huge speedup for testsuite categories
This ensures that we won't try to do cleanups of test cases that we are skipping
e.g. this brings down the time required to run the cmdline category on my machine from ~70s to ~30s

llvm-svn: 184363
2013-06-19 21:48:09 +00:00
Enrico Granata 9ac21aef9b <rdar://problem/14086503>
Hardening the libstdc++ std::map test case against line table changes

llvm-svn: 184265
2013-06-19 00:20:57 +00:00
Enrico Granata d223563a59 <rdar://problem/14086503>
Hardening the libstdc++ std::vector test case against line table changes

llvm-svn: 184264
2013-06-19 00:14:02 +00:00
Enrico Granata a2e7f9ab2b <rdar://problem/14194128>
ClangASTContext was failing to retrieve fields and base class info for ObjC variables
This checkin fixes that and adds a test case

llvm-svn: 184248
2013-06-18 22:40:36 +00:00
Enrico Granata a62e38c898 Adding a "cmdline" category to the test suite
llvm-svn: 184155
2013-06-18 00:22:27 +00:00
Enrico Granata 63123b6484 Renaming the "--wipe" option to "command history" to "--clear" (-C) for coherence with the rest of the LLDB command-line interface
llvm-svn: 184147
2013-06-17 23:28:27 +00:00
Enrico Granata 7594f14f7d <rdar://problem/14134716>
This is a rewrite of the command history facility of LLDB

It takes the history management out of the CommandInterpreter into its own CommandHistory class
It reimplements the command history command to allow more combinations of options to work correctly (e.g. com hist -c 1 -s 5)
It adds a new --wipe (-w) option to command history to allow clearing the history on demand
It extends the lldbtest runCmd: and expect: methods to allow adding commands to history if need be
It adds a test case for the reimplemented facility

llvm-svn: 184140
2013-06-17 22:51:50 +00:00
Matt Kopec 2ee99f4922 Fix breakpoint test to account for full path of source file location.
llvm-svn: 184126
2013-06-17 21:27:50 +00:00
Matt Kopec 36e5a7db2a Fix single whitespace before breakpoint filename in some tests due to r183932.
llvm-svn: 184104
2013-06-17 19:00:31 +00:00
Greg Clayton 1767a73bc8 Added a new makefile setting that can be set in LLDB makefiles: USE_LIBCPP. This will enable libc++ support.
Improved the makefile "clean" to include deleting all ".d.[0-9]+" files.

Added options to the "lldb/examples/lookup" example and made it build using the LLDB_BUILD_DIR. If this is not set, it will default to "/Applications/Xcode.app/Contents/SharedFrameworks" on Darwin.

Added options to the "lldb/examples/function" example and made it build using the LLDB_BUILD_DIR.

llvm-svn: 183949
2013-06-13 21:27:14 +00:00
Daniel Malea 31ebbed47a If using clang 3.4, skip tests affected by llvm.org/pr16214
- clang emits incomplete DWARF information for structures referenced via typedef

llvm-svn: 183846
2013-06-12 16:48:33 +00:00
Daniel Malea c087a6bd54 Update TestRegisters for running on Linux (filed llvm.org/pr16301)
- skip the attach cases in TestRegisters.py -- caused slowness/sigabrt
- fixed log file removal function (in case test is run with -# flag)

llvm-svn: 183812
2013-06-12 00:13:43 +00:00
Greg Clayton bc8fc0f5e0 Use llvm::APFloat for formatting if a target is available. Each target when debugging has a "ASTContext" that helps us to use the correct floating point semantics. Now that APFloat supports toString we now use that. If we don't have a target, we still fall back on the old display methodology, but the important formatting should always have a target available and thus use the compiler floating point code.
Modified the test programs to use floating point constants that always will display correctly. We had some numbers that were being rounded, and now that we are using clang, we no longer round them and we get more correct results.

llvm-svn: 183792
2013-06-11 21:56:55 +00:00
Enrico Granata 7bd2bbb9ac <rdar://problem/13779789>
Allow memory read -t to take persistent types (those defined with expression struct $....)

llvm-svn: 183766
2013-06-11 18:47:55 +00:00
Andrew Kaylor 69cb7d40fd Updating convenience register attach test
llvm-svn: 183580
2013-06-07 22:16:14 +00:00
Andrew Kaylor 5c282cc886 Don't set stdin to devnull for forked processes
llvm-svn: 183578
2013-06-07 22:12:54 +00:00
Ashok Thirumurthi ec000b6714 Revert r183281, adds a comment about how to reproduce the hang.
llvm-svn: 183569
2013-06-07 20:58:47 +00:00
Enrico Granata a1acb49188 Tweaking Daniel Malea's fixes to Makefile.rules to ensure that we correctly pass -stdlib=libstdc++ to clang when compiling as well as when linking
Not doing this was causing link errors as clang was looking for libc++ symbols while linking against libstdc++

llvm-svn: 183482
2013-06-07 01:58:52 +00:00
Enrico Granata 1a8aa4c04e Tweaks to the std::list (libstdc++ test case)
llvm-svn: 183480
2013-06-07 01:53:59 +00:00
Ashok Thirumurthi e244ceec2e Adding a test case for pr15415 - partial backtrace with -fomit-frame-pointer
that is patterned after its parent TestInferiorCrashing.py.

- The xfail decorator limits the xfail to tool-chains that support this compiler option.
- Included a TODO concerning the platform-specific behavior when 'next' is issued after a crash.
- Toggling -fomit-frame-pointer results in an xpass as mentioned in pr15415.

Thanks to Daniel for the review, and Samuel for the bug report and reproducer.

llvm-svn: 183434
2013-06-06 19:22:05 +00:00
Ashok Thirumurthi 3b03728227 Reworked the routine that qualifies the tool-chain for expected failures to handle sub-strings.
- For instance, allows 'gcc' to match x86-64-linux-gnu-gcc as required on some Debian builds.
- Also adds doc-strings and a more consistent naming convention for related helpers.

llvm-svn: 183415
2013-06-06 14:23:31 +00:00
Enrico Granata ed4b293b68 <rdar://problem/14064994>
Fixing a test case to correctly check that the class name has changed instead of relying on GetValueDidChange()

llvm-svn: 183364
2013-06-06 00:58:37 +00:00
Sean Callanan 415422ce76 Fixes for the IR interpreter:
- Implemented the SExt instruction, and

 - eliminated redundant codepaths for constant
   handling.

Added test cases.

<rdar://problem/13244258>
<rdar://problem/13955820>

llvm-svn: 183344
2013-06-05 22:07:06 +00:00
Daniel Malea 692074622c Add test cases for attaching to a process after fork
- one test case is due to llvm.org/pr16229
- other test case uses a Linux workaround for above by using os.fork() instead of subprocess module

Patch by Andy Kaylor!

llvm-svn: 183340
2013-06-05 21:07:02 +00:00
Daniel Malea c7ffa7a958 Fix Makefiles in the data-formatter-stl tests
- specify compiler flag -stdlib=libstdc++ only if using clang (not supported in gcc)

llvm-svn: 183333
2013-06-05 19:32:34 +00:00
Enrico Granata b26fdada54 <rdar://problem/13125225>
Adding data formatters for std::set, std::multiset and std::multimap for libc++
The underlying data structure is the same as std::map, so this change is very minimal and mostly consists of test cases

llvm-svn: 183323
2013-06-05 17:47:23 +00:00
Matt Kopec 17b1624dda Skip intermittent watchpoint test failure when testing on Linux/gcc.
llvm-svn: 183316
2013-06-05 15:36:33 +00:00
Andrew Kaylor 912a710a8a Re-enabling a test that is no longer failing
llvm-svn: 183281
2013-06-04 23:38:51 +00:00
Enrico Granata daa0ac48e6 <rdar://problem/12582328>
If you want to define a formatter for "array of Foo of any size", ordinarily you would say

-x "Foo \[[0-9]+\]"

this checkin allows you to instead say "Foo[]" (or "Foo []") and LLDB will automatically create the regular expression and add the -x flag on your behalf

llvm-svn: 183272
2013-06-04 22:25:36 +00:00
Daniel Malea 1d1592624c Un-skipping test that was disabled due to llvm.org/pr16191
- adding workaround recommended by Greg (-fno-limit-debug-info clang flag)
- filed bug llvm.org/pr16214 against Clang

llvm-svn: 183156
2013-06-03 21:42:50 +00:00
Matt Kopec 6f961239ae Fix setting of watchpoints on inferior thread creation for Linux.
llvm-svn: 183139
2013-06-03 17:40:20 +00:00
Daniel Malea fac51ab5e2 Skipping test case for clang 3.4 due to llvm.org/pr16191
- should resolve remaining buildbot issues with debian/clang builder

llvm-svn: 183044
2013-05-31 21:05:23 +00:00
Enrico Granata b294fd2037 <rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases
Details follow:
an SBValue has children and those are fetched along with their values
Now, one calls SBValue::SetFormat() on the parent
Technically, the format choices should propagate onto the children (see ValueObject::GetFormat())
But if the children values are already fetched, they won't notice the format change and won't update themselves
This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one
A test case is also added

llvm-svn: 183030
2013-05-31 19:18:19 +00:00
Sean Callanan 7d01ddd6f8 Fixed value evaluation to handle null constants.
<rdar://problem/14005311>

llvm-svn: 183022
2013-05-31 17:29:03 +00:00
Enrico Granata e0c70f1b2c <rdar://problem/11109316>
command script import now does reloads - for real
If you invoke command script import foo and it detects that foo has already been imported, it will
 - invoke reload(foo) to reload the module in Python
 - re-invoke foo.__lldb_init_module
 This second step is necessary to ensure that LLDB does not keep cached copies of any formatter, command, ... that the module is providing

Usual caveats with Python imports persist. Among these:
 - if you have objects lurking around, reloading the module won't magically update them to reflect changes
 - if module A imports module B, reloading A won't reload B
These are Python-specific issues independent of LLDB that would require more extensive design work

The --allow-reload (-r) option is maintained for compatibility with existing scripts, but is clearly documented as redundant - reloading is always enabled whether you use it or not

llvm-svn: 182977
2013-05-31 01:03:09 +00:00
Daniel Malea 960d738510 Find 'ps' command using which() rather than invoking directly
- should address Debian test errors due to not being able to 'ps' directly

llvm-svn: 182965
2013-05-30 21:48:58 +00:00
Daniel Malea 4a01e59354 Improve TestExitDuringStep to verify thread behaviour during step-over, step-in in addition to step-inst
Patch by Brian Minard!

llvm-svn: 182961
2013-05-30 21:14:31 +00:00
Matt Kopec ef7ea33178 Disabling another watchpoint test with intermittent failure.
llvm-svn: 182952
2013-05-30 18:54:48 +00:00
Matt Kopec 03da5167cd Remove extraneous files from test directory.
llvm-svn: 182943
2013-05-30 17:59:36 +00:00
Andrew Kaylor baa14e852b Fixing problems with thread create during step test.
llvm-svn: 182888
2013-05-29 22:40:17 +00:00
Andrew Kaylor bc46d567b7 Disabling watchpoint test with intermittent failure.
llvm-svn: 182887
2013-05-29 22:12:53 +00:00
Ashok Thirumurthi 6eb0cadda7 Refactors to provide two variants for evaluation of text_list:
- The original test now passes on Linux with clang because a breakpoint is hit prior to evaluation of text_list, which improves text coverage.
- The new test fails because 4 steps are requested, and only two occur prior to evaluation of text_list.
--- Note that the loss of every second "next" command can be reproduced using lldb manually with this script.

llvm-svn: 182860
2013-05-29 14:58:27 +00:00
Andrew Kaylor 288ae669b4 Removing expected fail from another test that is now passing.
llvm-svn: 182815
2013-05-29 01:15:49 +00:00
Andrew Kaylor 0e46dbd119 Removing expected failures for watchpoint tests which are now passing.
llvm-svn: 182813
2013-05-29 00:26:53 +00:00
Andrew Kaylor 93132f504f Adding support for stopping all threads of multithreaded inferiors on Linux. Also adding multithreaded test cases.
llvm-svn: 182809
2013-05-28 23:04:25 +00:00
Sean Callanan 0b342b6ddf Fixed signed operations in the IR interpreter.
Scalar now can make itself signed if needed.

<rdar://problem/13977632>

llvm-svn: 182668
2013-05-24 20:36:56 +00:00
Sean Callanan fbf5c682cb Fixed a bug where persistent variables did not
live as long as they needed to.  This led to
equality tests involving persistent variables
often failing or succeeding when they had no
business doing so.

To do this, I introduced the ability for a
memory allocation to "leak" - that is, to
persist in the process beyond the lifetime of
the expression.  Hand-declared persistent
variables do this now.

<rdar://problem/13956311>

llvm-svn: 182528
2013-05-22 22:49:06 +00:00
Greg Clayton 23386cb1df <rdar://problem/13455021>
Add test case to make sure we don't regress on fat files full of skinny BSD archives.

llvm-svn: 182440
2013-05-21 23:58:54 +00:00
Greg Clayton fc2f7a53f7 Quiet the new exec test case down so it doesn't spew debug prints.
llvm-svn: 182429
2013-05-21 22:00:39 +00:00
Greg Clayton 8cda7f0830 Added a test case that verifies that LLDB can debug across a process exec'ing itself into a new program. This currently is only enabled for Darwin since we exec from 64 bit to 32 bit and vice versa for 'x86_64' targets.
This can easily be adapted for linux and other platforms, but I didn't want to break any buildbots by assuming it will work.

llvm-svn: 182428
2013-05-21 21:55:59 +00:00
Ashok Thirumurthi 7129bd8e25 Avoided the use of two test decorators with xfail/xpass logic in the same test.
- Used xfail and skip, temporarily, while resolving bugzilla #15671.

llvm-svn: 182159
2013-05-17 21:00:56 +00:00
Ashok Thirumurthi c97a6083e2 Fix xpasses on the gcc buildbots using compiler versions to qualify the xfail.
- Note that this is not correct, as the failure is associated with build options of libc.so, however it's failing on a Debian buildbot that uses gcc 4.6.2 (and the real goal is a complete backtrace even with -fomit-frame-pointer).

- Adds helpers to lldbtest.py to check the expectedCompiler and expectedVersion, with an eventual goal of reducing the number of test decorators.
--- Currently allows a comparison operator and a compiler version to be specified.
--- Can be extended to support ranges of compiler versions.

llvm-svn: 182155
2013-05-17 20:15:07 +00:00
Ashok Thirumurthi 26c0a19f62 Modifies the log directory to ensure that the log file will be found on tear-down (i.e. for CI agents that clean up artifacts aggressively).
- Uses the cwd following the model of TestPublicAPIHeaders.py

llvm-svn: 182116
2013-05-17 15:44:58 +00:00
Ashok Thirumurthi b4e5134ff8 Adds a test case for bugzilla #15671 patterned after TestInferiorCrashing.py.
- On Linux, the partial back-trace after an assert can cause the basic test to fail as discussed on lldb-dev.
- Uses SBFrame to walk up the stack to the assert site and tests expression evaluation of locals, globals and arguments.

Thanks to Daniel for review and testing on OS/X.

llvm-svn: 182115
2013-05-17 15:35:15 +00:00
Ashok Thirumurthi 51e9c19334 Uses a helper to consistently verify the stop reason in all tests.
- Also removes a redundant import statement.

llvm-svn: 182111
2013-05-17 15:22:33 +00:00
Ashok Thirumurthi 14238b6c78 Updated TestAbbreviations to reflect the changed output in r182068.
llvm-svn: 182104
2013-05-17 15:03:59 +00:00
Jim Ingham 641a67ce26 Handle the case where there is a user breakpoint set at the location of one of our
function call exception catching breakpoints.  We need to force ourselves to stop in
that case.

<rdar://problem/13903801>

llvm-svn: 182056
2013-05-16 21:52:36 +00:00
Daniel Malea 3be69dac8d Fix Linux 'platform status' command. Its output is now closer to that on Mac OS X
- resolves llvm.org/pr14806

Patch by Matthew Sorrels!

llvm-svn: 182030
2013-05-16 17:52:04 +00:00
Ashok Thirumurthi 863bd4a534 Fixed an xpass due to r181841 on Linux with gcc. Note that the clang variant contains to xfail, and r181841 is a fix for the test.
llvm-svn: 181918
2013-05-15 20:26:30 +00:00