Commit Graph

2333 Commits

Author SHA1 Message Date
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
Daniel Malea e8bdd1f5c0 Clean up linux test decorators and add links to known bugs
- s/skipOnLinux/skipIfLinux/ to match style of every other decorator
- linkify bugizilla/PR numbers in comments

No intended change in functionality.

llvm-svn: 181913
2013-05-15 18:48:32 +00:00
Daniel Malea 243b379aa1 Re-enable tests disabled due to llvm.org/pr14541
- "platform process list" command works on Linux now
- "process attach -n" (attach to process by name also works on Linux now)

llvm-svn: 181905
2013-05-15 17:55:12 +00:00
Daniel Malea 5cb6ea08f1 Revert r181833: lldb prompt issue still occurs on buildbot (http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/4124)
- maybe consider checking in the 'good' version of libedit to avoid ancient system version

llvm-svn: 181903
2013-05-15 17:50:37 +00:00
Daniel Malea 0a693d9d66 Disable test case that causes assertion failure on Linux
- filed llvm.org/pr16016
- fixed URL for llvm.org/pr16000

llvm-svn: 181902
2013-05-15 17:46:16 +00:00
Jim Ingham c0dfddb302 Didn't mean to check in this change...
llvm-svn: 181858
2013-05-15 01:12:43 +00:00
Jim Ingham bd4a5eccd6 Need to add the LLDB.framework directory to the rpath for the driver programs or they won't run.
llvm-svn: 181857
2013-05-15 01:11:30 +00:00
Greg Clayton 609a433159 Unbreak the linux buildbot tests. This still fails for the clang that is being used on linux.
llvm-svn: 181845
2013-05-14 23:21:47 +00:00
Greg Clayton bc8d23956c Fixed the test case to pass on Darwin. This might pass on linux as well. The test case now properly validates g_points as a global for the class A version, and the static variable for the file static.
llvm-svn: 181840
2013-05-14 22:17:29 +00:00
Daniel Malea 9d38385861 Remove XFAIL from tests affected by llvm.org/pr-14637
- unable to repro locally, much like many people commenting on the issue

llvm-svn: 181833
2013-05-14 21:19:22 +00:00
Daniel Malea 9fbc230de2 Fix GCC buildbot failures in API/Multithreaded tests
- fix typo initializing unique_ptr
- add missing throw specifier to play nice with older libstdc++ exception class

llvm-svn: 181831
2013-05-14 21:00:47 +00:00
Daniel Malea 4835990a6f Skip C++ API/Multithreaded tests that are unsupported with Clang/libstdc++
- older versions of clang are unable to include <chrono> from libstdc++
- skipping tests until buildbots are updated

llvm-svn: 181829
2013-05-14 20:48:54 +00:00
Daniel Malea b2132553d9 Adding C++ tests that drive LLDB from multiple threads
- test_breakpoint_callback -- filed llvm.org/pr-16000
- test_listener_resume -- resume a process from a thread waiting on SBListener
- test_listener_event_description -- SBEvent description from SBListener thread
- test_listener_event_process -- query process/thread/stack info from SBListener thread

llvm-svn: 181819
2013-05-14 19:13:25 +00:00
Ashok Thirumurthi b5209bd875 Avoid $rax for 32-bit inferiors to fix a failing i386 test on the darwin buildbots.
llvm-svn: 181789
2013-05-14 13:34:25 +00:00
Andrew Kaylor d4dc579304 Adding new test cases for inferior crashing.
llvm-svn: 181742
2013-05-13 23:47:25 +00:00
Matt Kopec 201284a8d3 Add expression tests for a function in an anonymous namespace.
llvm-svn: 181741
2013-05-13 22:00:32 +00:00
Ashok Thirumurthi cdb5b61a2d Prevent convenience registers from being included in "read register" as they are derived registers.
- Also refactors TestRegisters.py because test_convenience_registers_with_process_attach now fails with an assert.

TODO: Cross-reference the skipOnLinux decorator with a bugzilla report after root-causing this issue.
llvm-svn: 181737
2013-05-13 21:45:50 +00:00
Daniel Malea b218b7f22a Unset CFLAGS/CXXFLAGS when running tests via cmake/make check targets
- should fix automatic tests set up on http://llvm-jenkins.debian.net
- needed in order to make Debian package builds depend on passing test suite

llvm-svn: 181736
2013-05-13 21:41:35 +00:00
Daniel Malea 09ec3a51c6 Cleanup test output when run via cmake/make check targets
llvm-svn: 181735
2013-05-13 21:37:02 +00:00
Ashok Thirumurthi 1999b6d68c Fixed expression evaluation with convenience registers.
- Also improved test coverage for passing tests to include expr/x
and a sanity check for $eax as the lower half of $rax.

llvm-svn: 181727
2013-05-13 19:56:46 +00:00
Matt Kopec d608996610 Add temporary fix for calling c++ global/anonymous functions on Linux.
llvm-svn: 181613
2013-05-10 17:53:48 +00:00
Andrew Kaylor 29d65744c9 Adding support for setting thread stop state when a process stops.
This re-submission of this patch fixes a problem where the code sometimes caused a deadlock.  The Process::SetPrivateState method was locking the Process::m_private_state variable and then later calling ThreadList::DidStop, which locks the ThreadList mutex.  Other methods in ThreadList which were being called from other threads lock the ThreadList mutex and then call Process::GetPrivateState which locks the Process::m_private_state mutex.  To avoid deadlocks, Process::SetPrivateState now locks the ThreadList mutex before locking the Process::m_private_state mutex.

llvm-svn: 181609
2013-05-10 17:19:04 +00:00
Ashok Thirumurthi 1fef0071ac Removed expectedFailureDarwin, and added a note about the disparity between the automated tests and testing at the lldb command-line.
llvm-svn: 181602
2013-05-10 16:10:23 +00:00
Ashok Thirumurthi f19caa1227 Added an integration test to step through a crash and then test for globals, locals, arguments, registers and the back-trace.
llvm-svn: 181599
2013-05-10 14:37:49 +00:00
Ashok Thirumurthi acbb1a5db5 Fixed "log enable linux registers" and added a test.
- Eliminated the use of static for methods that read m_register_infos, so that these routines can be implemented in the base class.
- Eliminated m_register_infos in the base class because this is not used when derived classes call UpdateRegisterInfo.
- Also moved the namespace using declarations from headers to source files.

Thanks to Daniel and Samuel for their review feedback.

llvm-svn: 181538
2013-05-09 19:59:47 +00:00
Daniel Malea e347243061 Revert r181482 as it causes occasional hangs in LLDB buildbots
llvm-svn: 181526
2013-05-09 17:34:40 +00:00
Ashok Thirumurthi 582133e88e Skipping a test that asserts with gcc and icc to allow the test suite to run to completion on the gcc buildbot.
llvm-svn: 181512
2013-05-09 14:46:01 +00:00
Enrico Granata da144dc216 Changing the std::map test case to use source breakpoints instead of relying on the nexting always "getting it right" to stop at the locations of interest
This should make us more robust in the face of changing compiler line tables and other library modifications

