Commit Graph

371 Commits

Author SHA1 Message Date
Enrico Granata 986fa5f4eb Extend ValueObject::GetExpressionPath() to do something reasonable for synthetic children
Because of the way they are created, synthetic children cannot (in general) have a sane expression path

A solution to this would be letting the parent front-end generate expression paths for its children
Doing so requires a significant amount of refactoring, and might not always lead to better results (esp. w.r.t. C++ templates)

This commit takes a simpler approach:
- if a synthetic child is of pointer type and it's a target pointer, then emit *((T)value)
- if a synthetic child is a non-pointer, but its location is in the target, then emit *((T*)loadAddr)
- if a synthetic child has a value, emit ((T)value)
- else, don't emit anything

Fixes rdar://18442386

llvm-svn: 223836
2014-12-09 21:41:16 +00:00
Enrico Granata 0c10a85000 Add the ability for an SBValue to create a persisted version of itself.
Such a persisted version is equivalent to evaluating the value via the expression evaluator, and holding on to the $n result of the expression, except this API can be used on SBValues that do not obviously come from an expression (e.g. are the result of a memory lookup)

Expose this via SBValue::Persist() in our public API layer, and ValueObject::Persist() in the lldb_private layer

Includes testcase

Fixes rdar://19136664

llvm-svn: 223711
2014-12-08 23:13:56 +00:00
Zachary Turner 82da55fe57 Disable GetSTDOUT, GetSTDERR, and PutSTDIN on Windows.
These methods are difficult / impossible to implement in a way
that is semantically equivalent to the expectations set by LLDB
for using them.  In the future, we should find an alternative
strategy (for example, i/o redirection) for achieving similar
functionality, and hopefully deprecate these APIs someday.

llvm-svn: 222775
2014-11-25 19:03:08 +00:00
Siva Chandra 51aba6ffa9 Mark 9 lldb unit tests for ubuntu as XFAIL.
The following lldb unit tests fail check-lldb on ubuntu:

TestDataFormatterStdMap.py
TestDataFormatterStdVBool.py
TestDataFormatterStdVector.py
TestDataFormatterSynthVal.py
TestEvents.py
TestInitializerList.py
TestMemoryHistory.py
TestReportData.py
TestValueVarUpdate.py

These unit test failures are for non-core functionality. The intent is to
reduce the check-lldb FAILS to core functionality FAILS and then circle
back later and fix these FAILS at a later date.

llvm-svn: 222608
2014-11-22 05:55:00 +00:00
Ed Maste 55f410bf16 Add decorator for FreeBSD failure
llvm.org/pr21620

llvm-svn: 222442
2014-11-20 18:56:11 +00:00
Ed Maste 9251e2e61c Add decorator for intermittently failing test on FreeBSD
This test has intermittently failed on FreeBSD for quite some time when
run as part of the full test suite.  It generally passes when run by
itself.  Mark as expected failure for now to reduce buildbot noise.

llvm.org/pr15039 test fails intermittently on FreeBSD

llvm-svn: 222134
2014-11-17 15:27:09 +00:00
Shawn Best 590e943a81 Add -std=c99 for building the test case of TestValueVarUpdate - for Siva Chandra : http://reviews.llvm.org/D6201
llvm-svn: 221694
2014-11-11 17:45:00 +00:00
Enrico Granata 0eb0ec298c Fix a problem where ValueObjectVariable was not correctly setting its 'has value changed' flag for scalar valued variables. This fixes rdar://17851144
llvm-svn: 221298
2014-11-04 21:28:50 +00:00
Greg Clayton 8691dc5b75 Fixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case that was reading target memory in TargetAPITestCase.test_read_memory_with_dsym and TargetAPITestCase.test_read_memory_with_dwarf.
The problem was that SBTarget::ReadMemory() was making a new section offset lldb_private::Address by doing:


