summaryrefslogtreecommitdiff
path: root/lldb/test/expression_command
AgeCommit message (Collapse)Author
2015-10-28Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner
This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
2015-10-27Rename `lldb_shared` to `use_lldb_suite`.Zachary Turner
llvm-svn: 251444
2015-10-26Port the python api decorator to use test categoriesPavel Labath
Summary: Per discussions on the mailing list, I have implemented a decorator which annotates individual test methods with categories. I have used this framework to replace the '-a' and '+a' command-line switches (now '-G pyapi' and '--skip-category pyapi') and the @python_api_test decorator (now @add_test_categories('pyapi')). The test suite now gives an error message suggesting the new options if the user specifies the deprecated +/-a switches. If the general direction is good, I will follow this up with other switches. Reviewers: tberghammer, tfiala, granata.enrico, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14020 llvm-svn: 251277
2015-10-23Add from __future__ import print_function everywhere.Zachary Turner
Apparently there were tons of instances I missed last time, I guess I accidentally ran 2to3 non-recursively. This should be every occurrence of a print statement fixed to use a print function as well as from __future__ import print_function being added to every file. After this patch print statements will stop working everywhere in the test suite, and the print function should be used instead. llvm-svn: 251121
2015-10-22Update every test to import `lldb_shared`.Zachary Turner
This is necessary in order to allow third party modules to be located under lldb/third_party rather than under the test folder directly. Since we're already touching every test file anyway, we also go ahead and delete the unittest2 import and main block wherever possible. The ability to run a test as a standalone file has already been broken for some time, and if we decide we want this back, we should use unittest instead of unittest2. A few places could not have the import of unittest2 removed,because they depend on the unittest2.expectedFailure or skip decorators. Removing all those was orthogonal in spirit to the purpose of this CL, so the import of unittest2 remains in those files that were using it for its test decorators. Those can be addressed separately. llvm-svn: 251055
2015-10-06Convert expectedFlakeyDarwin to expectedFlakeyDsym for ↵Todd Fiala
TestCallUserDefinedFunction.py Closes: https://llvm.org/bugs/show_bug.cgi?id=25076 llvm-svn: 249425
2015-10-06Switching TestCallUserDefinedFunction from xfail to flaky on OS X.Todd Fiala
This is passing 50/50 times for me. Moving to flaky as precautionary measure. llvm-svn: 249419
2015-09-30Merge dwarf and dsym testsTamas Berghammer
Currently most of the test files have a separate dwarf and a separate dsym test with almost identical content (only the build step is different). With adding dwo symbol file handling to the test suit it would increase this to a 3-way duplication. The purpose of this change is to eliminate this redundancy with generating 2 test case (one dwarf and one dsym) for each test function specified (dwo handling will be added at a later commit). Main design goals: * There should be no boilerplate code in each test file to support the multiple debug info in most of the tests (custom scenarios are acceptable in special cases) so adding a new test case is easier and we can't miss one of the debug info type. * In case of a test failure, the debug symbols used during the test run have to be cleanly visible from the output of dotest.py to make debugging easier both from build bot logs and from local test runs * Each test case should have a unique, fully qualified name so we can run exactly 1 test with "-f <test-case>.<test-function>" syntax * Test output should be grouped based on test files the same way as it happens now (displaying dwarf/dsym results separately isn't preferable) Proposed solution (main logic in lldbtest.py, rest of them are test cases fixed up for the new style): * Have only 1 test fuction in the test files what will run for all debug info separately and this test function should call just "self.build(...)" to build an inferior with the right debug info * When a class is created by python (the class object, not the class instance), we will generate a new test method for each debug info format in the test class with the name "<test-function>_<debug-info>" and remove the original test method. This way unittest2 see multiple test methods (1 for each debug info, pretty much as of now) and will handle the test selection and the failure reporting correctly (the debug info will be visible from the end of the test name) * Add new annotation @no_debug_info_test to disable the generation of multiple tests for each debug info format when the test don't have an inferior Differential revision: http://reviews.llvm.org/D13028 llvm-svn: 248883
2015-09-16Last set of XFAILs for Windows.Zachary Turner
llvm-svn: 247825
2015-09-16Decorate flaky FreeBSD testEd Maste
ExprCommandWithTimeoutsTestCase::expectedFailureFreeBSD had an expectedFailureFreeBSD decorator, removed in r247799. It had been flakey on the FreeBSD buildbot but passed locally. John Wolfe has since observed a local failure, so add expectedFlakeyFreeBSD until we can investigate and likely increase the timeout in the test. llvm.org/pr19605 (FreeBSD) llvm.org/pr20275 (equivalent Linux issue) llvm-svn: 247822
2015-09-16Remove expectedFailureFreeBSD from passing testEd Maste
ExprCommandWithTimeoutsTestCase::expectedFailureFreeBSD This test passes locally but was marked XFAIL due to failures on the FreeBSD buildbot. That buildbot has been retired as it was overloaded, and we will investigate again if this fails once a new buildbot is in place. llvm.org/pr19605 llvm-svn: 247799
2015-09-14OS X unexpected success cleanupTodd Fiala
TestPersistObjCPointeeType and TestObjCNewSyntax marked up to expect success on clang >= 7.0.0. TestMultipleDebuggers passed 25/25 times, taking off intermittent. If this changes, I'll make sure it goes into a flaky/flakey category. llvm-svn: 247601
2015-09-14Remove expectedFailureFreeBSD from now-passing testEd Maste
ExprCommandCallUserDefinedFunction::test_with_dwarf llvm.org/pr20274 llvm-svn: 247596
2015-09-14Fix up bad compiler spec on ConstVariableTestCase; fixup two more OS X ↵Todd Fiala
unexpected successes. llvm-svn: 247591
2015-09-14Cleaned up a few unexpected successes on OS XTodd Fiala
TestCallStdStringFunction TestCallWithTimeout TestConstVariables TestClassTypes llvm-svn: 247576
2015-09-11XFAIL miscellaneous tests on windows.Zachary Turner
llvm.org/pr24778 llvm-svn: 247460
2015-09-11XFAIL tests that try to call a function in the inferior.Zachary Turner
llvm.org/pr21765 llvm-svn: 247456
2015-09-09XFAIL TestFormatters on FreeBSDEd Maste
The test is hitting an assertion in Clang. This is an extension of r246766. llvm.org/pr24691 llvm-svn: 247141
2015-09-04Set the default language to use when evaluating to that of the frame's CU.Dawn Perchik
* Use the frame's context (instead of just the target's) when evaluating, so that the language of the frame's CU can be used to select the compiler and/or compiler options to use when parsing the expression. This allows for modules built with mixed languages to be parsed in the context of their frame. * Add all C and C++ language variants when determining the language options to set. * Enable C++ language options when language is C or ObjC as a workaround since the expression parser uses features of C++ to capture values. * Enable ObjC language options when language is C++ as a workaround for ObjC requirements. * Disable C++11 language options when language is C++03. * Add test TestMixedLanguages.py to check that the language being used for evaluation is that of the frame. * Fix test TestExprOptions.py to check for C++11 instead of C++ since C++ has to be enabled for C, and remove redundant expr --language test for ObjC. * Fix TestPersistentPtrUpdate.py to not require C++11 in C. Reviewed by: clayborg, spyffe, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11102 llvm-svn: 246829
2015-09-03Lookup function using full name if one with mangled name is not found.Siva Chandra
Summary: Remove expected failure decorators from tests which now should start passing. Reviewers: clayborg, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12613 llvm-svn: 246820
2015-09-03XFAIL TestFormatters on android (llvm.org/pr24691)Pavel Labath
the test is hitting an assertion in clang. llvm-svn: 246766
2015-08-25Fix a bunch of portability issues in test executables.Zachary Turner
llvm-svn: 245983
2015-08-21Increase timeout in TestExpressionInSyscallPavel Labath
test times out on the windows->android buildbot (probably due to android emulator being slow) llvm-svn: 245691
2015-08-20[Windows] XFAIL tests that require calling a function in target.Zachary Turner
This has known issues on Windows. Fixing this is tracked by http://llvm.org/pr21765 llvm-svn: 245630
2015-08-20Increase timeout in TestCallWithTimeout to reduce flakynessPavel Labath
The test was flaky on the android buildbot, because the 10ms test completed before we got a chance to interrupt it. I increase the duration to 50ms to hopefully get more consistent results. llvm-svn: 245555
2015-08-19Increase timeout in TestCallThatRestartsPavel Labath
the test was failing on android because processing 30 signals involved a lot of round-trips, which was not possible in the 0.5s default timeout. After the increase the test seems to pass reliably. llvm-svn: 245448
2015-08-19On Linux, clear the signal mask of the launched inferiorPavel Labath
Summary: Due to fork()/execve(), the launched inferior inherits the signal mask of its parent (lldb-server). But because lldb-server modifies its signal mask (It blocks SIGCHLD, for example), the inferior starts with some signals being initially blocked. One consequence is that TestCallThatRestarts.ExprCommandThatRestartsTestCase (test/expression_command/call-restarts) fails because sigchld_handler() in lotta-signals.c is not called, due to the SIGCHLD signal being blocked. To prevent the signal masking done by lldb-server from affecting the created inferior, the signal mask of the inferior is now cleared before the execve(). Patch by: Yacine Belkadi Reviewers: ovyalov, labath Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12138 llvm-svn: 245436
2015-08-18[Windows] XFAIL tests that depend on expression name lookup.Zachary Turner
Name lookup doesn't work properly with Windows targets. This is most likely due to issues with name mangling, although there is at least one set of debug info related issues as well, since some of the name lookup requests appear to be failing on types rather than symbols. Specifically, this patch XFAILS the following set of tests: TestChar1632T.py TestRdar12991846.py TestConstVariables.py TestCallCPPFunction.py TestCallStopAndContinue.py TestCallUserDefinedFunction.py TestCModules.py TestCPPThis.py TestExprs2.py TestOverloadedFunctions.py TestRvalueReferences.py And fixing the underlying issue is tracked in http://llvm.org/pr24489 llvm-svn: 245338
2015-08-13Set orig_eax to -1 for Linux x86 platformsRavitheja Addepally
Summary: For Linux x86 based environments the orig_eax/orig_rax register should be set to -1 to prevent the instruction pointer to be decremented, which was the cause for the SIGILL exception. Fix for Bug 23659 Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg Subscribers: clayborg, labath Differential Revision: http://reviews.llvm.org/D11411 llvm-svn: 244875
2015-07-28Fix comment in TestExprOptions to match change of language from ObjC to ObjC++.Dawn Perchik
llvm-svn: 243488
2015-07-27Fix test suite. For now we can't disable C++ for expressions since the ↵Greg Clayton
return value is returned as a reference and this test fails on MacOSX. llvm-svn: 243342
2015-07-27Only test ObjC expression options on Darwin.Chaoren Lin
Reviewers: dawn, emaste, vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11539 llvm-svn: 243329
2015-07-27XFAIL TestExprOptions on FreeBSD.Ed Maste
r243230 XFAILed it for Linux; it also fails on FreeBSD. llvm-svn: 243307
2015-07-25XFAIL TestExprOptions on Linux.Chaoren Lin
llvm-svn: 243230
2015-07-25Shorten the lldb timeout, we were seeing occasional failure becauseJim Ingham
lldb didn't wake up before the target function got a chance to complete. <rdar://problem/21990308> llvm-svn: 243193
2015-07-25Specify a language to use when parsing expressions.Dawn Perchik
This patch adds the option -l/--language to the expression command, for use when setting the language options or choosing an alternate FE. If not specified, the target.language setting is used. Reviewed by: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11447 llvm-svn: 243187
2015-07-20Eliminated a potential infinite recursion in structure layout when the originSean Callanan
for a CXXRecordDecl gets pointed at that record. This can happen when a type is imported out of and then into the target's AST context without being laid out. Also added a testcase that covers this scenario. <rdar://problem/21844453> llvm-svn: 242687
2015-07-17Make this test case be somewhat less verbose when not asked toEnrico Granata
llvm-svn: 242573
2015-07-14Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a ↵Ewan Crawford
function call on target via register manipulation For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support. Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls. In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation. To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter. The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values. Reviewers: jingham, spyffe Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427 Differential Revision: http://reviews.llvm.org/D9404 llvm-svn: 242137
2015-07-08Fixed a serious bug in DeportType where the types could retain DeclContexts thatSean Callanan
pointed into the artificial function constructed for the expression. I now make anything that pointed to the function as its DeclContext be global while the copy occurs; afterward I restored the old DeclContext. Added a testcase that make sure that this works properly and doesn't crash anything. <rdar://problem/21049838> llvm-svn: 241695
2015-07-06Fix final wait in ExprSyscallTestCase for aarch64Tamas Berghammer
llvm-svn: 241435
2015-07-01Reversed r238363, because the message is inconsistentSean Callanan
with all the other assertion messages. llvm-svn: 241212
2015-06-26Added expectedFlakey test decoratorVince Harron
SUMMARY Flakey tests get two chances to pass Also, switched a bunch of tests to use new decorator. TEST PLAN Add one of these decorators to a test Edit a test to pass on the first invocation, confirm test appears as pass Edit a test to pass on the first invocation, pass on the second, confirm test appears as xfail Edit a test to fail on two consecutive runs, confirm test appears in results as fail/error Differential Revision: http://reviews.llvm.org/D10721 llvm-svn: 240789
2015-06-17Add a test for expression evaluation while inferior is blocked in a syscallPavel Labath
Summary: The test is XFAILed for Linux x86_64 and i386 because of bug #23659. Test Plan: NFC Reviewers: tberghammer Subscribers: lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D10519 llvm-svn: 239973
2015-06-02Use wildcard instead of relying on shell globbing.Chaoren Lin
Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10194 llvm-svn: 238859
2015-05-28Added a test that makes sure that structs returnedSean Callanan
from expressions return intact. <rdar://problem/21146609> llvm-svn: 238512
2015-05-27[TestBase.runCmd] Better error message when runCmd fails.Siva Chandra
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-17XFAIL'd some flakey tests on DarwinVince Harron
llvm-svn: 237543
2015-05-16Constant result ValueObjects are - well - constantEnrico Granata
And they also do not have a thread/frame attached to them That makes dynamic and synthetic values attached to them impossible to update - which, among other things, makes it impossible to properly display persistent variables of types that could have such dynamic/persistent values Fix this by making it so that a ValueObject can control its constantness (hint: dynamic and synthetic values cannot be constant) and whether it wants to let itself be updated when an invalid thread is around llvm-svn: 237504
2015-05-12Revert accidental file checkinVince Harron
llvm-svn: 237184