llvm-svn: 181497
2013-05-09 01:04:59 +00:00
Greg Clayton 65c163529d Fixed the process attach by name test to get the target _after_ doing process attach. Otherwise the target isn't valid. This fixes 2 test suite failures on darwin.
llvm-svn: 181488
2013-05-08 23:45:06 +00:00
Greg Clayton dbe445fdd8 Remove debug print statement.
llvm-svn: 181486
2013-05-08 23:37:59 +00:00
Andrew Kaylor 14263f31ae Adding code to set thread state to stopped when the process stops.
llvm-svn: 181482
2013-05-08 23:15:46 +00:00
Enrico Granata b7d6e2a4e0 Test case added for importing packages
llvm-svn: 181472
2013-05-08 21:26:37 +00:00
Matt Kopec 4fadea28d1 Mark multi-threaded watchpoint test as skip on Linux due to lldb assertions in the debian buildbot.
llvm-svn: 181454
2013-05-08 17:52:17 +00:00
Matt Kopec 52c8476a47 Fix assertion from previous fix for debian os watchpoints.
Also mark one of the tests as expected fail on Linux due to the debian fix.

llvm-svn: 181448
2013-05-08 16:52:34 +00:00
Daniel Malea ee6481273e Adding test-case for llvm.org/pr15936 (known failure with GCC 4.6/4.7)
- verify that backtraces for stacks that include functions which contain 
  illegal instructions are correct, and that variables in said functions can be
  printed.

llvm-svn: 181442
2013-05-08 15:09:30 +00:00
Daniel Malea 32052b62ae Fix rdar-13338477 test-case for Linux.
- Using __builtin_trap confuses the stack unwinder
- __builtin_trap specific test will be added shortly

llvm-svn: 181441
2013-05-08 15:07:24 +00:00
Jim Ingham 221d51cf84 Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value.  This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh!  I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.

Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming.  That allows 
us to handle resuming in a more controlled fashion.

Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--

M    test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M    include/lldb/Target/ThreadList.h
M    include/lldb/Target/ThreadPlanStepOut.h
M    include/lldb/Target/Thread.h
M    include/lldb/Target/ThreadPlanBase.h
M    include/lldb/Target/ThreadPlanStepThrough.h
M    include/lldb/Target/ThreadPlanStepInstruction.h
M    include/lldb/Target/ThreadPlanStepInRange.h
M    include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M    include/lldb/Target/ThreadPlanStepUntil.h
M    include/lldb/Target/StopInfo.h
M    include/lldb/Target/Process.h
M    include/lldb/Target/ThreadPlanRunToAddress.h
M    include/lldb/Target/ThreadPlan.h
M    include/lldb/Target/ThreadPlanCallFunction.h
M    include/lldb/Target/ThreadPlanStepOverRange.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M    source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M    source/Target/StopInfo.cpp
M    source/Target/Process.cpp
M    source/Target/ThreadPlanRunToAddress.cpp
M    source/Target/ThreadPlan.cpp
M    source/Target/ThreadPlanCallFunction.cpp
M    source/Target/ThreadPlanStepOverRange.cpp
M    source/Target/ThreadList.cpp
M    source/Target/ThreadPlanStepOut.cpp
M    source/Target/Thread.cpp
M    source/Target/ThreadPlanBase.cpp
M    source/Target/ThreadPlanStepThrough.cpp
M    source/Target/ThreadPlanStepInstruction.cpp
M    source/Target/ThreadPlanStepInRange.cpp
M    source/Target/ThreadPlanStepOverBreakpoint.cpp
M    source/Target/ThreadPlanStepUntil.cpp
M    lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme

llvm-svn: 181381
2013-05-08 00:35:16 +00:00
Andrew Kaylor bf9b4c171a Adding support for process attach by pid on Linux.
llvm-svn: 181374
2013-05-07 22:46:38 +00:00
Matt Kopec e9ea0da82e Add watchpoint support for Linux on 64-bit host.
llvm-svn: 181341
2013-05-07 19:29:28 +00:00
Enrico Granata e5cc5cd5ac Making it possible to specify a substring for a category name as long as the match is unique
llvm-svn: 181281
2013-05-07 00:36:28 +00:00
Daniel Malea 0b7c611f56 Fix typo in C++11 flag for the GCC 4.6 code path: missing '-'
llvm-svn: 181239
2013-05-06 19:31:31 +00:00
Greg Clayton 5fe0e7b2f6 Fixed a test suite typo error that caused the test to fail.
llvm-svn: 181069
2013-05-03 23:04:47 +00:00
Andrew Kaylor 46791da61a Adding test for non-API process attach
llvm-svn: 180977
2013-05-03 00:10:27 +00:00
Greg Clayton 5378bbaec0 Mark TestConstVariables as expected to fail due to radar 13314878 on darwin. The tests are already skipped on linux.
llvm-svn: 180965
2013-05-02 22:19:05 +00:00
Greg Clayton 6ad5269558 <rdar://problem/13788579>
TestRegisters failing on buildbot on MacOSX. Some registers that were valid for linux/freebsd, were not valid on MacOSX. The tests now allow a register be skipped if it doesn't exist on the host.

llvm-svn: 180961
2013-05-02 22:00:02 +00:00
Daniel Malea 55faa40823 Fix check_public_api_headers test on mac os x, and refactor some logic into lldbtest.py
- moved build logic from Makefile and TestPublicAPIHeaders.py into lldbtest to allow reuse
- added decorator @skipIfi386

llvm-svn: 180955
2013-05-02 21:44:31 +00:00
Ashok Thirumurthi 759a217dab Changing the test to use eax rather than rax for compatibility with i386.
llvm-svn: 180952
2013-05-02 21:15:23 +00:00
Enrico Granata a9a50ffb02 <rdar://problem/13338477>
clang sugarcoats expressions of the sort *(int (*)[3])foo where foo is an int* saying that their type class is Paren
This checkin updates our lookup tables to properly desugar Paren into the actual type of interest

llvm-svn: 180938
2013-05-02 18:54:54 +00:00
Ashok Thirumurthi fa6e1f94a4 Refactored convenience register tests to provide some coverage on Linux that is not marked xfail.
- Also minor improvements to the comments and the expected results.

llvm-svn: 180876
2013-05-01 20:07:13 +00:00
Sean Callanan 99c272d3eb TestCallCPPFunction is an expected failure on
Linux; marking as such.

llvm-svn: 180832
2013-04-30 23:52:02 +00:00
Andrew Kaylor 9f6c535b0d Refactoring thread state tests to show individual failures
llvm-svn: 180828
2013-04-30 23:39:14 +00:00
Sean Callanan 8d285ada3d Added a test case verifying that simple C++
functions can be called by basename.

<rdar://problem/13709855>

llvm-svn: 180814
2013-04-30 22:05:15 +00:00
Sean Callanan a30b5b7a97 Fixed the anonymous testcase. It was testing
access to 'z' where 'z' was not in scope.