size_t
SBTarget::ReadMemory (const SBAddress addr,
                      void *buf,
                      size_t size,
                      lldb::SBError &error)
{
        ...
        lldb_private::Address addr_priv(addr.GetFileAddress(), NULL);
        bytes_read = target_sp->ReadMemory(addr_priv, false, buf, size, err_priv);


This is wrong. If you get the file addresss from the "addr" argument and try to read memory using that, it will think the file address is a load address and it will try to resolve it accordingly. This will work fine if your executable is loaded at the same address (no slide), but it won't work if there is a slide.

The fix is to just pass along the "addr.ref()" instead of making a new addr_priv as this will pass along the lldb_private::Address that is inside the SBAddress (which is what we want), and not always change it into something that becomes a load address (if we are running), or abmigious file address (think address zero when you have 150 shared libraries that have sections that start at zero, which one would you pick). The main reason for passing a section offset address to SBTarget::ReadMemory() is so you _can_ read from the actual section + offset that is specified in the SBAddress. 

llvm-svn: 221213
2014-11-04 00:56:30 +00:00
Greg Clayton ed59d756d8 Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).
llvm-svn: 221197
2014-11-03 23:02:08 +00:00
Greg Clayton c91d49b505 Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).
llvm-svn: 221196
2014-11-03 22:58:38 +00:00
Ed Maste 2ec8e1bd20 Temporarily disable test on FreeBSD that is asserting
llvm.org/pr21325

llvm-svn: 220871
2014-10-29 20:02:54 +00:00
Sean Callanan e17428acfa Added the ability to add attributes to inline
testcases.  Also fixed one of the testcases to
not run on the platforms that don't support
Objective-C.

We want to do better with the Objective-C attribute
but we'll do that in a future commit.

llvm-svn: 220820
2014-10-28 20:23:20 +00:00
Todd Fiala f183754779 Fix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.
Similar to a recent test I fixed for gdb-remote attach scenarios, this
fix is for Linux kernels, such as Ubuntu's stock setup on 11.04-ish and
later, where ptrace starts requiring a ptracer to be an ancestor of the
inferior to be ptraced.  This change checks for Linux and the ptrace-related
flags.  If they're found, it tries to switch on the "allow any ptracer" mode
for the inferior as the first statements in the program.  It's a best-effort
solution - if the prctl call fails, the failure is ignored, and probably will
lead to the test failing.

The ptrace security behavior can be modified system-wide, but is outside the
scope of the test to address.  Hence I went with this particular solution.

llvm-svn: 220650
2014-10-26 21:37:46 +00:00
Ed Maste 40dc7eb150 Remove duplicated new file content
llvm-svn: 220591
2014-10-24 20:49:50 +00:00
Enrico Granata 249d639786 Fix a problem where an SBType was advertising its static type class even though a dynamic type was available. Solves rdar://18744420
llvm-svn: 220511
2014-10-23 21:15:20 +00:00
Matthew Gardiner c928de3e8e Added functions to the C++ API, for the benefit of non-8-bit byte architectures.
New functions to give client applications to tools to discover target byte sizes
for addresses prior to ReadMemory. Also added GetPlatform and ReadMemory to the
SBTarget class, since they seemed to be useful utilities to have.

Each new API has had a test case added.

http://reviews.llvm.org/D5867

llvm-svn: 220372
2014-10-22 07:22:56 +00:00
Greg Clayton a6cffdecde Fixed python API event test cases.
Issues were:
1 - It isn't good to have more than one listener for the process events, just supply a listener at launch instead of making a one then have the process broadcaster add a new listener
2 - run in async mode

llvm-svn: 220113
2014-10-17 23:58:27 +00:00
Greg Clayton b8e9b8b703 Fixed stdio redirection within LLDB to "do the right thing" in all cases.
The main issue was if you didn't specify all three (stdin/out/err), you would get file actions added to the launch that would always use the pseudo terminal. This is now fixed.

Also fixed the test suite test that handles IO to test redirecting things individually and all together and in other combinations to make sure we don't regress.

<rdar://problem/18638226>

llvm-svn: 219711
2014-10-14 20:18:05 +00:00
Ed Maste e9914abe3b Limit test to Darwin
Test requres <Foundation/Foundation.h>

llvm-svn: 218904
2014-10-02 20:18:21 +00:00
Enrico Granata 47caf9a956 Extend the member function discovery APIs to also support Objective-C as well as C++
For the Objective-C case, we do not have a "function type" notion, so we actually end up wrapping the clang ObjCMethodDecl in the Impl object, and ask function-y questions of it
In general, you can always ask for return type, number of arguments, and type of each argument using the TypeMemberFunction layer - but in the C++ case, you can also acquire a Type object for the function itself, which instead you can't do in the Objective-C case

