Commit Graph

362 Commits

Author SHA1 Message Date
Siva Chandra 3154aa23f3 [TestBase.runCmd] Better error message when runCmd fails.
Summary:
Before:
    AssertionError: False is not True : Process is launched successfully

After:
    AssertionError: False is not True : Command 'run a.out' failed.
    >>> error: invalid target, create a target using the 'target create' command
    >>> Process could not be launched successfully

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, vharron

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

llvm-svn: 238363
2015-05-27 22:27:41 +00:00
Siva Chandra 73eddaa2d8 [TestChangeValueAPI] Remove expectedFailureGcc decorator.
Test Plan: dotest.py -C <clang|gcc> -p TestChangeValueAPI

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 237927
2015-05-21 18:20:46 +00:00
Tamas Berghammer a98788d17e Add bug number for TestEvents
llvm-svn: 237904
2015-05-21 14:04:17 +00:00
Tamas Berghammer b5f4e6dd53 XFAIL TestEvents on Linux bacuse it is flaky
llvm-svn: 237888
2015-05-21 10:16:55 +00:00
Vince Harron 121fa77e92 Added minor comment
llvm-svn: 237174
2015-05-12 20:55:43 +00:00
Chaoren Lin 3e2bdb4640 os.path.join does not always work for paths on remote platforms.
Summary:
Since we don't yet have remote windows debugging, it should be safe to assume
that the remote target uses unix path separators.

Reviewers: ovyalov, zturner, clayborg, vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 237006
2015-05-11 17:53:39 +00:00
Siva Chandra 8a1f76936c [TestEvents] Add a 'connected' state to include remote debugging.
Test Plan: dotest.py -p TestEvents

Reviewers: vharron, chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236800
2015-05-08 00:43:28 +00:00
Pavel Labath c23ba555c2 Enable TestChangeValueAPI on Linux
the test has passed in the last 300 runs, enabling to see what the build bot says. Also,
downgrading skipIfGcc to XFAIL, with plans of enabling it in the future if it shows to be
working.

llvm-svn: 236496
2015-05-05 12:10:13 +00:00
Vince Harron 410a9e1e1e un-skipped a bunch of tests on Linux
Some have been marked as skipIfLinux for years.
The seem to be passing so I've enabled them.

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

llvm-svn: 236403
2015-05-04 03:06:04 +00:00
Pavel Labath 6884aa1b43 Enabling two watchpoint tests on linux
After recent changes, these tests should be stable. Please let me know if you still see failures.

llvm-svn: 236226
2015-04-30 11:28:06 +00:00
Pavel Labath 634b602983 XFAILing TestPrintStackTraces on linux to stabilize the build bot
llvm-svn: 235169
2015-04-17 09:05:26 +00:00
Vince Harron 7343ab44ee Exception registers aren't supported outside of Darwin
Updated test to match

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

llvm-svn: 234992
2015-04-15 10:31:42 +00:00
Chaoren Lin 9cb8988b91 Remove gcc xfail for TestTargetWatchAddress.
llvm-svn: 234828
2015-04-14 00:51:57 +00:00
Greg Clayton e0d0a7652d Many many test failures after some recent changes. The problem is lldbtest.getPlatform() returns the "OS" of the selected platform's triple. This is "macosx" for desktop macosx and "ios" for iOS. It used to be "darwin".
There was a lot of code that was checking "if self.getPlatform() == 'darwin'" which is not correct. I fixed this by adding a:

lldbtest.platformIsDarwin()

which returns true if the current platform's OS is "macosx", "ios" or "darwin". These three valid darwin are now returned by a static function:

lldbtest.getDarwinOSTriples()

Fixed up all places that has 'if self.getPlatform() == "darwin":' with "if self.platformIsDarwin()" and all instances of 'if self.getPlatform() != "darwin":' with "if not self.platformIsDarwin()". I also fixed some darwin decorator functions to do the right thing as well.

llvm-svn: 233933
2015-04-02 18:24:03 +00:00
Vince Harron 091a95d412 TestPrintStackTraces - made XFAIL more precise
Works with x86_64 inferior, fails w/i386 inferior - updated test to
reflect

llvm-svn: 233717
2015-03-31 17:45:54 +00:00
Vince Harron 3d2979ee2f Enabled a bunch of tests on Linux
Removed expectedFailureLinux from failures that I was unable to
reproduce, updated and improved some other comments near XFAIL tests

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

llvm-svn: 233716
2015-03-31 17:44:37 +00:00
Robert Flack 13c7ad9cd2 Replace sys.platform skips in tests with @skip decorators which check against remote platform.
Adds @skipIfPlatform and @skipUnlessPlatform decorators which will skip if /
unless the target platform is in the provided platform list.