llvm-svn: 180662
2013-04-27 01:53:20 +00:00
Daniel Malea 25029a00ca skip randomly failing test to avoid buildbot noise
llvm-svn: 180636
2013-04-26 21:39:11 +00:00
Matt Kopec 23a03de34d Mark tests as expected fail for Linux due to not being able to call/print c++ demangled functions in the global namespace (bugzilla 15854).
llvm-svn: 180623
2013-04-26 20:04:24 +00:00
Andrew Kaylor a5d0f84694 Removing invalid test cases from thread state test
llvm-svn: 180613
2013-04-26 17:47:10 +00:00
Ashok Thirumurthi 999caf900a Adds 64-bit POSIX support for AVX
- Adds unique enums for ymm registers to the ABI and the POSIX register context.
- Reworks the register context data structures to support a union of FXSAVE and XSAVE
--- Allows the same code base to deal with the FPU independent of the availability of AVX.
- Determine if AVX is supported by attempting to read XSAVE using ptrace.
--- Support an extended register set for avx registers if available.
- Provide a mechanism to assemble/parse register halves into a single ymm buffer for use with RegisterValue.
--- Reworked Read/WriteRegister routines to read/write/parse ymm registers.

Adds tests for ymm register write with read-back, and expressions involving ymm registers.
- Tests vary depending on the availability of an avx register set.

Thanks to Daniel and Matt for their reviews.

llvm-svn: 180572
2013-04-25 20:12:45 +00:00
Sean Callanan 2ad6691be4 Fixed IRForTarget to handle Objective-C messages
sent to "super".

<rdar://problem/13042260>

llvm-svn: 180217
2013-04-24 21:25:20 +00:00
Sean Callanan 76ee3e7e1c Fixed expression parser handling of empty strings.
<rdar://problem/12977827>

llvm-svn: 180215
2013-04-24 19:50:12 +00:00
Sean Callanan 7f5ac65fb9 Added support for pulling Objective-C class symbols
out of the runtime.  This allows calling static methods
on classes whose symbols have been stripped out of the
binary.

<rdar://problem/12042992>

llvm-svn: 180210
2013-04-24 19:07:29 +00:00
Sean Callanan 485f732b84 Fixed a problem where the expression parser would
not find multiple functions with the same name but
different types.  Now we keep track of what types
we've already reported for a function and only elide
functions if we've already reported a conflicting
one.

Also added a test case.

<rdar://problem/11367837>

llvm-svn: 180167
2013-04-24 00:34:41 +00:00
Daniel Malea ef2a53af71 Fix missing module name in expectedFailure calls
llvm-svn: 180158
2013-04-23 22:59:31 +00:00
Andrew Kaylor dbbe36b2ce Adding basic test for thread state (See PR-15824)
llvm-svn: 180149
2013-04-23 21:42:03 +00:00
Ashok Thirumurthi 9ba77246ca Added 64-bit POSIX support to write floating-point vector registers.
- Includes tests that write, read and verify vector register content.
            
Reviewed by: Daniel Malea

llvm-svn: 180143
2013-04-23 20:50:34 +00:00
Enrico Granata 5676839246 The new ReadStringFromMemory() API does not work correctly with NSStrings that have an explicit length and no NULL terminator
This checkin reverts NSString to the old behavior when appropriate, and cleans up the syntax to call the UTF Reader&Dumper function
Incidentally, add a "-d" command-line flag to redo.py with the same semantics as "-d" in dotest.py

llvm-svn: 180141
2013-04-23 20:05:05 +00:00
Enrico Granata a4f8741cfa Splitting the appkit data formatters test in smaller test cases - this should enable us to get a more detailed perspective on which individual data formatters are broken
llvm-svn: 180128
2013-04-23 18:07:30 +00:00
Daniel Malea 7a96af0627 Fix CheckPublicAPIHeaders test case
- LLDB C++ API requires C++11
- provide required -std=c++11 flag if none is specified

llvm-svn: 180126
2013-04-23 17:48:06 +00:00
Daniel Malea 243b36931f Fix linux argument completion with for "--" options (llvm.org/bugs/pr14425)
Patch by Yacine Belkadi!

When __GLIBC__ is defined, optind gets initialized to 0. So for the first parsed
option, parse_start is 0, too. If this option has no argument (Like "--continue"
of "process attach"), then the position stored is 0, instead of 1. This prevents
the completion later on in Options::HandleOptionCompletion() because the opt_pos
doesn't match the cursor_index.

Fix that by getting the option's position from the value of optind, as it's done
for the other types of options.

Re-enable test_process_attach_dash_dash_con() on Linux.

No regressions detected on Mac OS X (in TestCompletion.py)

llvm-svn: 180114
2013-04-23 15:28:10 +00:00
Ashok Thirumurthi c140c631cb Added 64-bit POSIX support to write general-purpose floating-point registers.
- Includes tests that write, verify and restore floating-point register content using SBFrame.

Reviewed by: Daniel Malea

llvm-svn: 180111
2013-04-23 14:59:02 +00:00
Ashok Thirumurthi 33d7f3a234 Splits register_commands into a passing test on Linux (to improve test coverage),
and a failing test for register expressions.

Also factors out common setup code in preparation to add a few new tests.
Reviewed by: Daniel Malea

llvm-svn: 180109
2013-04-23 14:32:25 +00:00
Ashok Thirumurthi f6cd60ae68 Improved tests for nested structs when anonymous structs are involved.
- New tests can fail on OS/X and Linux, and illustrate that the compiler
used to generate the DWARF can result in lldb providing clang with an
external AST source that doesn't describe all required struct fields.

- Also includes test coverage for expressions with structs that do work on Linux- Also includes a test for dereferencing a null pointer to a struct, which works on OS/X rather than complaining, and complains on Linux with an upstream error that is really a side issue.

Thanks to Samuel, Andy and Daniel for their input.

llvm-svn: 179884
2013-04-19 20:51:34 +00:00
Daniel Malea b42556f87c Fix (failing) test name reporting on buildbots
- now print both test name and suite

llvm-svn: 179870
2013-04-19 18:32:53 +00:00
Enrico Granata 7932844d9a Adding a test case for the changes made to ValueObjects to use iteration instead of recursion for navigating to their root - beware: a regression here will most probably cause a crash instead of a failure
llvm-svn: 179863
2013-04-19 17:24:11 +00:00
Ashok Thirumurthi 6ac9d13e61 Provided a variant of ReadCStringFromMemory that supports null terminators of any character width.
This prevents unbounded reads (i.e. reads of GetMaximumSizeOfStringSummary() bytes)
from causing test failures (i.e. due to ptrace EIO or EFAULT on Linux).

Note that ReadCStringFromMemory is marked as deprecated because the loop that calls
ReadMemory does not continue until the string has been completely read.
The expected behavior is to read until until max_bytes or a null terminator.

Note: As discussed on lldb-dev, further testing will be performed with ReadStringFromMemory
before further changes are made for users of ReadCStringFromMemory.

Thanks to Enrico, Matt and Andy for their review feedback.

