summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Fix nondeterminism in TestCppBitfieldsPavel Labath2020-01-282-2/+2
| | | | | | | | | | | | | The test was printing a char[3] variable without a terminating nul. The memory after that variable (an unnamed bitfield) was not initialized. If the memory happened to be nonzero, the summary provider for the variable would run off into the next field. This is probably not the right behavior (it should stop at the end of the array), but this is not the purpose of this test. I have filed pr44649 for this bug, and fixed the test to not depend on this behavior. (cherry picked from commit 77cedb0cdb8623ff9eb22dbf3b9302ee4d9f8a20)
* [LLDB] Fix the handling of unnamed bit-fields when parsing DWARFshafik2020-01-273-0/+189
| | | | | | | | We ran into an assert when debugging clang and performing an expression on a class derived from DeclContext. The assert was indicating we were getting the offsets wrong for RecordDeclBitfields. We were getting both the size and offset of unnamed bit-field members wrong. We could fix this case with a quick change but as I extended the test suite to include more combinations we kept finding more cases that were being handled incorrectly. A fix that handled all the new cases as well as the cases already covered required a refactor of the existing technique. Differential Revision: https://reviews.llvm.org/D72953 (cherry picked from commit fcaf5f6c01a09f23b948afb8c91c4dd951d4525e)
* [lldb] Add expect_expr function for testing expression evaluation in dotests.Raphael Isemann2020-01-153-5/+45
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new function to lldbtest: `expect_expr`. This function is supposed to replace the current approach of calling `expect`/`runCmd` with `expr`, `p` etc. `expect_expr` allows evaluating expressions and matching their value/summary/type/error message without having to do any string matching that might allow unintended passes (e.g., `self.expect("expr 3+4", substrs=["7"])` can unexpectedly pass for results like `(Class7) $0 = 7`, `(int) $7 = 22`, `(int) $0 = 77` and so on). This only uses the function in a few places to test and demonstrate it. I'll migrate the tests in follow up commits. Reviewers: JDevlieghere, shafik, labath Reviewed By: labath Subscribers: christof, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70314
* [lldb/test] Add test for CMTime data formatterJonas Devlieghere2020-01-143-0/+67
| | | | | Add a test for the CMTime data formatter. The coverage report showed that this code path was untested.
* dotest.py: Add option to pass extra lldb settings to dotestAdrian Prantl2020-01-143-9/+28
| | | | | | | The primary motivation for this is to add another dimension to the Swift LLDB test matrix, but this seems generally useful. Differential Revision: https://reviews.llvm.org/D72662
* [lldb/test] test_breakpoints_func_full from ↵Stella Stamenova2020-01-141-1/+0
| | | | | | TestNamespace.NamespaceBreakpointTestCase is now passing on Windows After https://reviews.llvm.org/D70846, the test is now passing on Windows
* Expression eval lookup speedup by not returning methods in ↵Levon Ter-Grigoryan2020-01-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | ManualDWARFIndex::GetFunctions Summary: This change is connected with https://reviews.llvm.org/D69843 In large codebases, we sometimes see Module::FindFunctions (when called from ClangExpressionDeclMap::FindExternalVisibleDecls) returning huge amounts of functions. In current fix I trying to return only function_fullnames from ManualDWARFIndex::GetFunctions when eFunctionNameTypeFull is passed as argument. Reviewers: labath, jarin, aprantl Reviewed By: labath Subscribers: shafik, clayborg, teemperor, arphaman, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70846
* [lldb/Expression] Improve interpreter error message with a non-running targetMed Ismail Bennani2020-01-141-4/+4
| | | | | | | | | | | | | | | | | | When trying to interpret an expression with a function call, if the process hasn't been launched, the expression fails to be interpreted and the user gets the following error message: ```error: Can't run the expression locally``` This message doesn't explain why the expression failed to be interpreted, that's why this patch improves the error message that is displayed when trying to run an expression while no process is running. rdar://11991708 Differential Revision: https://reviews.llvm.org/D72510 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* [lldb][NFC] Rewrite python_api/rdar-12481949 testRaphael Isemann2020-01-145-82/+24
| | | | | | | | | | | | | | | | | | | | Summary: This renames the test `rdar-12481949` to `get-value-32bit-int` as it just tests that we return the correct result get calling GetValueAsSigned/GetValueAsUnsigned on 32-bit integers. It also deletes all the strange things going on in this test including resetting the data formatters (which are to my knowledge not used to calculate scalar values) and testing Python's long integers (let's just assume that our Python distribution works correctly). Also modernises the setup code. Reviewers: labath, aprantl Reviewed By: aprantl Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72593
* [lldb] Fix that SBThread.GetStopDescription is returning strings with ↵Raphael Isemann2020-01-141-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uninitialized memory at the end. Summary: `SBThread.GetStopDescription` is a curious API as it takes a buffer length as a parameter that specifies how many bytes the buffer we pass has. Then we fill the buffer until the specified length (or the length of the stop description string) and return the string length. If the buffer is a nullptr however, we instead return how many bytes we would have written to the buffer so that the user can allocate a buffer with the right size and pass that size to a subsequent `SBThread.GetStopDescription` call. Funnily enough, it is not possible to pass a nullptr via the Python SWIG bindings, so that might be the first API in LLDB that is not only hard to use correctly but impossible to use correctly. The only way to call this function via Python is to throw in a large size limit that is hopefully large enough to contain the stop description (otherwise we only get the truncated stop description). Currently passing a size limit that is smaller than the returned stop description doesn't cause the Python bindings to return the stop description but instead the truncated stop description + uninitialized characters at the end of the string. The reason for this is that we return the result of `snprintf` from the method which returns the amount of bytes that *would* have been written (which is larger than the buffer). This causes our Python bindings to return a string that is as large as full stop description but the buffer that has been filled is only as large as the passed in buffer size. This patch fixes this issue by just recalculating the string length in our buffer instead of relying on the wrong return value. We also have to do this in a new type map as the old type map is also used for all methods with the given argument pair `char *dst, size_t dst_len` (e.g. SBProcess.GetSTDOUT`). These methods have different semantics for these arguments and don't null-terminate the returned buffer (they instead return the size in bytes) so we can't change the existing typemap without breaking them. Reviewers: labath, jingham Reviewed By: labath Subscribers: clayborg, shafik, abidh, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72086
* [lldb] Revert ddf044290ede for TestProcessAPI.pyRaphael Isemann2020-01-131-1/+0
| | | | | It seems ddf044290ede7d7fd47f4f673e3e628f551a8aac caused the test to time out on the Windows bot, but it's unclear to me why.
* [lldb][NFC] Remove debug print statement from TestExprDiagnostics.pyRaphael Isemann2020-01-131-1/+0
|
* [lldb] Mark several tests as not dependent on debug infoRaphael Isemann2020-01-1340-39/+42
| | | | | | | | | | | | | | | | Summary: This just adds `NO_DEBUG_INFO_TESTCASE` to tests that don't really exercise anything debug information specific and therefore don't need to be rerun for all debug information variants. Reviewers: labath, jingham, aprantl, mib, jfb Reviewed By: aprantl Subscribers: dexonsmith, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72447
* lldbutil: Forward ASan launch info to test inferiorsVedant Kumar2020-01-101-1/+8
| | | | | | | | | This allows an unsanitized test process which loads a sanitized DSO (the motivating example is a Swift runtime dylib) to launch on Darwin. rdar://57290132 Differential Revision: https://reviews.llvm.org/D71379
* [lldb][tests] Make it possible to expect failure for a whole categoryTatyana Krasnukha2020-01-104-4/+24
| | | | | | | | | | | | | There already are decorators and "--excluded" option to mark test-cases/files as expected to fail. However, when a new test file is added and it which relates to a feature that a target doesn't support, this requires either adding decorators to that file or modifying the file provided as "--excluded" option value. The purpose of this patch is to avoid any modifications in such cases. E.g. if a target doesn't support "watchpoints" and passes "--xfail-category watchpoint" to dotest, a testing job will not fail after a new watchpoint-related test file is added. Differential Revision: https://reviews.llvm.org/D71906
* [lldb][tests][NFC] Unify variable naming conventionTatyana Krasnukha2020-01-105-45/+45
|
* [lldb][tests] Cleanup '.categories'Tatyana Krasnukha2020-01-106-5/+1
|
* [lldb][test] NFC, re-use _getTestPath() functionTatyana Krasnukha2020-01-101-21/+14
|
* [lldb][tests] Take into account all parent's categories when traverse ↵Tatyana Krasnukha2020-01-102-12/+13
| | | | | | | | | | | | folders upwards This is needed to not re-write parent's categories by categories of a nested folder, e.g. commands/expression/completion specify "cmdline" category, however it still belongs to parent's "expression" category. The sentinel ".categories" in the test-suite root directory is no longer needed. Differential Revision: https://reviews.llvm.org/D71905
* Data formatters: Look through array element typedefsJaroslav Sevcik2020-01-103-0/+25
| | | | | | | | | | | | | | | | | Summary: Motivation: When formatting an array of typedefed chars, we would like to display the array as a string. The string formatter currently does not trigger because the formatter lookup does not resolve typedefs for array elements (this behavior is inconsistent with pointers, for those we do look through pointee typedefs). This patch tries to make the array formatter lookup somewhat consistent with the pointer formatter lookup. Reviewers: teemperor, clayborg Reviewed By: teemperor, clayborg Subscribers: clayborg, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72133
* When reading Aux file in chunks, read consecutive byte rangesJason Molenda2020-01-091-0/+160
| | | | | | | | | | | | | | | | | | | | | | | qemu has a very small maximum packet size (4096) and it actually only uses half of that buffer for some implementation reason, so when lldb asks for the register target definitions, the x86_64 definition is larger than 4096/2 and we need to fetch it in two parts. This patch and test is fixing a bug in GDBRemoteCommunicationClient::ReadExtFeature when reading a target file in multiple parts. lldb was assuming that it would always get back the maximum packet size response (4096) instead of using the actual size received and asking for the next group of bytes. We now have two tests in gdb_remote_client for unique features of qemu - TestNestedRegDefinitions.py would test the ability of lldb to follow multiple levels of xml includes; I opted to create a separate TestRegDefinitionInParts.py test to test this wrinkle in qemu's gdb remote serial protocol stub implementation. Instead of combining both tests into a single test file. <rdar://problem/49537922>
* [lldb] Fix that TestNoSuchArch.py was passing for the wrong reasonRaphael Isemann2020-01-091-2/+2
| | | | | | The command here failed due to the type in 'create' but the expect did not actually check for the error message. This fixes the typo and adds a check for the actuall error message we should see.
* Change the patterns to include the prefix '= ' so we don't pass errantly.Jason Molenda2020-01-061-5/+5
| | | | | | | | Looking at a sometimes-passing test case on a platform where random values were being returned - sometimes the expected digit ('1' or '2') would be included in the random returned value. Add a prefix to reduce the likelihood of this a bit.
* [lldb/Test] Move @skipIfAsan from test class to test methods.Jonas Devlieghere2020-01-061-1/+2
| | | | skipTestIfFn can only be used to decorate a test method.
* [lldb/Test] Temporarily skip TestFoundationDisassembly on the ASan bot.Jonas Devlieghere2020-01-061-0/+1
| | | | | This test is timing out on the sanitized bot on GreenDragon. Temporarily disable it to increase the signal-to-noise ration.
* [lldb/Command] Add --force option for `watchpoint delete` commandMed Ismail Bennani2020-01-041-20/+25
| | | | | | | | | | | | | | Currently, there is no option to delete all the watchpoint without LLDB asking for a confirmation. Besides making the watchpoint delete command homogeneous with the breakpoint delete command, this option could also become handy to trigger automated watchpoint deletion i.e. using breakpoint actions. rdar://42560586 Differential Revision: https://reviews.llvm.org/D72096 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* Revert "[lldb/Command] Add --force option for `watchpoint delete` command"Med Ismail Bennani2020-01-031-50/+0
| | | | This reverts commit 3620e5f28a4d2800fb6c325ec24b3d660e48b9ba.
* [lldb/Command] Add --force option for `watchpoint delete` commandMed Ismail Bennani2020-01-031-0/+50
| | | | | | | | | | | | Currently, there is no option to delete all the watchpoint without LLDB asking for a confirmation. Besides making the watchpoint delete command homogeneous with the breakpoint delete command, this option could also become handy to trigger automated watchpoint deletion i.e. using breakpoint actions. rdar://42560586 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* [lldb] Fix crash in AccessDeclContextSanity when copying ↵Raphael Isemann2020-01-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | FunctionTemplateDecl inside a record. Summary: We currently don't set access specifiers for function template declarations. This seems to be fine as long as the function template is not declared inside any record in which case Clang asserts with the following once we try to query it's access: ``` Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function AccessDeclContextSanity, ``` This patch just marks these function template declarations as public to make Clang happy. Reviewers: shafik, teemperor Reviewed By: teemperor Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71909
* tests: XFAIL/UNSUPPORTED tests on WindowsSaleem Abdulrasool2020-01-015-4/+12
| | | | | | | | | Now that we are building the python bindings on Windows once more, the extended testsuite is running. Mark a few failing tests and skip a few tests which hang. This should at least bring the bot back to green without reverting the Python changes which are an improvement for the build system and enable another ~35% of the test suite which was previously disabled.
* [lldb] Silent random xpass on aarch64-linux buildbotMuhammad Omair Javaid2019-12-271-1/+1
| | | | | | This patch adds skipif decorator to TestWatchLocationWithWatchSet.py. Decorator will trigger for aarch64-linux as this test passes randomly causing buildbot failure.
* [lldb][test] Don't include "test_common.h" in the debug macros testTatyana Krasnukha2019-12-261-0/+3
| | | | | GCC produces incorrect .debug_macro section when "-include" option is used: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93075.
* [lldb][NFC] Add "lldb-vscode" to all_categoriesTatyana Krasnukha2019-12-261-0/+1
| | | | Required to make the category manually disableable.
* [lldb][NFC] Simplify if-returnTatyana Krasnukha2019-12-261-3/+1
|
* [lldb][tests] Platform triple can be NoneTatyana Krasnukha2019-12-261-1/+6
| | | | If a remote target is not connected, SBPlatform's GetTriple function returns None.
* [lldb][tests] Posix function strdup requires macro _POSIX_C_SOURCETatyana Krasnukha2019-12-261-0/+2
|
* test: ensure that we dead-strip in the linkerSaleem Abdulrasool2019-12-241-0/+1
| | | | | `/OPT:REF` is needed for link to dead strip functions, `/Gy` by itself is not sufficient.
* test: correct flags for WindowsSaleem Abdulrasool2019-12-231-0/+2
| | | | | Adjust the flags for the LLDB test on Windows. This test was previously not running, but after the fix to the python detection, we now run this.
* [lldb/test] Skip editline tests when LLDB_ENABLE_LIBEDIT is off.Jonas Devlieghere2019-12-205-0/+8
| | | | | Add a new decorator that checks if LLDB was build with editline support and mark the relevant tests as skipped when that's not the case.
* [lldb/pexpect] Force-set the TERM environment variablePavel Labath2019-12-201-1/+7
| | | | | | | | | In some environments (typically, buildbots), this variable may not be available. This can cause tests to behave differently. Explicitly set the variable to "vt100" to ensure consistent test behavior. It should not matter that we do not inherit the process TERM variable, as the child process runs in a new virtual terminal anyway.
* [lldb] Added test for objc_direct calls with categoriesRaphael Isemann2019-12-201-0/+13
| | | | As pointed out in D71694 this wasn't tested before in LLDB.
* [lldb] Remove XFAIL from TestDeadStrip.pyPavel Labath2019-12-201-2/+0
| | | | Fixed by 92211b.
* [ASTImporter][LLDB] Modifying ImportDeclContext(...) to ensure that we ↵shafik2019-12-193-1/+44
| | | | | | | | | | complete each FieldDecl of a RecordDecl when we are importing the definiton This fix was motivated by a crashes in expression parsing during code generation in which we had a RecordDecl that had incomplete FieldDecl. During code generation when computing the layout for the RecordDecl we crash because we have several incomplete FieldDecl. This fixes the issue by assuring that during ImportDefinition(...) for a RecordDecl we also import the definitions for each FieldDecl. Differential Revision: https://reviews.llvm.org/D71378
* Add prototype for a function we call.Jason Molenda2019-12-181-0/+2
|
* [lldb] Remove modern-type-lookupRaphael Isemann2019-12-1712-145/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup. This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around for now). The motivation for this is that I don't think that the current approach of implementing modern-type-lookup will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has so far made the transition work much more complicated than it has to be. A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring and actually testing the existing code we have. [1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html Reviewers: shafik, martong Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss Tags: #lldb Differential Revision: https://reviews.llvm.org/D71562
* [lldb-vscode] Centrally skip debug info variants for vscode testsPavel Labath2019-12-1710-25/+2
| | | | Previously each test was annotated manually. This does the same thing.
* [lldb] Add support for calling objc_direct methods from LLDB's expression ↵Raphael Isemann2019-12-173-0/+88
| | | | | | | | | | | | | | | | | | | | | evaluator. Summary: D69991 introduced `__attribute__((objc_direct))` that allows directly calling methods without message passing. This patch adds support for calling methods with this attribute to LLDB's expression evaluator. The patch can be summarised in that LLDB just adds the same attribute to our module AST when we find a method with `__attribute__((objc_direct))` in our debug information. Reviewers: aprantl, shafik Reviewed By: shafik Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71196
* Explicitly specify -std=c++11 and include <mutex> and <condition_variable>.Jim Ingham2019-12-164-0/+6
| | | | These files built on macos but not on Debian Linux. Let's see if this fixes it.
* Run all threads when extending a next range over a call.Jim Ingham2019-12-167-87/+190
| | | | | | | | | If you don't do this you end up running arbitrary code with only one thread allowed to run, which can cause deadlocks. <rdar://problem/56422478> Differential Revision: https://reviews.llvm.org/D71440
* [lldb] Use file-based synchronization in TestVSCode_attachPavel Labath2019-12-162-14/+26
| | | | The is the best method we have at the moment for attach-style tests.
OpenPOWER on IntegriCloud