summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-06635-13635/+23752
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Revert "Intel(R) Memory Protection Extensions (Intel(R) MPX) support."Dimitar Vlahovski2016-09-067-156/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit rL280668 because the register tests fail on i386 Linux. I investigated a little bit what causes the failure - there are missing registers when running 'register read -a'. This is the output I got at the bottom: """ ... Memory Protection Extensions: bnd0 = {0x0000000000000000 0x0000000000000000} bnd1 = {0x0000000000000000 0x0000000000000000} bnd2 = {0x0000000000000000 0x0000000000000000} bnd3 = {0x0000000000000000 0x0000000000000000} unknown: 2 registers were unavailable. """ Also looking at the packets exchanged between the client and server: """ ... history[308] tid=0x7338 < 19> send packet: $qRegisterInfo4a#d7 history[309] tid=0x7338 < 130> read packet: $name:bnd0;bitsize:128;offset:1032;encoding:vector;format:vector-uint64;set:Memory Protection Extensions;ehframe:101;dwarf:101;#48 history[310] tid=0x7338 < 19> send packet: $qRegisterInfo4b#d8 history[311] tid=0x7338 < 130> read packet: $name:bnd1;bitsize:128;offset:1048;encoding:vector;format:vector-uint64;set:Memory Protection Extensions;ehframe:102;dwarf:102;#52 history[312] tid=0x7338 < 19> send packet: $qRegisterInfo4c#d9 history[313] tid=0x7338 < 130> read packet: $name:bnd2;bitsize:128;offset:1064;encoding:vector;format:vector-uint64;set:Memory Protection Extensions;ehframe:103;dwarf:103;#53 history[314] tid=0x7338 < 19> send packet: $qRegisterInfo4d#da history[315] tid=0x7338 < 130> read packet: $name:bnd3;bitsize:128;offset:1080;encoding:vector;format:vector-uint64;set:Memory Protection Extensions;ehframe:104;dwarf:104;#54 history[316] tid=0x7338 < 19> send packet: $qRegisterInfo4e#db history[317] tid=0x7338 < 76> read packet: $name:bndcfgu;bitsize:64;offset:1096;encoding:vector;format:vector-uint8;#99 history[318] tid=0x7338 < 19> send packet: $qRegisterInfo4f#dc history[319] tid=0x7338 < 78> read packet: $name:bndstatus;bitsize:64;offset:1104;encoding:vector;format:vector-uint8;#8e ... """ The bndcfgu and bndstatus registers don't have the 'Memory Protections Extension' set. I looked at the code and it seems that that is set correctly. So I'm not sure what's the problem or where does it come from. Also there is a second failure related to something like this in the tests: """ registerSet.GetName().lower() """ For some reason the registerSet.GetName() returns None. llvm-svn: 280703
* Added the "frame diagnose" command and use its output to make crash info better.Sean Callanan2016-09-0627-0/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a process stops due to a crash, we get the crashing instruction and the crashing memory location (if there is one). From the user's perspective it is often unclear what the reason for the crash is in a symbolic sense. To address this, I have added new fuctionality to StackFrame to parse the disassembly and reconstruct the sequence of dereferneces and offsets that were applied to a known variable (or fuction retrn value) to obtain the invalid pointer. This makes use of enhancements in the disassembler, as well as new information provided by the DWARF expression infrastructure, and is exposed through a "frame diagnose" command. It is also used to provide symbolic information, when available, in the event of a crash. The algorithm is very rudimentary, and it needs a bunch of work, including - better parsing for assembly, preferably with help from LLVM - support for non-Apple platforms - cleanup of the algorithm core, preferably to make it all work in terms of Operands instead of register/offset pairs - improvement of the GetExpressioPath() logic to make prettier expression paths, and - better handling of vtables. I welcome all suggestios, improvements, and testcases. llvm-svn: 280692
* remove dependence of TestGdbRemoteExitCode.py on parent directory sourceTodd Fiala2016-09-053-4/+391
| | | | | | | | | | | | As Pavel pointed out in a comment on llvm.org/pr30271, the VPATH I was using here to eliminate duplication of a .cpp file had a side effect of attempting to pull in a .o/.obj file from that same parent dir, where other tests can be running in parallel. This is no good. For now, I have removed the VPATH, which should address llvm.org/pr30271. I have also removed the XFAIL. llvm-svn: 280675
* Intel(R) Memory Protection Extensions (Intel(R) MPX) support.Valentina Giusti2016-09-057-4/+156
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The Intel(R) Memory Protection Extensions (Intel(R) MPX) associates pointers to bounds, against which the software can check memory references to prevent out of bound memory access. This patch allows accessing the MPX registers: * bnd0-3: 128-bit registers to hold the bound values, * bndcfgu, bndstatus: 64-bit configuration registers, This patch also adds read/write tests for the MPX registers in the register command tests and adds a new subdirectory for MPX specific tests. Signed-off-by: Valentina Giusti <valentina.giusti@intel.com> Reviewers: labath, granata.enrico, lldb-commits, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24187 llvm-svn: 280668
* Add default_packet_timeout key to the new TestGdbRemoteHostInfo testPavel Labath2016-09-051-1/+2
| | | | | | android targets use this key, so the test should recognize it. llvm-svn: 280652
* XFAIL TestGdbRemoteExitCode failing testsTodd Fiala2016-09-041-0/+2
| | | | | | | Tracked by: llvm.org/pr30271 llvm-svn: 280606
* [NFC] Darwin llgs support from Week of CodeTodd Fiala2016-09-047-96/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code represents the Week of Code work I did on bringing up lldb-server LLGS support for Darwin. It does not include the Xcode project changes needed, as we don't want to throw that switch until more support is implemented (i.e. this change is inert, no build systems use it yet. I've verified on Ubuntu 16.04, macOS Xcode and macOS cmake builds). This change does some minimal refactoring of code that is shared with the Linux LLGS portion, moving it from NativeProcessLinux into NativeProcessProtocol. That code is also used by NativeProcessDarwin. Current state on Darwin: * Process launching is implemented. (Attach is not). Launching on devices has not yet been tested (FBS/BKS might need a bit of work). * Inferior waitpid monitoring and communication of exit status via MainLoop callback is implemented. * Memory read/write, breakpoints, thread register context, etc. are not yet implemented. This impacts process stop/resume, as the initial launch suspended immediately starts the process up and running because it doesn't know it is supposed to remain stopped. * I implemented the equivalent of MachThreadList as NativeThreadListDarwin, in anticipation that we might want to factor out common parts into NativeThreadList{Protocol} and share some code here. After writing it, though, the fallout from merging Mach Task/Process into a single concept plus some other minor changes makes the whole NativeThreadListDarwin concept nothing more than dead weight. I am likely going to get rid of this class and just manage it directly in NativeProcessDarwin, much like I did for NativeProcessLinux. * There is a stub-out call for starting a STDIO thread. That will go away and adopt the MainLoop pselect-based IOObject reading. I am developing the fully-integrated changes in the following repo, which contains the necessary Xcode bits and the glue that enables lldb-debugserver on a macOS system: https://github.com/tfiala/lldb/tree/llgs-darwin This change also breaks out a few of the lldb-server tests into their own directory, and adds some $qHostInfo tests (not sure why I didn't write those tests back when I initially implemented that on the Linux side). llvm-svn: 280604
* Reapply "Make Scalar::GetValue more consistent"Pavel Labath2016-09-021-1/+0
| | | | | | | | this is a resubmission of r280476. The problem with the original commit was that it was printing out all numbers as signed, which was wrong for unsigned numbers with the MSB set. Fix that and add a unit test covering that case. llvm-svn: 280480
* Revert "Make Scalar::GetValue more consistent"Pavel Labath2016-09-021-0/+1
| | | | | | | This reverts commit r280476 as it breaks several tests on i386. I was fixing an 32-bit breakage, and I did not run the 32-bit test suite before submitting, oops. llvm-svn: 280478
* Bump up TestCallWithTimeout timeoutPavel Labath2016-09-021-2/+2
| | | | | | Still a bit flaky on remote targets. Trying a larger bump this time. :/ llvm-svn: 280477
* Make Scalar::GetValue more consistentPavel Labath2016-09-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: It seems the original intention of the function was printing signed values in decimal format, and unsigned values in hex (without the leading "0x"). However, signed and unsigned long were exchanged, which lead to amusing test failures in TestMemoryFind.py. Instead of just switching the two, I think we should just print everything in decimal here, as the current behaviour is very confusing (especially when one does not request printing of types). Nothing seems to depend on this behaviour except and we already have a way for the user to request the format he wants when printing values for most commands (which presumably does not go through this function). I also add a unit tests for the function in question. Reviewers: clayborg, granata.enrico Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24126 llvm-svn: 280476
* Change the formula for tagged NSIndexPath data formattingEnrico Granata2016-09-013-0/+110
| | | | | | Fixes rdar://25192935 llvm-svn: 280389
* XFail TestMemoryFind on 32-bit architecturesPavel Labath2016-09-011-0/+2
| | | | | | | | the test fails for a very prosaic reason: `(const char *)0x1000` returns "4096" on x86_64 and "1000" (without the "0x") on i386. I haven't tried other 32-bit arches, but I am guessing the behaviour is the same. XFAIL until someone can get a chance to look at this. llvm-svn: 280344
* Change "memory find" over to using a variation of the Boyer–Moore search ↵Enrico Granata2016-09-013-0/+81
| | | | | | | | algorithm Fixes rdar://15455621 (and adds a test case for this command which - surprisingly and sadly - was not there originally) llvm-svn: 280327
* Add a data formatter for std::function in libcxxEnrico Granata2016-08-313-0/+80
| | | | llvm-svn: 280295
* Fix an issue where a synthetic child provider could only provide a value of ↵Enrico Granata2016-08-312-2/+22
| | | | | | the same size as the containing type llvm-svn: 280294
* Fixup TestPyObjSynthProvider.py and enable it againPavel Labath2016-08-312-1/+2
| | | | | | | | | | | | | | | Summary: - copies the new file in the cmake build - adds an additional import statement - marks the test as no-debug-info specific, as it seems to be testing a python feature Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24074 llvm-svn: 280261
* XFail new TestPyObjSynthProvider.py on linux until I can investigate the ↵Pavel Labath2016-08-311-0/+1
| | | | | | cause of the problem llvm-svn: 280208
* Rename the test classEnrico Granata2016-08-301-1/+1
| | | | llvm-svn: 280173
* Add an helper class lldb.formatters.synth.PythonObjectSyntheticChildProviderEnrico Granata2016-08-304-0/+95
| | | | | | | | This class enables one to easily write a synthetic child provider by writing a class that returns pairs of names and primitive Python values - the base class then converts those into LLDB SBValues Comes with a test case llvm-svn: 280172
* This test now succeeds.Jim Ingham2016-08-271-1/+0
| | | | llvm-svn: 279897
* Don't crash when trying to capture persistent variables in a block.Sean Callanan2016-08-261-1/+3
| | | | | | | | | Reports an error instead. We can fix this later to make persistent variables work, but right now we hit an LLVM assertion if we get this wrong. <rdar://problem/27770298> llvm-svn: 279850
* Make all the Function implementations different so the compiler won't share ↵Jim Ingham2016-08-262-56/+54
| | | | | | | | | | | | | | them. Clang on ARM64 was making the three Function methods with identical bodies have one implementation that was shared. That threw off the count of breakpoints, since we don't count as separate locations three functions with the same address. I also cleaned up the test case while I was at it. <rdar://problem/27001915> llvm-svn: 279800
* fix darwin_log test errors on macOS < 10.12Todd Fiala2016-08-241-0/+9
| | | | | | | | The newer event-based tests I added neglected to do the macOS 10.12 check in the setup. This caused earlier macOS test suite runs to attempt to compile code that doesn't exist. llvm-svn: 279672
* Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_statePavel Labath2016-08-231-0/+5
| | | | | | | The test was attempting to backtrace a process after every state change event (including the "running", and "restarted" ones), which is not a good idea. llvm-svn: 279512
* Remove a test that depends on knowing all compiler's register allocation ↵Jim Ingham2016-08-191-23/+0
| | | | | | | | | | | schemes. This test was using a condition that would compare a variable against the register that would hold it. It was failing with clang on arm64 because clang put the variable on the stack. This is not a supportable way to write tests. llvm-svn: 279345
* Fixing a Darwing test thats failing on windowsDimitar Vlahovski2016-08-191-1/+1
| | | | | | | The pexpect import should be make after the skip-if-not-darwin part because pexpect is not available on Windows llvm-svn: 279234
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1944-0/+2721
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-1944-2721/+0
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1944-0/+2721
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* Fix tests for the gdb-remote memory read packetsPavel Labath2016-08-182-47/+11
| | | | | | | | Part of TestGDBRemoteMemoryRead has been disabled since r259379 because it was incompatible with python3. This changes the test to use the lldb-server test framework, which is a more appropriate method of testing raw stub behaviour anyway (and should avoid the whole python 3 issue). llvm-svn: 279039
* Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPYOmair Javaid2016-08-171-22/+27
| | | | | | Differential revision: https://reviews.llvm.org/D20386 llvm-svn: 278947
* Fix expression evaluation with operator newPavel Labath2016-08-152-4/+54
| | | | | | | | | | | | | | | | Summary: referencing a user-defined operator new was triggering an assert in clang because we were registering the function name as string "operator new", instead of using the special operator enum, which clang has for this purpose. Method operators already had code to handle this, and now I extend this to cover free standing operator functions as well. Test included. Reviewers: spyffe Subscribers: sivachandra, paulherman, lldb-commits Differential Revision: http://reviews.llvm.org/D17856 llvm-svn: 278670
* Disable TestThreadSpecificBpPlusCondition on Windows.Zachary Turner2016-08-121-1/+1
| | | | | | Test frequently times out stalling the test runner. llvm-svn: 278529
* Skip 2 android test what is broken because of debuggerdTamas Berghammer2016-08-122-7/+2
| | | | | | | | | debuggerd is a crash reporting system on android what installs some signal handler for SEGV to print a backtrace in the log. Its behavior breaks tests where the test tries to continue after a SEGV so we skip them as this behavior isn't required on android anyway. llvm-svn: 278510
* XFAIL TestNamespaceDefinitions on gcc-4.8 and belowPavel Labath2016-08-121-0/+2
| | | | llvm-svn: 278491
* Make TestCallStopAndContinue clang-format-resilientPavel Labath2016-08-122-3/+2
| | | | llvm-svn: 278490
* Make sure LldbGdbServerTestCase is built in arm mode to avoid failures due ↵Omair Javaid2016-08-112-3/+11
| | | | | | | | thumb instructions Differential revision: https://reviews.llvm.org/D23395 llvm-svn: 278326
* xfailed TestObjCNewSyntax.py on macOS for gmodulesTodd Fiala2016-08-101-0/+1
| | | | | | | Tracked by: rdar://27792848 llvm-svn: 278289
* Undid LLVM macro usage in test suite test subject files.Todd Fiala2016-08-103-18/+18
| | | | llvm-svn: 278197
* Delete Host/windows/win32.hZachary Turner2016-08-094-18/+24
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Errors compiling breakpoint conditions will cause the breakpoint not to be hitJim Ingham2016-08-031-0/+44
| | | | | | | | | This was a shadowed variable error from the big Expression Parser plugin-ification. I also added a test case for this. <rdar://problem/27682376> llvm-svn: 277662
* Revert rL277429: Correct makefile.rules to use toolchain specific AR and OBJCOPYOmair Javaid2016-08-021-17/+18
| | | | | | | | | | This commit is causing problems on gcc-* compiler with version number sufix. Requires a new solution will post a follow up patch. Differential revision: https://reviews.llvm.org/D20386 llvm-svn: 277453
* Correct makefile.rules to use toolchain specific AR and OBJCOPYOmair Javaid2016-08-021-18/+17
| | | | | | Differential revision: https://reviews.llvm.org/D20386 llvm-svn: 277429
* Add/fix support for i386 elf core filesDimitar Vlahovski2016-07-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There were places in the code, assuming(hardcoding) offsets and types that were only valid for the x86_64 elf core file format. The NT_PRSTATUS and NT_PRPSINFO structures are with the 64 bit layout. I have reused them and parse i386 files manually, and fill them in the same struct. Also added some error handling during parsing that checks if the available bytes in the buffer are enough to fill the structures. The i386 core file test case now passes. For reference on the structures layout, I generally used the source of binutils (bfd, readelf) Bug: https://llvm.org/bugs/show_bug.cgi?id=26947 Reviewers: labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22917 llvm-svn: 277140
* Fix -break-insert not working when using absolute paths (MI)Ilia K2016-07-291-1/+0
| | | | | | | | | | | | | | Summary: When trying to parse the -break-insert arguments as a named location, the string parsing was not configured to allow directory paths. This patch adds a constructor to allow the parsing of string as directory path along with the other parameters. This fixes https://llvm.org/bugs/show_bug.cgi?id=28709 Patch from malaperle@gmail.com Reviewers: clayborg, ki.stfu Subscribers: lldb-commits, ki.stfu Differential Revision: https://reviews.llvm.org/D22902 llvm-svn: 277117
* Fixed "void SBWatchpoint::SetEnabled (bool enabled)" to work properly and ↵Greg Clayton2016-07-271-5/+11
| | | | | | | | | added a test for it. https://llvm.org/bugs/show_bug.cgi?id=28729 <rdar://problem/27575225> llvm-svn: 276914
* Print a warning if the directory passed to --test-subdir doesn't end up existingEnrico Granata2016-07-251-0/+2
| | | | llvm-svn: 276709
* Breakup TestConcurrentEvents.py into separate test subdirs per test methodTodd Fiala2016-07-2272-526/+1339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change breaks up the monolithic TestConcurrentEvents.py into a separate subdir per test method. This allows them to run concurrently, reduces the chance of a timeout occurring during normal operation, and allows us to home in on any test methods that may be locking up. This is step one in the process of squashing timeouts in these test methods. The reason for breaking each test method into its own file is to make it very clear to us if there are a subset of the tests that do in fact lock up frequently. This will limit how much hunting we need to do to recreate it. The reason for putting each file in a separate subdirectory is so that our concurrent test runner can run multiple test files at the same time. The unit of serialization in the LLDB test suite is the test directory, so moving them into separate directories enables the test runner to do more at the same time. This change introduces usage of VPATH from gnu make. I use that to facilitate keeping a single copy of the main.cpp in the parent concurrent_events directory. Initially I had tried specifying the source file as ../main.cpp, but our current makefile rules get confused by that and then also build the output into the parent directory, which defeats the ability to run each of the test methods concurrently. In the event that not all systems support VPATH, I can do a bit of surgery on the Makefile rules and attempt to make it smarter with regards to relative paths to source files used in the build. llvm-svn: 276478
OpenPOWER on IntegriCloud