llvm-svn: 179857
2013-04-19 15:58:38 +00:00
Ashok Thirumurthi 8971be89bb Added unit tests for register read (should pass) and the expression interpreter (xfail) after the inferior has crashed.
- Thanks to Samuel Jacob for the related reproducer.

Reviewed by: Daniel Malea.

llvm-svn: 179788
2013-04-18 20:11:55 +00:00
Sean Callanan 389823e995 Added a SetData() method to ValueObject. This
lets a ValueObject's contents be set from raw
data.  This has certain limitations (notably,
registers can only be set to data that is as
large as the register) but will be useful for
the new Materializer.

I also exposed this interface through SBValue.
I have added a testcase that exercises various
special cases of SBValue::SetData().

llvm-svn: 179437
2013-04-13 01:21:23 +00:00
Enrico Granata af5bbe8f74 New test suite option (-T)
When -T is specified, the test suite will call svn info and dump the output on screen (this used to be the default behavior)
When -T is not specified, this step won't be performed (the new default)

llvm-svn: 179342
2013-04-11 23:48:00 +00:00
Enrico Granata ea6a58e2ae When specifying a relative path for the --framework option to dotest.py, Python would end up being confused and unable to locate the embedded_interpreter module, causing every testcase that uses the Script Interpreter (e.g. functionalities/data-formatter/data-formatter-stl/libstdcpp) to fail without even trying
This checkin fixes that problem by absolutizing the path before pushing it to the sys.path

llvm-svn: 179341
2013-04-11 23:40:59 +00:00
Enrico Granata a0f9512cb1 <rdar://problem/13558484>
This makes the dynamic values test case work for both libc++ and libstdcpp

llvm-svn: 179333
2013-04-11 22:55:45 +00:00
Greg Clayton 1c8ef47681 Added support "__attribute__((__vector_size__(B)))" and "__attribute__((ext_vector_type(N)))".
Now we can:
1 - see the return value for functions that return types that use the "ext_vector_size"
2 - dump values that use the vector attributes ("expr $ymm0")
3 - modified the DWARF parser to correctly parse GNU vector types from the DWARF by turning them into clang::Type::ExtVector types instead of just standard arrays

llvm-svn: 178924
2013-04-05 23:27:21 +00:00
Greg Clayton 1a400cf485 Fixed the version test for darwin.
llvm-svn: 178595
2013-04-03 00:04:27 +00:00
Greg Clayton 2040f98008 Fix test case to not run to main and "next" 5 times. Use a breakpoint.
llvm-svn: 178552
2013-04-02 17:48:53 +00:00
Daniel Malea d659dc16cc Avoid hang in attach-by-name test case
- Check that process attach succeeded before attempting to WaitForProcessToStop (observed to cause hangs on Linux)
- Update comment in TestHelloWorld case -- attaching by name still broken

llvm-svn: 178491
2013-04-01 19:47:00 +00:00
Enrico Granata 3a193f4b11 Fixing Python commands test cases to work even after removing Printf
(and using the new syntax for printing :-)

llvm-svn: 178389
2013-03-30 00:53:13 +00:00
Enrico Granata cd58d1176f Making the buildbot happy again after changes to the default formatter for char[]
llvm-svn: 178295
2013-03-28 21:58:05 +00:00
Ashok Thirumurthi 4f5f39ac4c Introduces extended register sets whose availability can vary with the target processor.
- Includes a stub for AVX support in the x86-64 register context and a failing test for register sets that are unavailable.

Thanks to Greg Clayton for his review feedback.

llvm-svn: 178252
2013-03-28 17:27:40 +00:00
Enrico Granata 8cd208e39c This test case was not doing the right thing with libc++ being used and was generating spurious over-completion warning flags
llvm-svn: 178192
2013-03-27 23:08:54 +00:00
Enrico Granata c540f57ffc Checking that the wrong syntax does not give a correct summary after clearing the error messages here
llvm-svn: 177949
2013-03-26 00:24:27 +00:00
Greg Clayton fe736e889e Fix the buildbot so a LLDB test doesn't fail looking for "<invalid usage of pointer value as object>".
llvm-svn: 177926
2013-03-25 22:04:11 +00:00
Enrico Granata 005013c115 These test cases fail on the buildbot - skip on Linux for now, will figure out why
llvm-svn: 177879
2013-03-25 17:51:58 +00:00
Matt Kopec 9502ac6112 Mark TestChangeValueAPI.py as expected fail with gcc as it still reproduces.
llvm-svn: 177447
2013-03-19 22:00:10 +00:00
Greg Clayton 53c5ddf0d7 Fixed incorrect python that was trying to validate that we got a valid lldb.SBThread object by checking to see if it is equal to "None".
This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes. 

llvm-svn: 177416
2013-03-19 17:59:30 +00:00
Matt Kopec 862884327f Rework TestChangedValueAPI.py to account for gcc setting multiple breakpoints.
llvm-svn: 177198
2013-03-15 22:49:52 +00:00
Jim Ingham f48e20e15d Make the conditional break test case a little more robust.
llvm-svn: 177196
2013-03-15 22:19:27 +00:00
Matt Kopec f99f0b8cf7 Fix Makefile.rules where no icc is installed and -C gcc is used.
Patch by Ashok Thirumurthi.

llvm-svn: 177192
2013-03-15 21:55:13 +00:00
Matt Kopec 0de53f062f Add icc support to the test suite
-adds icc to the lit of compilers to run the tests
-adds icc test decorators
-skip TestAnonymous.py for icc

Patch by Ashok Thirumurthi.

llvm-svn: 177174
2013-03-15 19:10:12 +00:00
Daniel Malea 66586653b7 Add braces to crashed test summary (needed for buildbots to detect crashes)
llvm-svn: 176980
2013-03-13 21:50:49 +00:00
Daniel Malea b7e4e22795 Remove extra whitespace
llvm-svn: 176978
2013-03-13 21:18:54 +00:00
Daniel Malea 6b72269b3d Prepend "FAIL:" string to tests that crash so that buildbots pick them up.
llvm-svn: 176974
2013-03-13 21:08:02 +00:00
Daniel Malea 10320dd06f Minor LLDB test improvements
- fix TestCPPBool (was failing with some versions of GCC due to num_breakpoint_locations)
- speed up tests by skipping git/svn revision parsing by the test harness when running in lit-compatible (parsable) mode

This should resolve the failures reported by http://lab.llvm.org:8011/builders/lldb-x86_64-linux

llvm-svn: 176972
2013-03-13 20:50:05 +00:00
Daniel Malea 7f454e0aed Fix enum_types test on Linux
- Required flag "-std=c++11" needs to be set before including Makefile.rules

llvm-svn: 176644
2013-03-07 20:13:11 +00:00
Daniel Malea 4185a92b9d Fix issue that causes linux buildbots to ignore errors
- change string "ERROR" to "FAIL" to match clang lit test results

Also, make LLDB tests work on machines that do not have svn and/or git installed

llvm-svn: 176633
2013-03-07 18:39:26 +00:00
Daniel Malea 3c216ace9b Fix running of LLDB tests with cmake+ninja+ccache
- Avoid passing 'ccache' as the test compiler. Instead, use first arg after ccache.