llvm-svn: 218132
2014-09-19 18:21:05 +00:00
Enrico Granata 6c42cb11d6 Change SBType.GetMemberFunctionAtIndex() to return an object describing the member function in more detail. A type was really quite vague. This now has function name, kind, as well as function type
llvm-svn: 217828
2014-09-15 21:30:36 +00:00
Enrico Granata 190064ad0d Add logic to LLDB to figure out the types of member functions of C++ classes. Add plumbing for that all the way up to the SB layer
llvm-svn: 217701
2014-09-12 18:45:43 +00:00
Zachary Turner c7826524ac Get test executables compiling on Windows.
Many of the test executables use pthreads directly.  This isn't
portable on Windows, so this patch converts these test to use
C++11 threads and mutexes.  Since Windows' implementation of
std::thread classes throw and catch from header files, this patch
also disables exceptions when compiling with clang on Windows.

Reviewed by: Todd Fiala, Ed Maste

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

llvm-svn: 215562
2014-08-13 17:44:53 +00:00
Greg Clayton 4184c79975 Don't hand compute mydir, do it using "TestBase.compute_mydir(__file__)".
llvm-svn: 214575
2014-08-01 22:10:13 +00:00
Ed Maste 362f5de276 Add decorator for FreeBSD test failure - malloc() breakpoint issue
llvm.org/pr20476

llvm-svn: 214527
2014-08-01 17:04:31 +00:00
Zachary Turner 045fde58d1 Fixes a number of issue related to test portability on Windows.
99% of this CL is simply moving calls to "import pexpect" to a more
narrow scope - i.e. the function that actually runs a particular
test.  This way the test suite can run on Windows, which doesn't have
pexpect, and the individual tests that use pexpect can be disabled on
a platform-specific basis.

Additionally, this CL fixes a few other cases of non-portability.
Notably, using "ps" to get the command line, and os.uname() to
determine the architecture don't work on Windows.  Finally, this
also adds a stubbed out builder_win32 module.

The full test suite runs correctly on Windows after this CL, although
there is still some work remaining on the C++ side to fix one-shot
script commands from LLDB (e.g. script print "foo"), which currently
deadlock.

Reviewed by: Todd Fiala

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

llvm-svn: 213343
2014-07-18 01:02:02 +00:00
Todd Fiala fb17762ee5 Marked TestTargetAPI.test_launch_new_process_and_redirect_stdout_with_* as XFAIL on Darwin.
See http://llvm.org/bugs/show_bug.cgi?id=20273

llvm-svn: 212659
2014-07-09 21:24:41 +00:00
Jim Ingham e029fa5781 If a breakpoint gets deleted, any SBBreakpoints representing that
breakpoint should return false from IsValid.

llvm-svn: 212206
2014-07-02 18:44:43 +00:00
Todd Fiala 9b0957870c Part 2 of SBUnitSignals check-in.
I missed adding a few new files to the change list.
The build is broken from r211526 without this fix.
(And Ed Maste caught it before I did, so this is
the remainder - the test methods).

llvm-svn: 211535
2014-06-23 20:56:48 +00:00
Todd Fiala 732215f989 Add support for inspecting enum members.
Change by Russell Harmon.

Xcode project updates (and all errors therein)
by Todd Fiala.

llvm-svn: 210046
2014-06-02 20:55:29 +00:00
Jim Ingham 24e84d2c87 I removed SetCallback from the Python API's since it wasn't actually useful, and added SetScriptCallbackFunction,
and SetScriptCallbackBody.  So add these to the default constructor test case.

llvm-svn: 205494
2014-04-03 00:50:56 +00:00
Ed Maste 49f359aea4 Fix malloc thread step-out test on FreeBSD
After hitting the malloc() breakpoint on FreeBSD our top frame is actually
an inlined function malloc_init.

  * frame #0: 0x0000000800dcba19 libc.so.7`malloc [inlined] malloc_init at malloc.c:5397
    frame #1: 0x0000000800dcba19 libc.so.7`malloc(size=1024) + 9 at malloc.c:5949
    frame #2: 0x00000000004006e5 test_step_out_of_malloc_into_function_b_with_dwarf`b(val=1) + 37 at main2.cpp:29

Add a heuristic to keep stepping out until we come to a non-malloc caller,
before checking if it is our desired caller from the test code.