Test Plan:
ninja check-lldb shows no regressions.
When running cross platform, tests which cannot run on the target platform are
skipped.

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

llvm-svn: 233547
2015-03-30 14:12:17 +00:00
Ilia K 841e30ae71 Fix RegisterCommandsTestCase and HelloWorldTestCase tests which hang on OS X after TestBase.tearDown()
llvm-svn: 233279
2015-03-26 15:43:46 +00:00
Ying Chen 4e0587d26a xfail tests that failed with clang-3.7, gcc4.8.2 and on i386 to get buildbot green
Summary:
-Refer to bug https://buganizer.corp.google.com/issues/19893563
-Test log http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/1145

Test Plan: Run tests with different compiler and archs locally

Reviewers: sivachandra, ovyalov, chaoren, vharron

Subscribers: llvm-commits

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

llvm-svn: 233157
2015-03-25 00:39:25 +00:00
Robert Flack 666a986839 Don't clobber CFLAGS_EXTRAS in tests.
To run tests against a different target platform many extra compiler flags are
needed to specify sysroot, include dirs, etc. The environment variable
CFLAGS_EXTRAS seems suited for this purpose except that several Makefiles
clobber the current flags. This change modifies all of these to add to
CFLAGS_EXTRAS instead.

Test Plan:
Verify no regressions in ninja check-lldb.
Run tests using CFLAGS_EXTRAS to specify cross compilation flags for a different
target running lldb-server platform.

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

llvm-svn: 233066
2015-03-24 12:41:20 +00:00
Vince Harron b63c1880f2 Use -fno-limit-debug-info instead of -fstandalone-debug in tests
This fixes tests on clang-3.4

AFAICT, these flags have the same affect and -fstandalone-debug wasn't
added until after clang-3.4

Committed to try to fix buildbot

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

llvm-svn: 232326
2015-03-15 18:05:53 +00:00
Tamas Berghammer 00c45289f4 Make TestSBFrameFindValue compatible with remote targets
llvm-svn: 232171
2015-03-13 14:54:42 +00:00
Greg Clayton 6ef9712296 Avoid a failing test case by fixing things so the compiler generates a line table entry for line the very start of the printf() before any values have been loaded into registers.
The issue was the previous code tried to stop on the following code in main.c:

21    // Stop here and set values
22    printf ("Val - %d Mine - %d, %d, %llu. Ptr - %d, %d, %llu\n", 
23            val, 
24            mine.first_val, mine.second_val, mine.third_val,
25            ptr->first_val, ptr->second_val, ptr->third_val); 

We we set a source regex breakpoint on "// Stop here and set values" we would set a breakpoint on line 22 as expected. 

The problem is the most recent clang compiler generates a line table like this


0x1000: main.c:23 // Loading of "val" into a register
0x1010: main.c:24 // Load mine.first_val, mine.second_val, mine.third_val values into registers or on the stack
0x1020: main.c:25 // Load ptr->first_val, ptr->second_val, ptr->third_val values into registers or on the stack
0x1030: main.c:22 // Call to printf

In this test, we run to line 22, then we use python to modify the value of "val" and then continue to another breakpoint and try to read the STDOUT from the printf to verify the values changed correctly.

With the above line table the value for "val" had already been loaded into a register so the string from printf would be incorrect.

Doing an easy fix for now by changing the code to:

21    // Stop here and set values
22  printf ("Val - %d Mine - %d, %d, %llu. Ptr - %d, %d, %llu\n", val, 
23          mine.first_val, mine.second_val, mine.third_val,
24          ptr->first_val, ptr->second_val, ptr->third_val); 


Now we get a line table entry for line 22 that is before any locals are read from the stack into registers.

I need to follow up with the compiler guys and see if we can get a fix for this as anyone setting file + line breeakpoints might be very surprised to have code from lines below the current line already have had their code run.

llvm-svn: 232068
2015-03-12 17:42:15 +00:00
Pavel Labath 3f5df53fde Fix ProcessIO test failures
Summary:
There was a race condition regarding the output of the inferior process. The reading of the
output is performed on a separate thread, and there was no guarantee that the output will get
eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not
returning anything even though the process was terminated and would definitely not produce any
further output. This was usually happening only under very heavy system load, but it can be
reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived).

This patch addresses this by adding synchronization capabilities to the Communication thread.
After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has
been processed by the read thread. This function is then called after every public event which
stops the process to obtain the entire process output.

Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out.

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 232023
2015-03-12 10:12:41 +00:00
Oleksiy Vyalov 4eab4bc23c Restore commented setTearDownCleanup in TestHelloWorld.test_with_dwarf_and_attach_to_process_with_id_api.
llvm-svn: 231737
2015-03-10 01:58:47 +00:00
Oleksiy Vyalov 63acdfdeb2 Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer - in order to allow modules caching from remote targets.
http://reviews.llvm.org/D8037

