summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a way to load an image using a library name and list of paths.Jim Ingham2018-06-286-0/+184
| | | | | | | | | | This provides an efficient (at least on Posix platforms) way to offload to the target process the search & loading of a library when all we have are the library name and a set of potential candidate locations. <rdar://problem/40905971> llvm-svn: 335912
* [lldbsuite] Fix TestBreakpointHitCount on WindowsStella Stamenova2018-06-281-1/+1
| | | | | | | | | | | | Summary: On Windows, the newer DIA SDKs end up producing function names that contain the return type as well. This means that the function name returned in the test will contain the return type (int) in addition to the name of the function and the type of the input (a(int)). To account for the possibility of both, the test should pass if the function name matches either pattern. Reviewers: zturner, asmith Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48654 llvm-svn: 335906
* Skip core file tests on build configurations lacking necessary componentsPavel Labath2018-06-282-0/+21
| | | | | | | | | | | | | | | | | | | Summary: To successfully open a core file, we need to have LLVM built with support for the relevant target. Right now, if one does not have the appropriate targets configured, the tests will fail. This patch uses the GetBuildConfiguration SB API to inform the test (and anyone else who cares) about the list of supported LLVM targets. The test then uses this information to approriately skip the tests. Reviewers: clayborg, jingham Subscribers: martong, lldb-commits Differential Revision: https://reviews.llvm.org/D48641 llvm-svn: 335859
* [SymbolFile] Implement GetCompleteObjCClass for .debug_namesJonas Devlieghere2018-06-271-3/+16
| | | | | | | | | | | | | | | When running the test suite with .debug_names a bunch of tests were failing because GetCompleteObjCClass was not yet implemented for DebugNamesDWARFIndex. This patch adds the required logic. We use the .debug_names to find the Objective-C class and then rely on DW_AT_APPLE_objc_complete_type to find the complete type. If we can't find it or the attribute is not supported, we return a list of potential complete types. Differential revision: https://reviews.llvm.org/D48596 llvm-svn: 335776
* This is not a debug info sensitive test.Jim Ingham2018-06-261-0/+2
| | | | llvm-svn: 335688
* Fix TestThreadExit for gcc&libc++ comboPavel Labath2018-06-251-1/+2
| | | | | | | | | | | | | | | | pseudo_barrier_wait() begins by decrementing an atomic variable. Since these are always_inline in libc++, there is no line table anchor to break on before we decrement it. This meant that on gcc we stopped after the variable has been decremented, which meant that thread2 could have exited, violating the test setup. On clang this wasn't a problem because it generated some line table entries for the do{}while(0) loop in the macro, so we still ended up stopping, before we touched the variable. I fix this by adding a dummy statement before the pseudo_barrier_wait() command and setting the breakpoint there. llvm-svn: 335476
* Make testcase classnames uniqueJan Kratochvil2018-06-243-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Filenames with test results contain only the class name which makes it more difficult to find it if the same class name is present in multiple *.py files. packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py -class ReturnValueTestCase(TestBase): +class StepAvoidsNoDebugTestCase(TestBase): as ReturnValueTestCase is already present in: packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py -class CreateDuringStepTestCase(TestBase): +class CrashDuringStepTestCase(TestBase): as CreateDuringStepTestCase is already present in: packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py -class TestCStepping(TestBase): +class StepUntilTestCase(TestBase): as TestCStepping is already present in: packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py llvm-svn: 335431
* Mark this test as no debuginfoAdrian Prantl2018-06-221-1/+1
| | | | llvm-svn: 335386
* Android.rules: Use libc++ by defaultPavel Labath2018-06-223-9/+14
| | | | | | | | | | | | | | | | libstdc++ will soon be dropped from the android NDK. This patch makes sure we are prepared for that by using libc++ in tests by default (i.e., except for libstdc++ data formatter tests). Only a couple of small tweaks were needed to make this work: - Add the libc++ include paths to CXXFLAGS only. This was necessary to make the tests compile with -fmodules. The modules tests have been disabled, but this way, they will be ready for them if they are enabled. - in one test I had to add an explicit std::string copy to make sure the copy constructor is there for the expression evaluator to find it. llvm-svn: 335344
* [DataFormatter] Add CFDictionary data formatterJonas Devlieghere2018-06-212-1/+10
| | | | | | | | Add data formatter for NSCFDictionary/CFDictionaryRef. Differential revision: https://reviews.llvm.org/D48450 llvm-svn: 335271
* Disable gmodules tests on linuxPavel Labath2018-06-211-1/+1
| | | | | | | | | | | | | | | | These tests are extremely environment-dependent. if the environment is not module-enabled (which is the likely scenario), they won't test anything. If one happens to have a module-enabled libc++, then the he will start running into problems. The first one is that the debug info in pcm file contains relocations that ObjectFileELF doesn't handle (particularly on non-x86 architectures), but even after that is resolved, it seems we still are unable to pull debug info out of the pcm file. I've filed pr37893 to track that, and I am disabling gmodules tests on linux until these issues are resolved. llvm-svn: 335235
* Make test sources compatible with android+libcxx+modulesPavel Labath2018-06-208-102/+101
| | | | | | | | | | | | | | In a modules build, android is very picky about which symbols are visible after including libc++ headers (e.g. <cstdio> defines only std::printf and not ::printf). This consolidates the tests where this was an issue to always include the <c???> version of the headers and prefixes the symbols with std:: as necessary. Apart from that, there is no functional change in the tests. llvm-svn: 335149
* Make sure TestNumThreads works with libc++Pavel Labath2018-06-202-2/+6
| | | | | | | | | | | | | | | | The problem was that with libc++ the std::unique_lock declaration was completely inlined, so there was no line table entry in the main.cpp file to set a breakpoint on. Therefore, the breakpoint got moved to the next line, but that meant the test would deadlock as the thread would stop with the lock already held. I fix that issue by adding a dummy statement before the std::unique_lock line to anchor the breakpoint. I think this should fix the issue because of which this test was disabled on darwin, but someone should verify that before enabling it. llvm-svn: 335132
* IRInterpreter: fix sign extension of small types (pr37840)Pavel Labath2018-06-201-0/+8
| | | | | | | | | | | | | Sign-extension of small types (e.g. short) was not handled correctly. The reason for that was that when we were assigning the a value to the Scalar object, we would accidentally promote the type to int (even though the assignment code in AssignTypeToMatch tried to cast the value to the appropriate type, it would still invoke the "int" version of operator=). Instead, I use the APInt version of operator=, where the bitwidth is specified explicitly. Among other things, this allows us to fold the individual size cases into one. llvm-svn: 335114
* Make TestCommandScript.py NO_DEBUG_INFO_TESTCASEPavel Labath2018-06-191-0/+1
| | | | llvm-svn: 335051
* Fix the 'tb' alias commandFrederic Riss2018-06-181-0/+25
| | | | | | | No idea when this broke or if it ever worked. Added a small test for one-shot breakpoints while I was there. llvm-svn: 334921
* Fix TestExec after r334783Frederic Riss2018-06-151-8/+1
| | | | | | | | | | | | The second makefile that was added has implicit rules which meant that secondprog.cpp would be built once into a secondprog binary, but it would also be compiled as a.out overwriting the main binary. This lead to spurious failures. This commit simplifies the Makefile to build only once with the correct executable name. llvm-svn: 334861
* Change TestExec.py from creating an i386+x86_64 fat binaryJason Molenda2018-06-155-90/+87
| | | | | | | | | | on darwin systems and re-execing itself, to creating two separate test programs; lldb runs the first program and it exec's the second. Support for compiling for i386 is going away. llvm-svn: 334783
* [lit] Split test_set_working_dir TestProcessLaunch into two tests and fix it ↵Stella Stamenova2018-06-132-12/+29
| | | | | | | | | | | | | | | | | | | | | | on Windows Summary: test_set_working_dir was testing two scenario: failure to set the working dir because of a non existent directory and succeeding to set the working directory. Since the negative case fails on both Linux and Windows, the positive case was never tested. I split the test into two which allows us to always run both the negative and positive cases. The positive case now succeeds on Linux and the negative case still fails. During the investigation, it turned out that lldbtest.py will try to execute a process launch command up to 3 times if the command failed. This means that we could be covering up intermittent failures by running any test that does process launch multiple times without ever realizing it. I've changed the counter to 1 (though it can still be overwritten with the environment variable). This change also fixes both the positive and negative cases on Windows. There were a few issues: 1) In ProcessLauncherWindows::LaunchProcess, the error was not retrieved until CloseHandle was possibly called. Since CloseHandle is also a system API, its success would overwrite any existing error that could be retrieved using GetLastError. So by the time the error was retrieved, it was now a success. 2) In DebuggerThread::StopDebugging TerminateProcess was called on the process handle regardless of whether it was a valid handle. This was causing the process to crash when the handle was LLDB_INVALID_PROCESS (0xFFFFFFFF). 3) In ProcessWindows::DoLaunch we need to check that the working directory exists before launching the process to have the same behavior as other platforms which first check the directory and then launch process. This way we also control the exact error string. Reviewers: labath, zturner, asmith, jingham Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48050 llvm-svn: 334642
* [ObjC] Add dataformatter for NSDecimalNumberJonas Devlieghere2018-06-132-1/+13
| | | | | | | | | | This patch adds a data formatter for NSDecimalNumber. The latter is a Foundation object used for representing and performing arithmetic on base-10 numbers that bridges to Decimal. Differential revision: https://reviews.llvm.org/D48114 llvm-svn: 334638
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-132-2/+2
| | | | llvm-svn: 334614
* DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes methodPavel Labath2018-06-121-2/+15
| | | | | | | | | | | | This method is used to find complete definitions of a type when one parses a compile unit with only forward declaration available. Since it is only accessed from DWARFASTParserClang, it was not possible/easy to trigger this codepath from lldb-test. Therefore, I adapt add a debug-names variant to an existing dotest test to cover this scenario. llvm-svn: 334516
* Exempt some compilers from new static variable test.Jonas Devlieghere2018-06-121-8/+34
| | | | | | | | Apparently some compilers generate incomplete debug information which caused the updated test to fail. Therefore I've extracted the new check into a separate test case with the necessary decorators. llvm-svn: 334456
* [Test] Update static variable test.Jonas Devlieghere2018-06-111-4/+23
| | | | | | | | | | Before Pavel's change in r334181, we were printing too many global variables. This patch updates the test suite to ensure we don't regress again in the future. rdar://problem/29180927 llvm-svn: 334454
* Add a new SBTarget::LoadCore() overload which surfaces errors if the load failsLeonard Mosescu2018-06-111-0/+18
| | | | | | | | | | | | | There was no way to find out what's wrong if SBProcess SBTarget::LoadCore(const char *core_file) failed. Additionally, the implementation was unconditionally setting sb_process, so it wasn't even possible to check if the return SBProcess is valid. This change adds a new overload which surfaces the errors and also returns a valid SBProcess only if the core load succeeds: SBProcess SBTarget::LoadCore(const char *core_file, SBError &error); Differential Revision: https://reviews.llvm.org/D48049 llvm-svn: 334439
* Fix tuple getter in std unique pointer pretty-printerPavel Labath2018-06-112-0/+16
| | | | | | | | | | | | | Summary: Check case when _M_t child member is not present. Reviewers: labath, tberghammer Reviewed By: labath, tberghammer Differential Revision: https://reviews.llvm.org/D47932 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com>. llvm-svn: 334411
* [lldb-mi] Re-implement MI -exec-step command.Alexander Polyakov2018-06-101-2/+2
| | | | | | | | | | | | | | Summary: Now -exec-step uses SB API instead of HandleCommand hack. Reviewers: aprantl, clayborg, labath, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47838 llvm-svn: 334364
* Fix TestMiExec.pyPavel Labath2018-06-081-2/+2
| | | | | | | r334215 changed the error message the tool prints for invalid thread arguments to -exec-next command. This adjust the test to match that. llvm-svn: 334279
* [lit, windows] Disable a number of tests that are failing on WindowsStella Stamenova2018-06-0719-0/+37
| | | | | | | | | | | | | | Summary: They all correspond to bugs that are already logged and I've added the appropriate (or most appropriate) bug numbers. This leaves only a handful of failing tests. Reviewers: asmith, zturner, labath Reviewed By: zturner Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D47892 llvm-svn: 334210
* dotest: make inline tests compatible with -fPavel Labath2018-06-051-54/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is split off from D47265 where I needed to be able to invoke every test with -f. That patch is kinda dead now, but this part seems like a good cleanup anyway. The problem with inline tests was in the way we were adding methods to the class, which left them with an incorrect __name__ property. This prevented dotest from finding them with -f. I fix this with (what I think is) the correct way of dynamically creating classes -- passing the list of methods during type construction instead of fixing up the class afterwards. Among other things this has the advantage of not needing to do anything special for debug info variants. As our test method will be visible to the metaclass, it will automagically do the multiplication for us. Reviewers: JDevlieghere, aprantl, tberghammer Subscribers: eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D47579 llvm-svn: 334009
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-0/+10
| | | | | | OpenBSD python module. llvm-svn: 333889
* [LLDB] Unit tests basic support for OpenBSDDavid Carlier2018-06-041-15/+19
| | | | | | | | | | | | Add OpenBSD python module in order to support unit tests. Reviewers: labath, zturner Reviewed By: labath Differential Revision: https://reviews.llvm.org/D47692 llvm-svn: 333888
* Fix silly error introduced after testing in r333813.James Y Knight2018-06-021-7/+0
| | | | | | Oops. llvm-svn: 333816
* Fix support for distinguishing archive members by timestamp on Darwin.James Y Knight2018-06-025-0/+129
| | | | | | | | | | | | | | | | | | | On Darwin, the binary's symbol table points to debug info in object files -- potentially object files within a static library. Such a library may have multiple entries with the same name, distinguished only by timestamp. The code was already _attempting_ to handle this case (see the code in ObjectContainerBSDArchive::Archive::FindObject which disambiguates via timestamp). But, unfortunately, while the timestamp was taken into account on the _first_ lookup, the result was then cached in a map keyed only off of the path. Added the timestamp to the cache, and added a test case. Differential Revision: https://reviews.llvm.org/D47660 llvm-svn: 333813
* Fix Module::FindTypes to return the correct number of matches.Frederic Riss2018-06-014-0/+41
| | | | | | | | | | | | | | | | | | | | | | In r331719, I changed Module::FindTypes not to limit the amount of types returned by the Symbol provider, because we want all possible matches to be able to filter them. In one code path, the filtering was applied to the TypeList without changing the number of types that gets returned. This is turn could cause consumers to access beyond the end of the TypeList. This patch fixes this case and also adds an assertion to TypeList::GetTypeAtIndex to catch those obvious programming mistakes. Triggering the condition in which we performed the incorrect access was not easy. It happened a lot in mixed Swift/ObjectiveC code, but I was able to trigger it in pure Objective C++ although in a contrieved way. rdar://problem/40254997 llvm-svn: 333786
* Remove the TestSequenceFunctions "example" testPavel Labath2018-05-311-34/+0
| | | | | | | | This test was using unittest (not unittest2) as the test framework, and it worked with dotest only by accident. Remove it as we have a much more realistic example test in test/testcases/sample_test. llvm-svn: 333640
* @skipUnlessDarwin TestOrderedSetPavel Labath2018-05-301-0/+1
| | | | llvm-svn: 333526
* [ObjC] Add a Makefile for the test added in r333465.Davide Italiano2018-05-291-0/+6
| | | | | | | | | Not strictly necessary, but makes the test more robust in case we end up changing the defaults. <rdar://problem/40622096> llvm-svn: 333466
* [ObjC] Fix the formatter for NSOrderedSet.Davide Italiano2018-05-292-0/+25
| | | | | | | | While I'm here, delete some dead code. <rdar://problem/40622096> llvm-svn: 333465
* XFAIL TestMachCore for windows hostsPavel Labath2018-05-291-0/+1
| | | | | | | | It's been failing since I enabled the test for non-darwin targets. I made it reference the same bug as the linux core, as it's likely that the root cause is the same. llvm-svn: 333401
* Typo fixes.Bruce Mitchener2018-05-297-9/+9
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* NFC: Fix some comment typos.Bob Wilson2018-05-281-1/+1
| | | | llvm-svn: 333364
* Enable ProcessMachCore plugin on non-apple platformsPavel Labath2018-05-222-2/+0
| | | | | | | | | | | | | | | | | | | Summary: The plugin already builds fine on other platforms (linux, at least). All that was necessary was to revitalize the hack in PlatformDarwinKernel (not a very pretty hack, but it gets us going at least). I haven't done a thorough investigation of the state of the plugin on other platforms, but at least the two core file tests we have seem to pass, so I enable them. Reviewers: JDevlieghere, jasonmolenda Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D47133 llvm-svn: 332997
* Fix _NSCFBoolean data formatter.Jonas Devlieghere2018-05-181-2/+4
| | | | | | | | | | | | | In r265181 the test for the NSCFBoolean data formatter was removed. Later, in r279353 and r279446 a new implementation was provided for the formatter, which I believe never worked (and this wasn't caught because the test was never re-enabled). This commit fixes the bug and re-enables the old test case. Differential revision: https://reviews.llvm.org/D47014 llvm-svn: 332700
* [lit, lldbsuite] Disable tests that are failing because of pr21765 and pr24489Stella Stamenova2018-05-173-0/+3
| | | | | | | | | | | | | | Summary: These three tests are failing on Windows and looking into the failures, they could be mapped to pr21765 and pr24489 Reviewers: asmith, labath, zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47018 llvm-svn: 332629
* [lit] Fix several tests that fail when using Python 3 or on WindowsStella Stamenova2018-05-142-6/+16
| | | | | | | | | | | | | | | | Summary: 1) In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately 2) Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead Reviewers: asmith, labath, zturner Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46773 llvm-svn: 332293
* Revert "[LLDB] Support GNU-style compressed debug sections (.zdebug)"Davide Italiano2018-05-123-66/+0
| | | | | | | | | | This reverts commit r332162 as it breaks the bots (Ubuntu 14.04) with the following message: Build Command Output: objcopy: option '--compress-debug-sections' doesn't allow an argument llvm-svn: 332165
* [LLDB] Support GNU-style compressed debug sections (.zdebug)Davide Italiano2018-05-123-0/+66
| | | | | | | | Patch by Erik Welander! Differential Revision: https://reviews.llvm.org/D45628 llvm-svn: 332162
* [lit, lldbsuite] Add a bug reference to the failing TestLinuxCore and fix an ↵Stella Stamenova2018-05-092-12/+12
| | | | | | | | | | | | | | | | | | undefined property in dotest.py Summary: 1) In TestLinuxCore rather than skipping the tests on Windows, mark them as expected failures and add a bug reference 2) In dotest.py replace the undefined property in the exceptions with the actual property causing the exception Reviewers: asmith, labath, zturner Reviewed By: labath, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46590 llvm-svn: 331886
* [test] Re-enable TestUnicodeSymbolsJonas Devlieghere2018-05-081-1/+0
| | | | | | | | Re-enable TestUnicodeSymbols now that we use the in-tree dsymutil. This was disabled because the hashing of unicode symbols was out of sync between llvm (dsymutil) and lldb. llvm-svn: 331764
OpenPOWER on IntegriCloud