llvm.org/pr17944

llvm-svn: 203268
2014-03-07 19:02:20 +00:00
Todd Fiala 163bc1da1b Enabled TestSetWatchlocation.py on Linux.
This worked 25 out of 25 times for me on Ubuntu 12.04 LTS x86_64 built
with gcc 4.8.2 and the July 2013 libedit.

llvm-svn: 202516
2014-02-28 17:28:44 +00:00
Ed Maste a4be2c5dcd FreeBSD hardware watchpoint implementation
Implement x86_64 debug register read/write in support of hardware
watchpoints. Hoist LinuxThread::TraceNotify code back into
POSIXThread::TraceNotify()

Patch by John Wolfe.

We still need to rework this later to avoid the #ifdef FreeBSD.

llvm-reviews.chandlerc.com/D2572
llvm.org/pr16706

llvm-svn: 201706
2014-02-19 18:34:06 +00:00
Enrico Granata 08a04327a9 <rdar://problem/15960553>
Fix a bug where calling SBFrame::FindValue() would cause a copy of all variables in the block to be inserted in the frame's variable list, regardless of whether those same variables were there or not - which means one could end up with a frame with lots of duplicate copies of the same variables

llvm-svn: 201614
2014-02-18 23:48:11 +00:00
Greg Clayton 44d937820b Merging the iohandler branch back into main.
The many many benefits include:
1 - Input/Output/Error streams are now handled as real streams not a push style input
2 - auto completion in python embedded interpreter
3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use
4 - it is now possible to use curses to drive LLDB (please try the "gui" command)

We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases.

llvm-svn: 200263
2014-01-27 23:43:24 +00:00
Greg Clayton c694751a06 Correctly set the working directory when launching processes for both local and remote targets.
llvm-svn: 197266
2013-12-13 19:18:59 +00:00
Greg Clayton 4570d3eba0 Massive test suite cleanup to stop everyone from manually having to compute "mydir" inside each test case.
This has led to many test suite failures because of copy and paste where new test cases were based off of other test cases and the "mydir" variable wasn't updated.

Now you can call your superclasses "compute_mydir()" function with "__file__" as the sole argument and the relative path will be computed for you. 

llvm-svn: 196985
2013-12-10 23:19:29 +00:00
Ed Maste 1d981a9606 test: Update decorators for FreeBSD failures with threaded inferior support
llvm.org/pr18190
llvm.org/pr18191

llvm-svn: 196792
2013-12-09 17:27:18 +00:00
Ed Maste f369dba051 test: Add annotation for FreeBSD failures w/ threaded inferiors
llvm.org/pr17944
llvm.org/pr17946

llvm-svn: 196786
2013-12-09 15:25:37 +00:00
Andrew Kaylor ba8ce0414e Removing expected failure decorator for a test that's passing.
llvm-svn: 193715
2013-10-30 21:05:36 +00:00
Matt Kopec ee969f9f27 Mark 32/64-bit tests as expected fail after root causing and referencing bugzilla.
Fix TestFrames.py error to check against a None pc value.

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

llvm-svn: 191399
2013-09-25 20:48:03 +00:00
Daniel Malea 7d0d66924f Update Linux bug tracker link in TestPrintStackTraces
- now fails due to llvm.org/pr15415 (partial stack trace while stopped inside read() call)

llvm-svn: 190867
2013-09-17 16:30:30 +00:00
Daniel Malea 539375aefd Re-enable TestRegisters and TestTargetWatchAddress on Linux
- TestRegisters passes locally (llvm.org/pr16301 no longer reproduces) -- verifying this on buildbots
- TestTargetWatchAddress also passes locally, and referenced llvm.org/pr14323 which is now closed

llvm-svn: 190104
2013-09-05 21:51:01 +00:00
Ed Maste 8607c24638 Attach by name tests now pass on FreeBSD
A FreeBSD implementation of Host::FindProcesses was added in r189295.
Contrary to my earlier report of failing tests it seems all attach by
name tests now pass.

http://www.llvm.org/pr16699