llvm-svn: 231734
2015-03-10 01:15:28 +00:00
Ilia K d4ec5a70ea Improve ValueObject::GetValueDidChange test; Add a comment for it
Summary: This patch adds a few comments for GetValueDidChange and contains improvements for TestValueVarUpdate.py test which checks ValueObject::GetValueDidChange for complex types.

Reviewers: zturner, granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: jingham, lldb-commits, granata.enrico, zturner, clayborg

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

llvm-svn: 231526
2015-03-06 22:35:08 +00:00
Vince Harron 6caca38f68 XFAIL tests that are known to fail occasionally on Linux
Trying to get the build green so we can notice new failures easier.

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

llvm-svn: 231407
2015-03-05 21:35:28 +00:00
Chaoren Lin ac8263dbf0 Applying D7950 to four near copies of the file.
Summary:
Using std::thread/random instead of pthread/rand.
Two of them also suffered from the synchronization problem in D7916.

Reviewers: clayborg, zturner, ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230993
2015-03-02 19:12:18 +00:00
Vince Harron 5a6b8aa4dd Use -fstandalone-debug for few tests to get around a Clang optimization
clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail.  This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

llvm-svn: 230831
2015-02-28 01:07:50 +00:00
Vince Harron 4a8abd3f94 Fix TestProcessIO.py when run against a remote target
Fixed test case to copy redirected stdout/stderr files from remote
target to host

llgs wasn't bothering to put the pty master file handle in the right
place if stdout/stderr were redirected to a file. It is still needed
for stdin.

Corrected some log message text

llvm-svn: 229141
2015-02-13 19:15:24 +00:00
Vince Harron df3f00f30a Fix 'process launch -i' for remote processes
We want to forward stdin when stdio is not disabled and when we're not
redirecting stdin from a file.

renamed m_stdio_disable to m_stdin_forward and inverted value because
that's what we want to remember.

There was previously a bug that if you redirected stdin from a file,
stdout and stderr would also be redirected to /dev/null

Adds support for remote target to TestProcessIO.py

Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote
Linux targets

llvm-svn: 228744
2015-02-10 21:09:04 +00:00
Pavel Labath ef0d0c65f0 Check-in generated test makefiles
for rationale, see D7407.

llvm-svn: 228314
2015-02-05 17:03:22 +00:00
Vince Harron c46945149c Fix TestTargetAPI.py when run against remote host.
In tests where stdio is redirected to a file, the file must be copied
back from the remote host for analysis by the test.

llvm-svn: 228175
2015-02-04 19:25:21 +00:00
Greg Clayton 199e7c125e Fix the test to disassemble as if at address zero, not at an invalid address. The default SBAddress constructor sets the offset to 0xffffffffffffffff and the section to NULL.
This was causing problems on clang 602 branches that use MemoryObjects to as the container for opcode bytes instead of a plain array of bytes. So we were asking for 3 bytes to be disassembled at address 0xffffffffffffffff which would cause an unsigned overflow and cause the MemoryObject to refuse to read anymore bytes.

llvm-svn: 227153
2015-01-27 00:22:36 +00:00
Zachary Turner 12947b7e25 Fix a number of tests on Windows.
These fix various issues with path handling and disable a few tests
which use features of LLVM which are not yet supported on Windows.

llvm-svn: 226042
2015-01-14 21:42:53 +00:00
Siva Chandra aaa3d47863 [TestEvents] Replace expectedFailureLinux with skipIfLinux
Summary:
If we do not mark them as skip, they are still executed, which in
turn is leading to an assertion failure. The change also adds
skipIfLinux to a testlet which was not previously marked with
skipIfLinux. This is because running even that test let leads to an
assertion failure.

Test Plan: dotest.py -C clang -p TestEvents.py

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 224644
2014-12-19 22:41:43 +00:00
Enrico Granata cf87ab9390 Now that AddressOf() does sane things with const results, this check is wrong. Since this is actually quite orthogonal to what this test is all about, actually get rid of the assertions
llvm-svn: 224290
2014-12-15 23:36:23 +00:00
Enrico Granata 15ee703045 Add a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObjectConstResult. This test passing is the baseline of functionality we want to ensure for our const results
llvm-svn: 224151
2014-12-12 21:23:55 +00:00
Zachary Turner 29278a6ac4 Disable the remaining ProcessIO test on Windows.
This still relies on PutSTDIN, just indirectly.  So it was hanging
due to not being able to get stdin from the test.

llvm-svn: 223983
2014-12-10 23:25:28 +00:00
Oleksiy Vyalov b9321bd774 Skip TestExprPathSynthetic test on FreeBSD, Linux & Windows.
llvm-svn: 223905
2014-12-10 01:48:17 +00:00
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