llvm-svn: 176596
2013-03-07 00:50:54 +00:00
Andrew Kaylor 7bdeab592d Skipping TestConstVariables on Linux.
The test was marked as expectedFailureLinux, but now it passes with gcc and some versions of clang.  Newer versions of clang introduce a failure due to bad DWARF information.

llvm-svn: 176581
2013-03-06 21:37:41 +00:00
Greg Clayton 00108408ac Added tests to test for "settings set" with trailing whitespaces after the values.
llvm-svn: 176579
2013-03-06 21:17:06 +00:00
Greg Clayton 5d14fc061f Fixed enum printing for negative enums. There previously was no testing to validate that enum values were being displayed correctly.
Also added C++11 enum test cases to cover enums as int8_t, int16_t int32_t, int64_t, uint8_t, uint16_t, uint32_t, and uint64_t both for DWARF and dSYM cases. The DWARF being emitted by clang is missing the enum integer type, but the code is now ready to accept and deal with the integral type if it is supplied.

llvm-svn: 176548
2013-03-06 06:23:54 +00:00
Greg Clayton 2a844b7ff8 Fixed test suite errors due to new clang -v output.
llvm-svn: 176546
2013-03-06 02:34:51 +00:00
Greg Clayton 21c895e3d5 Now that "settings set" will strip leading and trailing spaces, we need a way to be able to specify string values that contain spaces. So now settings setting <property> <value>" can have a <value> that is quoted:
settings set prompt "(lldb2) "

llvm-svn: 176545
2013-03-06 02:19:38 +00:00
Daniel Malea ab5c2012d3 Fix Ninja LLDB build on Linux (via cmake -G Ninja)
- resolved circular dependency issue by making liblldb depend directly on LLDBWrapPython.cpp
- removed use of '..' for relative directories -- ninja doesn't like this
- fixed build-order problem

llvm-svn: 176517
2013-03-05 21:59:12 +00:00
Matt Kopec 3041286f64 Add support on POSIX to determine if an inferior has changed while debugging it.
llvm-svn: 176492
2013-03-05 17:23:57 +00:00
Daniel Malea 658fd5798b Un-skipping tests affected by llvm.org/pr15256
patch by Ashok Thirumurthi!

llvm-svn: 176462
2013-03-04 23:15:08 +00:00
Daniel Malea 208b5beb60 Fix makefile and re-enable test disabled due to llvm.org/pr15256
- fix is: don't pass incompatible -stdlib option when building with GCC

llvm-svn: 176460
2013-03-04 23:04:53 +00:00
Daniel Malea 9e84eb41f6 Add a test case for static member variables
- expected to fail across the board due to llvm.org/pr15401

Patch by Ashok Thirumurthi!

llvm-svn: 176362
2013-03-01 18:25:42 +00:00
Matt Kopec c51b243a43 Update TestCallStdStringFunction to expected fail for gcc and account for multiple breakpoint locations.
Patch from Ashok Thirumurthi.

llvm-svn: 176357
2013-03-01 17:29:16 +00:00
Daniel Malea 931b17c705 Finish up CMake support for LLDB (tested on Linux)
- add missing scripts (driver, tests, etc...)
- enable running of tests from cmake with "make check-lldb" target
- fix up problem with clang dependencies (this enables parallel builds)
- implement platform-specific FIXMEs in source/CMakeLists.txt

llvm-svn: 176306
2013-02-28 23:11:46 +00:00
Greg Clayton e595c6bf3c Replace all "-gdwarf-2" with "-g" to use the compiler defaults.
llvm-svn: 176283
2013-02-28 18:47:39 +00:00
Greg Clayton e6be63944e Fix the getCompilerVersion() function to do the right thing with clang 5.0 which now says "LLVM version" instead of "clang version".
llvm-svn: 176282
2013-02-28 18:46:31 +00:00
Greg Clayton 0d5911cbe9 Fixed an issue where the LDFLAGS were not correctly gettting modified to be additive.
llvm-svn: 176281
2013-02-28 18:45:39 +00:00
Daniel Malea 3b92f0095e Remove LLDB dependency on xcodeworkspace (on Linux) for version number
- make LLDB version number match Clang (and the Debian package)
- use the same revision detection magic that Clang uses to report SVN/Git revisions
- update test case as per above

Example output:

  $ lldb -v
  lldb version 3.3 (https://dmalea@llvm.org/svn/llvm-project/lldb/trunk revision 176211 clang revision 176208 llvm revision 176208)
ss

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

M    source/lldb.cpp
M    test/help/TestHelp.py
M    source/Makefile

llvm-svn: 176268
2013-02-28 16:51:15 +00:00
Matt Kopec 00049b8b96 Add GNU indirect function support in expressions for Linux.
llvm-svn: 176206
2013-02-27 20:13:38 +00:00
Daniel Malea 0aea016b06 Cleanup TestUniqueTypes.py and add getCompilerVersion() to test harness
- pull up logic to get compiler version from TestUniqueTypes.py into lldbtest.py
- work around an GCC 4.6.3 issue

llvm-svn: 176190
2013-02-27 17:29:46 +00:00
Enrico Granata d7ac9816eb <rdar://problem/13289828>
Categories were conceptually meant to be placeable on test methods as well as test classes and test directories
However, that was broken. This checkin fixes that.
The incantation required to put categories on individual test case methods is not exactly elegant, unfortunately:

def test_case(self):
    """Test me."""
    self.do_it()

def _test_case_get_categories(self):
    return ["demo"]

test_case.getCategories = _test_case_get_categories
del _test_case_get_categories

llvm-svn: 176158
2013-02-27 02:37:12 +00:00
Jim Ingham 344d36aa9f Mark a few more tests as "basic_process".
llvm-svn: 176132
2013-02-26 22:51:48 +00:00
Jim Ingham d882998eff Fix the .categories, it had "dataformatter" not "dataformatters".
Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file, 
and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.)
Add a "basic_process" category, and start to find some tests for simple process running sniff tests.

llvm-svn: 176061
2013-02-25 23:51:06 +00:00
Daniel Malea 90f3ebc602 Skip test that fails intermittently with Clang/GCC on Linux
- was causing buildbot failures due to unexpected pass

llvm-svn: 176048
2013-02-25 20:54:19 +00:00
Enrico Granata 2b3a0c4bcf This should get clang/gcc decorators working
llvm-svn: 175946
2013-02-23 01:35:21 +00:00
Enrico Granata 43f6213352 Fixing issues in previous checkin - still figuring out how to make expectedFailureClang take the bugnumber
llvm-svn: 175945
2013-02-23 01:28:30 +00:00
Dmitri Gribenko 3573f4ce8e Remove no-op code (since r175842)
llvm-svn: 175944
2013-02-23 01:20:07 +00:00
Enrico Granata e6cedc1296 <rdar://problem/12362092>
The decorators @expectedFailure (plain and special-case like i386, clang, ...) are modified to optionally take a bugnumber argument
If such an argument is specified, the failure report (or unexpected success report) will include the information passed in as part of the message
This is mostly useful for associating failures to issue IDs in issue management systems (e.g. the LLVM bugzilla)