llvm-svn: 189680
2013-08-30 15:35:32 +00:00
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
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
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
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 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 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
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
Matt Kopec ef7ea33178 Disabling another watchpoint test with intermittent failure.
llvm-svn: 182952
2013-05-30 18:54:48 +00:00
Andrew Kaylor bc46d567b7 Disabling watchpoint test with intermittent failure.
llvm-svn: 182887
2013-05-29 22:12:53 +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
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
Matt Kopec e9ea0da82e Add watchpoint support for Linux on 64-bit host.
llvm-svn: 181341
2013-05-07 19:29:28 +00:00
Daniel Malea 25029a00ca skip randomly failing test to avoid buildbot noise
llvm-svn: 180636
2013-04-26 21:39:11 +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
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
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 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
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
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 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
Sean Callanan 7be70e8528 This patch removes the SymbolFileSymtab support
for reporting class types from Objective-C runtime
class symbols.  Instead, LLDB now queries the 
Objective-C runtime for class types.

We have also added a (minimal) Objective-C runtime
type vendor for Objective-C runtime version 1, to 
prevent regressions when calling class methods in
the V1 runtime.

Other components of this fix include:

- We search the Objective-C runtime in a few more
  places.

- We enable enumeration of all members of
  Objective-C classes, which Clang does in certain
  circumstances.

- SBTarget::FindFirstType and SBTarget::FindTypes
  now query the Objective-C runtime as needed.

- I fixed several test cases.

<rdar://problem/12885034>

llvm-svn: 170601
2012-12-19 23:05:01 +00:00
Daniel Malea 34f21d18b5 Test suite cleanup for Linux: mark test cases expected to fail due to open bugzillas
- bugzillas covered: 14323, 14600, 14541, 14437, 14540, 14541

llvm-svn: 170564
2012-12-19 17:19:28 +00:00
Andrew Kaylor 2529ae3962 Marking test_lldb_iter_frame in TestLLDBIterator.py as expectedFailureLinux (due to lack of multi-threaded debugging support).
llvm-svn: 170074
2012-12-13 01:28:44 +00:00
Andrew Kaylor f256cfc85e Marking TestPrintStackTraces.py as expectedFailureLinux (due to lack of multi-threaded debugging support).
llvm-svn: 170043
2012-12-12 23:12:09 +00:00
Daniel Malea 662f2b8be0 Remove decorator to skip event tests
- hang resolved in r168503

llvm-svn: 168530
2012-11-23 22:10:20 +00:00
Daniel Malea 93aec0f9a9 Update test status on Linux
- add decorators @expectedFailLinux and @skipOnLinux
- skip/mark xfail cases due to open bugzillas # 14323, 14416, 14423, 14424, 14425, 14426

Patch by Ashok Thirumurthi!

llvm-svn: 168529
2012-11-23 21:59:29 +00:00
Daniel Malea 218894788d Temporarily skip tests known to hang on Linux
- opened bugzilla defects #14384 and #14385

llvm-svn: 168323
2012-11-19 20:55:52 +00:00
Jason Molenda 28826a491c Patch from Dan Malea daniel.malea@gmail.com to add some required
flags to the Linux makefiles to get the tests to run.

llvm-svn: 167600
2012-11-08 23:50:33 +00:00
Enrico Granata 2928d37096 Fixing the test case for rdar://12481949 to do the right thing with our new rules for sign-extension in GetValueAsUnsigned()
llvm-svn: 166631
2012-10-24 22:15:04 +00:00
Enrico Granata 7e137e3d8f <rdar://problem/12481949> Fixing SBValue.GetValueAsSigned() to do the right thing when dealing with a 32-bit negative value
llvm-svn: 166603
2012-10-24 18:14:21 +00:00
Jim Ingham 63dfc725a7 Fix all the test case breakages caused by folks writing tests all over the place that depended explicitly
on the output of "break set".  Please don't do this sort of thing!!!!!

llvm-svn: 164433
2012-09-22 00:05:11 +00:00
Enrico Granata 165f8af8c5 Initial commit of a new testsuite feature: test categories.
This feature allows us to group test cases into logical groups (categories), and to only run a subset of test cases based on these categories.

Each test-case can have a new method getCategories(self): which returns a list of strings that are the categories to which the test case belongs.
If a test-case does not provide its own categories, we will look for categories in the class that contains the test case.
If that fails too, the default implementation looks for a .category file, which contains a comma separated list of strings.
The test suite will recurse look for .categories up until the top level directory (which we guarantee will have an empty .category file).

