summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix segfault resulting from empty print promptPavel Labath2017-05-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce: 1) Launch lldb 2) Type `print` and hit enter. lldb will now prompt you to type a list of expressions, followed by an empty line. 3) Hit enter, indicating the end of your input. 4) Segfault! After some investigation, I've found the issue in Host/common/Editline.cpp. Editline::MoveCursor() relies on m_input_lines not being empty when the `to` argument is CursorPosition::BlockEnd. This scenario, as far as I can tell, occurs in one specific instance: In Editline::EndOrAddLineCommand() when the list of lines being processed contains exactly one string (""). Meeting this condition is fairly simple, I have posted steps to reproduce above. Reviewers: krytarowski, zturner, labath Reviewed By: labath Subscribers: scott.smith, lldb-commits Differential Revision: https://reviews.llvm.org/D32421 Patch by Alex Langford. llvm-svn: 302225
* ABISysV_arm64: compute return value for large vectors correctlyPavel Labath2017-05-051-11/+39
| | | | | | | | | | | | | | | | | | | | | Summary: Arm64 Procedure Call Standard specifies than only vectors up to 16 bytes are stored in v0 (which makes sense, as that's the size of the register). 32-byte vector types are passed as regular structs via x8 pointer. Treat them as such. This fixes TestReturnValue for arm64-clang. I also split the test case into two so I can avoid the if(gcc) line, and annotate each test instead. (It seems the vector type tests fail with gcc only when targetting x86 arches). Reviewers: tberghammer, eugene Subscribers: aemerson, omjavaid, rengolin, srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D32813 llvm-svn: 302220
* [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.Nitesh Jain2017-05-041-5/+4
| | | | | | | | | | Reviewers: jingham, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32168 llvm-svn: 302139
* Don't attempt to use mpx registers on unsupported platformsFrancis Ricci2017-05-032-0/+10
| | | | | | | | | | | | | | Summary: The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient, as this isn't defined for linux kernel versions below 3.19. Reviewers: valentinagiusti, zturner, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32719 llvm-svn: 302027
* Windows fix for TestConflictingDefinition makefilePavel Labath2017-05-031-1/+1
| | | | | | | | | | gnuwin32 rm does not like wildcards that match nothing even if we specify -f (probably because the wildcard expansion happens in-process there). We could use make $(wildcard) here, but it seems safer to explicitly list the files here, just like the normal Makefile.rules does. llvm-svn: 302013
* Fixed a bug where we did not properly use the complete versions of ↵Sean Callanan2017-05-039-0/+134
| | | | | | | | | | Objective-C classes. Also added a test case, thanks to Greg Clayton. <rdar://problem/18913551> llvm-svn: 301993
* Android.rules: set "ar" path correctlyPavel Labath2017-05-021-0/+1
| | | | llvm-svn: 301918
* Provide a mechanism to do some pre-loading of symbols up front.Jim Ingham2017-04-281-4/+17
| | | | | | | | | | | Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
* [LLDB][MIPS] Forgot to add check in commit rl301530Nitesh Jain2017-04-271-2/+4
| | | | | | | Reviewers: ki.stfu, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 301537
* [LLDB][MIPS] Fix TestMiExec.py failure.Nitesh Jain2017-04-271-2/+8
| | | | | | | | | | Reviewers: ki.stfu, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32340 llvm-svn: 301530
* [LLDB][MIPS] Fix typo in TestStepOverWatchpoint.py.Nitesh Jain2017-04-251-1/+1
| | | | | Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 301295
* Name the C++ source files for two tests correctly.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301280
* Fixed two bad Makefiles that might be breaking Linux.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301277
* [Expression parser] Return both types and variablesSean Callanan2017-04-247-2/+98
| | | | | | | | | | | | | | | | | | | | | Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because ClangExpressionDeclMap has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely. This patch removes some of those early exits. In that sense, this patch trades performance (early exit is faster) for correctness. I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong. llvm-svn: 301273
* [DWARF] Fix lookup in the abstract origins of inlined blocks/functionsSean Callanan2017-04-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLDB uses clang::DeclContexts for lookups, and variables get put into the DeclContext for their abstract origin. (The abstract origin is a DWARF pointer that indicates the unique definition of inlined code.) When the expression parser is looking for variables, it locates the DeclContext for the current context. This needs to be done carefully, though, e.g.: __attribute__ ((always_inline)) void f(int a) { { int b = a * 2; } } void g() { f(3); } Here, if we're stopped in the inlined copy of f, we have to find the DeclContext corresponding to the definition of f – its abstract origin. Clang doesn't allow multiple functions with the same name and arguments to exist. It also means that any variables we see must be placed in the appropriate DeclContext. [Bug 1]: When stopped in an inline block, the function GetDeclContextDIEContainingDIE for that block doesn't properly construct a DeclContext for the abstract origin for inlined subroutines. That means we get duplicated function DeclContexts, but function arguments only get put in the abstract origin's DeclContext, and as a result when we try to look for them in nested contexts they aren't found. [Bug 2]: When stopped in an inline block, the DWARF (for space reasons) doesn't explicitly point to the abstract origin for that block. This means that the function GetClangDeclContextForDIE returns a different DeclContext for each place the block is inlined. However, any variables defined in the block have abstract origins, so they will only get placed in the DeclContext for their abstract origin. In this fix, I've introduced a test covering both of these issues, and fixed them. Bug 1 could be resolved simply by making sure we look up the abstract origin for inlined functions when looking up their DeclContexts on behalf of nested blocks. For Bug 2, I've implemented an algorithm that makes the DeclContext for a block be the containing DeclContext for the closest entity we would find during lookup that has an abstract origin pointer. That means that in the following situation: { // block 1 int a; { // block 2 int b; } } if we looked up the DeclContext for block 2, we'd find the block containing the abstract origin of b, and lookup would proceed correctly because we'd see b and a. However, in the situation { // block 1 int a; { // block 2 } } since there isn't anything to look up in block 2, we can't determine its abstract origin (and there is no such pointer in the DWARF for blocks). However, we can walk up the parent chain and find a, and its abstract origin lives in the abstract origin of block 1. So we simply say that the DeclContext for block 2 is the same as the DeclContext for block 1, which contains a. Lookups will return the same results. Thanks to Jim Ingham for review and suggestions. Differential revision: https://reviews.llvm.org/D32375 llvm-svn: 301263
* Update two android XFAILSPavel Labath2017-04-242-2/+2
| | | | | | | - XFAIL on TestNoreturnUnwind on all architectures - TestStaticVariables fails with clang-3.8 as well llvm-svn: 301186
* Skip TestLibCxxAtomic with gccPavel Labath2017-04-201-0/+1
| | | | | | | older versions of libc++ (still used on some linux systems) are not compatible with gcc. llvm-svn: 300837
* Recompute ArchSpec core after MergeFromPavel Labath2017-04-203-10/+0
| | | | | | | | | | | | | | | | | | Summary: MergeFrom was updating the architecture if the target triple did not have it set. However, it was leaving the core field as invalid. This resulted in assertion failures in core file tests as a missing core meant we were unable to compute the address byte size properly. Add a unit test for the new behaviour. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32221 llvm-svn: 300836
* Make TestStaticVariables XFAIL more specificPavel Labath2017-04-201-6/+5
| | | | | | | | The test fails because an older clang did not emit the required debug info (I am not sure when this got added, but clang-3.7 certainly did not work yet). The actual platform has nothing to do with this. llvm-svn: 300834
* Add libc++ category the three more testsPavel Labath2017-04-203-48/+103
| | | | | | | | I thought my previous commit got the last ones but somehow I missed these. This also resurrects TestDataFormatterLibcxxSet, which got commented out in r263859 as a part of some seemingly unrelated change. llvm-svn: 300833
* Fix !N and !-N commands and add a test case.Jim Ingham2017-04-191-0/+45
| | | | | | <rdar://problem/31713267> llvm-svn: 300785
* Fix TestRegisterVariables for clang/armPavel Labath2017-04-191-2/+11
| | | | | | | | Clang rejects __attribute__((regparm)) when targetting arm. The default calling convention passes arguments in registers anyway, so we can just remove them in this case. llvm-svn: 300670
* Add back code to implement "frame var -a,-l,-g" filters.Jim Ingham2017-04-183-0/+116
| | | | | | | | | | r285226 dropped the code that did these checks. I am pretty sure that was inadvertent, so I added that back in and added a test for it. <rdar://problem/31661252> llvm-svn: 300564
* TestStaticVariables still fails on Linux.Jim Ingham2017-04-181-0/+2
| | | | llvm-svn: 300519
* This test is succeeding on macOS with clang.Jim Ingham2017-04-181-6/+1
| | | | llvm-svn: 300517
* Add libc++ category to the remaining libc++ data formattersPavel Labath2017-04-126-75/+76
| | | | llvm-svn: 300054
* Fix TestCppIncompleteTypes for android/clangPavel Labath2017-04-121-2/+2
| | | | | | | LDFLAGS contains some .a files. If it is specified before the relevant object files, undefined symbol errors occur. llvm-svn: 300048
* Fix libc++ vector<bool> data formatter (bug #32553)Pavel Labath2017-04-121-1/+0
| | | | | | | | | | | | | | | | | Summary: The iteration list through the available data formatters was undefined, which meant that the vector<bool> formatter kicked in only in cases where it happened to be queried before the general vector formatter. To fix this, I merge the two data formatter entries into one, and select which implementation to use in the factory function. Reviewers: jasonmolenda, tberghammer, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31880 llvm-svn: 300047
* Fix TestGuessLanguage for gccPavel Labath2017-04-121-1/+7
| | | | | | | | gcc emits DW_LANG_C89 even if we specify -std=c99 during compilation. Since this isn't an lldb bug, but just the way the compiler happens to be implemented, I teach the test to expect this situation correctly. llvm-svn: 300046
* Android.rules: setup correct objcopy pathPavel Labath2017-04-121-4/+12
| | | | | | This fixes a couple of tests when using android clang as a compiler. llvm-svn: 300045
* Teach SBFrame how to guess its language.Jim Ingham2017-04-127-0/+134
| | | | | | <rdar://problem/31411646> llvm-svn: 300012
* Add missing annotation to TestDataFormatterUnorderedPavel Labath2017-04-111-0/+1
| | | | llvm-svn: 299934
* Mark this test as XFAIL on all platforms, it's happening everywhere.Jason Molenda2017-04-071-1/+1
| | | | | | llvm.org/pr32553 and <rdar://problem/30646077> are tracking this. llvm-svn: 299807
* XFAIL TestDataFormatterLibcxxVBool on Linux & AndroidTamas Berghammer2017-04-061-0/+1
| | | | | | | The skipping logic for the test have been fixed recently but the test is very flakey on the buildbot. llvm-svn: 299677
* Annotate some more libc++ tests with the new categoryPavel Labath2017-04-053-29/+20
| | | | | | This makes sure we are able to run them properly on android. llvm-svn: 299588
* The darwin_log tests are very fragile and currently do not properly assess ↵Sean Callanan2017-04-053-2/+4
| | | | | | | | | | the state of that functionality. I have put them all in their own category, and made that category disabled by default. Differential revision: https://reviews.llvm.org/D31718 llvm-svn: 299587
* Enable lldm-mi commands -stack-list-locals -stack-list-variables and ↵Ilia K2017-04-043-0/+106
| | | | | | | | | | | | | | | | -var-create to work only with variables in scope Patch by ayuckhulk Reviewers: abidh, lldb-commits, ki.stfu Reviewed By: ki.stfu Tags: #lldb Differential Revision: https://reviews.llvm.org/D31073 llvm-svn: 299417
* Skip three test cases that are asserting on macosx as of r299199. A quickJason Molenda2017-04-043-0/+10
| | | | | | | | | | | | | | | | | | look showed that the target's arch has no core / byte order and so when AuxVector::AuxVector calls into a dataextractor and sets the byte size to 0, it asserts. e.g. m_arch = { m_triple = (Data = "x86_64--linux", Arch = x86_64, SubArch = NoSubArch, Vendor = UnknownVendor, OS = Linux, Environment = UnknownEnvironment, ObjectFormat = ELF) m_core = kCore_invalid m_byte_order = eByteOrderInvalid m_flags = 0x00000000 m_distribution_id = <no value available> } <rdar://problem/31380097> llvm-svn: 299408
* Add support for sythetic operator dereferenceTamas Berghammer2017-03-311-0/+6
| | | | | | | | | | | | | | | | Summary: After this change a sythetic child provider can generate a special child named "$$dereference$$" what if present is used when "operator*" or "operator->" used on a ValueObject. The goal of the change is to make expressions like "up->foo" work inside the "frame variable" command. Reviewers: labath, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31368 llvm-svn: 299251
* Do not dereference std::unique_ptr by defaultTamas Berghammer2017-03-312-5/+47
| | | | | | | | | | | | | | | Summary: Displaying the object pointed by the unique_ptr can cause an infinite recursion when we have a pointer loop so this change stops that behavior. Additionally it makes the unique_ptr act more like a class containing a pointer (what is the underlying truth) instead of some "magic" class. Reviewers: labath, jingham Differential Revision: https://reviews.llvm.org/D31366 llvm-svn: 299249
* [LLDB][MIPS] Fix Core file Architecture and OS information.Nitesh Jain2017-03-317-0/+16
| | | | | | | | | | Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D31280 llvm-svn: 299199
* Centralize libc++ test skipping logicPavel Labath2017-03-2918-79/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This aims to replace the different decorators we've had on each libc++ test with a single solution. Each libc++ will be assigned to the "libc++" category and a single central piece of code will decide whether we are actually able to run libc++ test in the given configuration by enabling or disabling the category (while giving the user the opportunity to override this). I started this effort because I wanted to get libc++ tests running on android, and none of the existing decorators worked for this use case: - skipIfGcc - incorrect, we can build libc++ executables on android with gcc (in fact, after this, we can now do it on linux as well) - lldbutil.skip_if_library_missing - this checks whether libc++.so is loaded in the proces, which fails in case of a statically linked libc++ (this makes copying executables to the remote target easier to manage). To make this work I needed to split out the pseudo_barrier code from the force-included file, as libc++'s atomic does not play well with gcc on linux, and this made every test fail, even though we need the code only in the threading tests. So far, I am only annotating one of the tests with this category. If this does not break anything, I'll proceed to update the rest. Reviewers: jingham, zturner, EricWF Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D30984 llvm-svn: 299028
* Delete TestLLVM.pyZachary Turner2017-03-221-67/+0
| | | | | | | | | | | | | This was added to workaround a limitation in LLVM's implementation of getting the current user's home directory, since it would only look at the value of $HOME, but we did not want to rely on that being set so we would also look in the password database. Adding the ability to look in the password database to LLVM was a straightforward patch that was submitted in r298513, so since that is done this test is no longer needed. llvm-svn: 298519
* FindTypes should find "struct TypeName" as well as "TypeName".Jim Ingham2017-03-213-0/+95
| | | | | | | | | | This fixes a bug introduced by r291559. The Module's FindType was passing the original name not the basename in the case where it didn't find any separators. I also added a testcase for this. <rdar://problem/31159173> llvm-svn: 298331
* Get ObjectFileMachO to handle @executable_pathJim Ingham2017-03-205-0/+64
| | | | | | | | | Only do this when we are debugging an executable, since we don't have a good way to trace from an ObjectFile back to its containing executable. Detecting pre-run libs before running is "best effort" in lldb, but this one is pretty easy. llvm-svn: 298290
* Fix remote test suite directory creationPavel Labath2017-03-202-27/+33
| | | | | | | | | | | | | | | r298203 make SBPlatform::MakeDirectory less recursive, which breaks the test suite creation of test directory hierarchy creation on the remote target. Since the function was never fully recursive, and the name does not imply recursiveness, I fix the problem by modifying the test runner to do the recursion manually. I also make the runner complain more loudly when it fails to create the directory -- previously it just printed the error to stdout and caused most of the tests to hang, which is not very helpful in diagnosing the problem. llvm-svn: 298261
* allow for specification of compiler/lldb executables basenameTim Hammerquist2017-03-171-0/+4
| | | | llvm-svn: 298123
* executables should be validated before spawning subprocessesTim Hammerquist2017-03-171-2/+14
| | | | | | | | | | | | | | dotest.py script doesn't validate executables passed on the command line before spawning dozens of subprocesses, all of which fail silently, leaving an empty results file. We should validate the lldb and compiler executables on configuration, aborting when given invalid paths, to prevent numerous, cryptic, and spurious failures. <rdar://problem/31117272> llvm-svn: 298111
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-173-0/+69
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Fix TestMoveNearest for remote targetsPavel Labath2017-03-151-1/+2
| | | | | | | Launching a process with shared libraries on remote targets requires a special dance, which I forgot to do in r297830. llvm-svn: 297834
OpenPOWER on IntegriCloud