llvm-svn: 175942
2013-02-23 01:05:23 +00:00
Daniel Malea da6921eb55 Mark last known Linux failure as XFAIL to see if there's any other problems with buildbots.
llvm-svn: 175917
2013-02-22 20:23:34 +00:00
Enrico Granata fde419277b Fixing the watchpoint test case to reflect changes in error reporting
llvm-svn: 175845
2013-02-22 00:44:16 +00:00
Daniel Malea c9a0ec3e28 Make the lldbtest tear down routine a little less error prone
- replace "catch-all" except clause with one that specifically catches what pexpect throws
- handle case where child is already terminated (or is terminating) by the time tear-down is run

llvm-svn: 175844
2013-02-22 00:41:26 +00:00
Enrico Granata 2fb7c441d3 Ignore the check for com.apple.main-thread - it is not critical for the test case's logic
llvm-svn: 175842
2013-02-22 00:39:53 +00:00
Enrico Granata 951462911d If the inferior program is compiled with libc++, you won't see libstdc++
llvm-svn: 175832
2013-02-21 23:59:42 +00:00
Daniel Malea fde7df5e7d Fix TestPublicAPIHeaders test on machines that have [DY]LD_LIBRARY_PATH that must be preserved.
llvm-svn: 175822
2013-02-21 23:07:30 +00:00
Daniel Malea a20e28daff Mark test as expected-to-fail with GCC because some versions emit DWARF that claims
functions start at the line with the "{" character, whereas clang uses the first line
with source code. As such, this test case will only work with clang.

llvm-svn: 175808
2013-02-21 22:15:52 +00:00
Daniel Malea c6301bfafb Skip another two test cases on Linux that are affected by llvm.org/pr14637
llvm-svn: 175801
2013-02-21 21:38:27 +00:00
Daniel Malea d82ac9e769 Fix CommandObjectMultiword to initialize all members, and beef up corresponding test case.
llvm-svn: 175798
2013-02-21 21:18:07 +00:00
Enrico Granata ea2bc0fb1f <rdar://problem/4529976>
Adding data formatters for iterators for std::map and std::vector (both libc++ and libstdcpp)
This does not include reverse iterators since they are both trickier (due to requirements the standard imposes on them) and much less useful

llvm-svn: 175787
2013-02-21 19:57:10 +00:00
Daniel Malea 64c2e69809 Add logging of which test cases are run (through dosep) to help diagnose any hangs/crashes in the buildbots.
llvm-svn: 175669
2013-02-20 21:31:47 +00:00
Daniel Malea c6a70063cb Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compiler bug.
Turns out unnamed bit fields should not be accessed ever in C (C99 section 4.7.8) or C++
(C++11 section 9.6). 

Unrelated to the above, this commit marks TestBitfields as expected-to-fail with GCC as 4.7
has problems with padding... the size of the struct with a uint32_t member is reported as 12
when GCC is used. Clang emits correct code.

Parts of this patch prepared by Filipe Cabecinhas!

llvm-svn: 175666
2013-02-20 21:11:20 +00:00
Daniel Malea 7932c232bd Skip TestCompletion case that fails on linux (with gcc) because the input prompt is not displayed (llvm.org/pr14637)
llvm-svn: 175665
2013-02-20 20:58:20 +00:00
Matt Kopec 93ee88179b Fix TestPublicAPIHeaders test on Linux.
-Change the build_dir variable name to lib_dir
 -Set lib_dir to the correct location on Linux
 -Set LD_EXTRAS to the actual lldb library

llvm-svn: 175664
2013-02-20 20:54:10 +00:00
Daniel Malea fce7f1f434 Fix a bug that causes dotest.py to exit with a passing exit-code, even if some tests fail
- occurs when multiple compilers/architectures are tested (via -C or -A flags)

llvm-svn: 175656
2013-02-20 20:12:11 +00:00
Daniel Malea 294c5e1cc3 Fix a problem with the const_variables test case (another lldb bug remains)
- make the test case step past the location where 'index' is initialized, otherwise its value cannot be printed (verified gcc 4.6/4.7 and recent clang)
- "Couldn't materialize struct" error from LLDB still prevents this test case from passing

llvm-svn: 175653
2013-02-20 19:41:49 +00:00
Jim Ingham 64ce7f4303 Make the progress bar opt in (using the -P option.)
llvm-svn: 175557
2013-02-19 20:39:27 +00:00
Daniel Malea 5b7c14b3c8 A few more GCC specific test fixes as per logged PRs:
- TestNamespace expected to fail due to PR-15302
- TestCPPBool and TestUnsignedTypes updated to handle GCC style debug information
- TestRvalueReferences expected fail due to GCC (4.7) not outputting rvalue-reference debug information
- TestDataFormatterStdVBool expected to fail due to PR-15301

llvm-svn: 175551
2013-02-19 19:54:16 +00:00
Daniel Malea d6915b42ff Fix Makefile bug preventing tests from running when building lldb with ccache
llvm-svn: 175547
2013-02-19 19:31:05 +00:00
Daniel Malea 249287afde Minor test runner improvemenst
- rework the way SBDebugger.SetAsync() is used to avoid side effects (reset original value at TearDownHook)
- refactor expectedFailureClang (and add expectedFailureGcc decorator)
- mark TestChangeValueAPI.py as expectedFailureGcc due to PR-15039

llvm-svn: 175523
2013-02-19 16:08:57 +00:00
Daniel Malea a9b732a32a Update TestVBool Makefile to allow building test program with gcc
- do not pass (incompatible option) -stdlib=libstdc++ option if using GCC as test compiler

llvm-svn: 175522
2013-02-19 15:53:47 +00:00
Daniel Malea 3eb9044f30 Update Makefile to use build-compiler (CC) for LLDB testing
- Should allow tests to run without 'clang' installed

llvm-svn: 175521
2013-02-19 15:48:37 +00:00
Enrico Granata a5da2adc77 NSWindows should only be created after you have an NSApplication
llvm-svn: 175475
2013-02-19 00:39:59 +00:00
Enrico Granata 9f02e0912d <rdar://problem/12529957>
Synthetic children provider for NSSet

llvm-svn: 175468
2013-02-18 23:16:23 +00:00
Filipe Cabecinhas 103e16e4cc Include a small argparse compatibility layer for Python < 2.7
llvm-svn: 175341
2013-02-16 09:05:23 +00:00
Enrico Granata f615b80d08 NSSet formatter is now C++ code
Split some NS* formatters in their own source files
Refactored a utility function for the C++ formatters to use
Fixed the skip-summary test case to be explicit about requiring libstdc++ for operation

llvm-svn: 175323
2013-02-15 23:38:37 +00:00
Daniel Malea cbaef26678 Improve test harness for the buildbots
- Add a "parsable" mode to dotest.py that outputs test results in exactly the same format as clang's lit tests
- Improve dosep script to output list of failing tests (output should look like clang test failure summaries)
- Cleanup lldb/test/Makefile to remove needless parameters and environment variables
- Switch makefile tests to use parsable-mode output; should make the buildbot results parsable
- Switch makefile tests to use dosep to log catch crashing tests (instead of halting the test suite)