The driver dotest.py has a new --category <foo> option, which can be repeated, and specifies which categories of tests you want to run.
(example: ./dotest.py --category objc --category expression)

All tests that do not belong to any specified category will be skipped. Other filtering options still exist and should not interfere with category filtering.
A few tests have been categorized. Feel free to categorize others, and to suggest new categories that we could want to use.

All categories need to be validly defined in dotest.py, or the test suite will refuse to run when you use them as arguments to --category.

In the end, failures will be reported on a per-category basis, as well as in the usual format.

This is the very first stage of this feature. Feel free to chime in with ideas for improvements!

llvm-svn: 164403
2012-09-21 19:10:53 +00:00
Filipe Cabecinhas c5041918dd Added SBDebugger's log callbacks to Python-land
- Tweaked a parameter name in SBDebugger.h so my typemap will catch it;
- Added a SBDebugger.Create(bool, callback, baton) to the swig interface;
- Added SBDebugger.SetLoggingCallback to the swig interface;
- Added a callback utility function for log callbacks;
- Guard against Py_None on both callback utility functions;

- Added a FIXME to the SBDebugger API test;
- Added a __del__() stub for SBDebugger.

We need to be able to get both the log callback and baton from an
SBDebugger if we want to protect against memory leaks (or make the user
responsible for holding another reference to the callback).
Additionally, it's impossible to revert from a callback-backed log
mechanism to a file-backed log mechanism.

llvm-svn: 162633
2012-08-25 00:29:07 +00:00
Filipe Cabecinhas 9e10605d6b Added a test for the Python part of SBInputReader callbacks.
llvm-svn: 162357
2012-08-22 13:25:58 +00:00
Filipe Cabecinhas 6eb31e7391 Added a typemap and wrappers for SBInputReader callbacks
Now it's possible to use SBInputReader callbacks in Python.

We leak the callback object, unfortunately. A __del__ method can be added
to SBInputReader, but we have no way to check the callback function that
is on the reader. So we can't call Py_DECREF on it when we have our
PythonCallback function. One way to do it is to assume that reified
SBInputReaders always have a Python callback (and always call Py_DECREF).
Another one is to add methods or properties to SBInputReader (or make the
m_callback_function property public).

llvm-svn: 162356
2012-08-22 13:25:10 +00:00
Johnny Chen 9b832fe40d Fix a crash (_wrap_SBDebugger_SetInputFileHandle -> PyString_AsString) running the test suite.
Also modify the boundary condition test case SBDebugger.DispatchInput(None) to be wrapped inside a try-except clause for now.

llvm-svn: 162228
2012-08-20 21:16:02 +00:00
Filipe Cabecinhas c30199917a A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.

llvm-svn: 162204
2012-08-20 16:21:04 +00:00
Johnny Chen b90827e66c rdar://problem/11584012
Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee()
now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the
operation.  Update 'watchpoint set variable/expression' commands to take advantage of that.

Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for
SBTarget::WatchAddress() by passing an invalid watch_size.

llvm-svn: 157964
2012-06-04 23:19:54 +00:00
Filipe Cabecinhas 9f84da9b52 Clean renamed files on 'make clean'
llvm-svn: 157669
2012-05-30 02:52:29 +00:00
Johnny Chen f9ef60d236 Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it through the Python scripting bridge.
Add/modify some test cases.

llvm-svn: 157353
2012-05-23 22:34:34 +00:00
Greg Clayton 7051231709 <rdar://problem/11358639>
Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.

Also make the selection process for auto selecting platforms based off of an arch much better.

llvm-svn: 156354
2012-05-08 01:45:38 +00:00
Enrico Granata fe945e83e0 Fixing the test case so that it runs correctly on i386 as well as on x86_64
llvm-svn: 155420
2012-04-24 02:01:17 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00
Johnny Chen 1b72f09150 Export the APIs submitted by Dawn to the Python bindings. Add a simple test case for the SBModule.compile_unit_iter() API.
llvm-svn: 152952
2012-03-16 21:55:42 +00:00
Johnny Chen f087c8255e Add test case associated with:
rdar://problem/11034702

For the time being, skip the relevant disassemble action which resulted in a crash.

Minor modification (print out format) to the existing TestDisassembleRawBytes.py test file.

llvm-svn: 152822
2012-03-15 18:23:59 +00:00