llvm-svn: 175309
2013-02-15 21:31:37 +00:00
Daniel Malea e78ecc2cc7 More test case cleanup (Linux and Mac):
- remove expectedFailure decorator from resolved rdar 12566646 and 10887661
- remove expectedFailure from TestBitfields testcase not actually affected by bug
- skip the (non-deterministic) TestStopHookMechanism.py to avoid a noisy suite on Linux

llvm-svn: 175307
2013-02-15 21:27:14 +00:00
Daniel Malea 2dd69bb5f2 Fix misuse of python subprocess module (caused "leaking" processes and garbling the terminal)
- fixed cleanup of Popen objects by pushing spawn logic into test Base and out of test cases
- connect subprocess stdin to PIPE (rather than the parent's STDIN) to fix silent terminal issue

Tested on Linux and Mac OS X

llvm-svn: 175301
2013-02-15 21:21:52 +00:00
Daniel Malea 654b12c6a5 Linux test case cleanup:
- Enable TestFormatters.py: expressions with "new" work
- Enable TestChangeValueAPI.py: llvm.org/PR15039 fixed
- Disable expression_command/call-restarts due to llvm.org/PR15278
- Disable expression_command/call-throws due to ObjC test program

llvm-svn: 175287
2013-02-15 19:37:48 +00:00
Enrico Granata 8628bc59e0 Daniel Malea caught an issue where calling dotest.py with an invalid directory would cause the progressbar init code to raise an exception
This commit fixes it

llvm-svn: 175229
2013-02-15 00:32:05 +00:00
Daniel Malea 8d7b7a434a Fix TestSBData.py test case (tested fix Linux/Mac)
- stop ignoring the error-codes in the 'error' variable
- removed out-of-bounds accesses with read-only array fields such as:

  self.assertTrue(data2.uint8[6] == 0, 'binary 0 terminator')

Since SBData wraps a (6-character) python string literal, trying to read the
null-terminator raises an exception. Instead, I replaced the out-of-bounds
read with a length-check.

Other out-of-bounds reads (via accessor function like SBData.GetUnsignedInt8)
don't throw and are OK. I just added asserts that errors are set for these
negative cases.

llvm-svn: 175223
2013-02-14 23:38:33 +00:00
Jim Ingham 0ac5709027 Add a test for handling a function call that throws an exception, and make it work.
<rdar://problem/13183944>

llvm-svn: 175127
2013-02-14 03:05:42 +00:00
Daniel Malea 90e9fd9cbb Fix broken testcase: ignore LLDB output that warns about more elements than can be displayed.
- test could be re-written at some point, but right now just trying to clean up known failures for the linux buildbot.

llvm-svn: 175114
2013-02-14 00:30:40 +00:00
Daniel Malea e651aee927 Marking two tests expected-to-fail on Linux
- PR-15260: lldb does not display correct value of 1-bit field
- PR-16261: lldb does not display size of (file/class) static array

llvm-svn: 175111
2013-02-14 00:20:44 +00:00
Matt Kopec 3c0ed76a9d Skip another two other tests asserting on Linux in RecordLayoutBuilder::updateExternalFieldOffset().
llvm-svn: 175103
2013-02-13 22:59:58 +00:00
Daniel Malea 5a52f2ec73 Skip test that causes lldb to assert due to inferior getting a SIGSEGV with si_code == SI_KERNEL (PR-15258)
- crash does not always reproduce

llvm-svn: 175095
2013-02-13 22:05:18 +00:00
Daniel Malea f406891857 Skip tests that assert on Linux in RecordLayoutBuilder::updateExternalFieldOffset()
- Filed bugzilla PR-15256

llvm-svn: 175065
2013-02-13 18:56:41 +00:00
Daniel Malea 52d0f40ad3 Disable TestConditionalBreak.py due to Linux crash
- test was passing before r174793...

llvm-svn: 175064
2013-02-13 18:55:17 +00:00
Jim Ingham 6ad180cf35 Forgot to add the testsuite for the changes I checked in on Friday.
llvm-svn: 174897
2013-02-11 19:05:29 +00:00
Jim Ingham 0161b49cba Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug 
session.

<rdar://problem/12993641>

llvm-svn: 174793
2013-02-09 01:29:05 +00:00
Enrico Granata eba9e4a3aa The new progress bar mode was losing us information compared to the old dots mode in that we would have no way of knowing about test failures (short of peeking into the test result directory.. and you're not supposed to peek!)
Added a new line of information that reports the count of tests that pass, fail or have other things happen to them.

Again no flag to have the dots back. If you care, let us know!

llvm-svn: 174784
2013-02-09 00:37:07 +00:00
Enrico Granata a94ee7da81 <rdar://problem/13176279>
The LLDB test suite now shows a progress bar instead of dots when not in verbose mode
If you crave the dots, make your Terminal window smaller than 10 columns :-)
(or ask for a flag to have the dots come back on demand)

llvm-svn: 174777
2013-02-08 23:39:18 +00:00
Greg Clayton 0dd5e7b598 Unset the environment variables as soon as possible when running the test suite. Also don't store the unset list into a global when they aren't needed in a global variable.
llvm-svn: 174750
2013-02-08 21:52:32 +00:00
Daniel Malea 0e1cf09c89 Fix bug in test harness to allow running dotest.py without "--executable" flag on Linux
- resolves errors in cases that run the lldb CLI utility

llvm-svn: 174522
2013-02-06 16:55:07 +00:00
Daniel Malea eed92fb10c Fix to build tests with GCC: update makefiles in two watchpoint testcases
llvm-svn: 174520
2013-02-06 16:51:24 +00:00
Greg Clayton 12ff126f04 Fixed the TestSourceManager.py test case to not fail. It was using the "list" alias which has now been turned into a regex command that mimics the GDB equivalent. Changed "list" to "source list" to get around this problem.
llvm-svn: 174474
2013-02-06 00:35:33 +00:00
Enrico Granata cb9870dad8 Being explicit about which std c++ library these test cases need to use
llvm-svn: 174437
2013-02-05 20:05:31 +00:00
Enrico Granata 3b1b2dabda <rdar://problem/12953018>
Synthetic children and summary for std::vector<bool> (for both libcxx and libstdcpp).
std::vector<bool> is a special case and is custom-implemented to be a vector of bits, which means we failed to handle it with the standard std::vector<T> formatter.
This checkin provides custom formatters that work correctly

llvm-svn: 174333
2013-02-04 22:54:42 +00:00
Greg Clayton 39f7ee86c8 <rdar://problem/13092722>
Fix in loading mach files from memory when using DynamicLoaderMacOSXDYLD.

Removed the uuid mismatch warning that could be spit out and any time during debugging and removed the test case that was looking for that. Currently the "add-dsym" or "target symbols add" command will report an error when the UUID's don't match.

Be more careful when checking and resolving section + offset addresses to make sure none of the base addresses are invalid.

llvm-svn: 174222
2013-02-01 21:38:35 +00:00
Sean Callanan fa4fab77d4 Modified the expression parser's class wrapper to
support reporting "this" as a templated class.  The
expression parser wraps expressions in C++ methods
as methods with the signature

$__lldb_class::$__lldb_expr(...)

and previously responded to clang's queries about
$__lldb_class with the type of *this.  This didn't
work if *this was a ClassTemplateSpecializationDecl
because ClassTemplateSpecializationDecls can't be
the result of simple name queries.

Instead what we do now is respond that $__lldb_class
is a typedef and that the target of the typedef is
the (potentially templated) type of *this.  That is
much more robust.

Thanks to John McCall for key insights.

<rdar://problem/10987183>

llvm-svn: 174153
2013-02-01 06:55:48 +00:00
Enrico Granata 9a31ccbad8 <rdar://problem/12890171>
Providing a compact display mode for "po" to use where the convenience variable name and the pointer value are both hidden.
This is for convenience when dealing with ObjC instances where the description often gets it right and the debugger-provided information is not useful to most people.
If you need either of these, "expr" will still show them.

llvm-svn: 173748
2013-01-29 01:35:01 +00:00
Enrico Granata 5548cb50b2 <rdar://problem/12978143>
Data formatters now cache themselves.
This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.
Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.
The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.
Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.
Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.

llvm-svn: 173728
2013-01-28 23:47:25 +00:00
Daniel Malea 318cbcef91 Disable confirmation prompts for testing
- set auto-confirm to false when running TestExprs (avoid hang when using API)
- set prompt-on-quit to false in test helper (avoid timeout when using lldb CLI)

llvm-svn: 173485
2013-01-25 20:38:49 +00:00
Daniel Malea eb19a95322 Remove hardcoded -arch from lang/cpp testcase makefiles
- skip rdar12991846 (already marked expected-fail) to avoid introducing a i386 crash

llvm-svn: 173483
2013-01-25 20:33:59 +00:00
Daniel Malea d6a5531d42 Fix indenting typo in TestSTL.py
llvm-svn: 173470
2013-01-25 19:14:49 +00:00
Daniel Malea 2745d8467b Update test scripts and Makefiles to allow testing with GCC:
- introduce new variable ARCHFLAG in make/Makefile.rules to switch between "-arch" on Mac and "-m" everywhere else
- update testcase makefiles to use LD_EXTRAS instead of LDFLAGS (the former interacts with Makefile.rules badly)
- special treatment for gcc 4.6: replace "-std=c++11" with "-std=c++0x" as the former is not handled correctly
- remove hardcoded "-arch" from test Makefile

This patch should not have any effect on lldb on Mac OS X.

llvm-svn: 173402
2013-01-25 00:31:48 +00:00
Daniel Malea be230793fb Mark test cases affected by PR 15036 (GCC-generated DWARF causes parser crash)
- Add new decorator "@skipIfGcc" to lldbtest.py

llvm-svn: 173394
2013-01-24 23:52:09 +00:00
Daniel Malea db14eb25a0 Skip 32-bit testing of check_public_api_headers (on all platforms, not just Mac OS X)
- since the test program needs to link with LLDB, the test is invalid in 32-bit mode.

llvm-svn: 173372
2013-01-24 21:01:12 +00:00
Daniel Malea b8f80ee67f Marking test cases with @expectedFailureLinux as per recently opened bugs
- PR 15038: missing wide char support on Linux
- PR 14600 - Exception state registers not supported on Linux
- PR 15039: SBProcess.GetSTDOUT() returns an empty buffer
- PR 15037: stop-hooks sometimes fail to fire on Linux

llvm-svn: 173363
2013-01-24 19:47:06 +00:00
Daniel Malea cf7304a201 PR14426 (breakpoint hit count incorrect) is resolved.
llvm-svn: 173362
2013-01-24 19:35:57 +00:00
Enrico Granata f7b1a34e47 <rdar://problem/12711206>
Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP.
This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information.
Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong.
This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays).
As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information.

llvm-svn: 173216
2013-01-23 01:17:27 +00:00
Enrico Granata c50b44801c lldb.thread is not to be used anymore
llvm-svn: 173119
2013-01-22 02:32:56 +00:00
Sean Callanan a2868d4c2e Extended LLDB to handle blocks capturing 'self'
in an Objective-C class method.  Before, errors
of the form

error: cannot find interface declaration for '$__lldb_objc_class'

would appear when running any expression when
the current frame is a block that captures 'self'
from an Objective-C class method.

<rdar://problem/12905561>

llvm-svn: 172880
2013-01-19 01:49:02 +00:00
Sean Callanan 7b5805d0d1 Made the expression handle variables with
DW_AT_const_value instead of a location.  Also
added a testcase covering "frame variable," "expr"
using the IR interpreter, and "expr" using the
LLVM JIT.

<rdar://problem/12978195>

llvm-svn: 172848
2013-01-18 21:20:51 +00:00
Enrico Granata 4d27aa0dc5 The wchar_t and char1632_t test cases were erroneously running as x86_64 only even if you tried to run them in i386 mode
Courtesy of Daniel Malea for discovering this.

llvm-svn: 172764
2013-01-17 23:11:12 +00:00
Jim Ingham 184e981111 Separated the "expr --unwind-on-error" behavior into two parts, actual errors (i.e. crashes) which continue to be
controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called
function hits a breakpoint.  For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes
more sense.  
Also make both these behaviors globally settable through "settings set".
Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint.  We were recursing
and crashing.  Now we just stop without calling the second command.

<rdar://problem/12986644>
<rdar://problem/9119325>

llvm-svn: 172503
2013-01-15 02:47:48 +00:00
Enrico Granata df17b4dada Adding a test case for expression parser's support for Unicode strings. This is an expected failure for now
llvm-svn: 172493
2013-01-15 00:03:03 +00:00
Enrico Granata 93d5966513 <rdar://problem/12790664>
Single-character Unicode data formatters

llvm-svn: 172492
2013-01-14 23:53:26 +00:00
Enrico Granata e274088db0 <rdar://problem/12239827>
Making a summary for std::wstring as provided by libstdc++ along with a relevant test case

llvm-svn: 172286
2013-01-12 01:22:57 +00:00
Enrico Granata 3309d88198 <rdar://problem/12239827>
Providing a data formatter for libc++ std::wstring
In the process, refactoring the std::string data formatter to be written in C++ so that commonalities between the two can be exploited
Also, providing a new API on the ValueObject to navigate a hierarchy by index-path
Lastly, an appropriate test case is included

llvm-svn: 172282
2013-01-12 01:00:22 +00:00
Enrico Granata 2500e767a0 Making the Unicode formatters visually nicer by using the same prefix characters as the compiler expects in C++ code
Also, marking the Unicode data formatters test cases as dataformatter related for the benefit for the --category flag in dotest.py

llvm-svn: 172167
2013-01-11 03:01:25 +00:00