summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/c
Commit message (Collapse)AuthorAgeFilesLines
...
* Split TestGlobalVariables into two and xfail one of them for arm64 linuxPavel Labath2018-05-011-10/+23
| | | | | | | | | | | | | | Displaying of global pointer variables is not working on arm64 linux (pr37301). I've moved this part into a separate test, so it can be xfailed separately. I then move the "show-variables-with-process-available" check before the "show-all-variables" command to presrve the intent of checking that global variable caching works correctly. (I've verified that the new arrangement still fails when I revert the fix from r331230.) llvm-svn: 331250
* Remove premature caching of the global variables list in CompileUnit.Adrian Prantl2018-04-302-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where (lldb) target var g_ptr would populate the global variables list with exactly one entry because SymbolFileDWARF::ParseVariables() was invoked with a list of DIEs pre-filtered by name, such that a subsequent call to (lldb) fr var --show-globals would only list that one variable, because CompileUnit::m_variables was already initialized, fooling CompileUnit::GetVariableList(). CompileUnit::GetVariableList() grabs the *complete* list of variables via (SymbolFileDWARF, ...)::ParseVariablesForContext and that still calls CompileUnit::SetVariableList(variables) which acts as the caching mechanism. Differential Revision: https://reviews.llvm.org/D46220 llvm-svn: 331230
* [test] Replace some references to Apple-internal bugsVedant Kumar2018-03-132-3/+3
| | | | | | | This removes around 10 references to Apple-internal radars. I've filed fresh bugs on bugs.llvm.org as appropriate for open issues. llvm-svn: 327463
* [test] Skip a test which sporadically fails in its dsym variantVedant Kumar2018-03-091-0/+2
| | | | | | | | There is a mailing list discussion re: r325927 about why this test fails in the dsym variant. I've marked it skipped for now, until the issue is resolved. llvm-svn: 327089
* Adapt some tests to work with PPC64le architecturePavel Labath2018-02-281-1/+1
| | | | | | | | | | | | | | | Summary: Merge branch 'master' into adaptPPC64tests Reviewers: clayborg, alexandreyy, labath Reviewed By: clayborg, alexandreyy Subscribers: luporl, lbianc, alexandreyy, lldb-commits Differential Revision: https://reviews.llvm.org/D42917 Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>. llvm-svn: 326369
* Add a sanity check for inline testcases.Adrian Prantl2018-02-261-0/+1
| | | | | | | | | | | When writing an inline test, there is no way to make sure that any of the inline commands are actually executed, so this patch adds a sanity check that at least one breakpoint was hit. This avoids a test with no breakpoints being hit passing. Differential Revision: https://reviews.llvm.org/D43694 llvm-svn: 326140
* Partial fix for TestConflictingSymbol.py on WindowsAdrian McCarthy2018-02-263-4/+4
| | | | | | | | | | | | | | | | | Without this fix, the test ERRORs because the link of the inferior fails. This patch adds the LLDB_TEST_API macro where needed and uses the new -2 magic value for num_expected_locations to account for lazy-loading of module symbols on Windows. With this fix, the test itself still fails: conflicting_symbol isn't in the debug info nor the export table, and Windows binaries don't have an equivalent of the ELF .symtab. We need to understand why the test works to keep the symbol out of the debug info. In the mean time, having the test fail at this point is a better indication of the remaining problem than a build error. Differential Revision: https://reviews.llvm.org/D43688 llvm-svn: 326130
* Fix tabs/spaces indentation problem in TestUnicodeSymbols.pyAdrian McCarthy2018-02-261-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43705 llvm-svn: 326095
* Replace HashStringUsingDJB with llvm::djbHashPavel Labath2018-02-233-0/+30
| | | | | | | | | | | | | | | | | | | | | | Summary: The llvm function is equivalent to this one. Where possible I tried to replace const char* with llvm::StringRef to avoid extra strlen computations. In most places, I was able to track the c string back to the ConstString it was created from. I also create a test that verifies we are able to lookup names with unicode characters, as a bug in the llvm compiler (it accidentally used a different hash function) meant this was not working until recently. This also removes the unused ExportTable class. Reviewers: aprantl, davide Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43596 llvm-svn: 325927
* Only throw -fPIC when building a shared libraryAaron Smith2018-02-085-7/+0
| | | | | | | | | | | | | | | | | | Summary: Update makefiles to specify -fPIC in Makefile.rules and only throw -fPIC when building a shared library. This change is necessary to allow building the lldb tests on Windows where -fPIC is not a valid option. Update a few places to Python 3.x syntax Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: stella.stamenova, labath, llvm-commits Differential Revision: https://reviews.llvm.org/D42994 llvm-svn: 324671
* Compile the LLDB tests out-of-tree.Adrian Prantl2018-01-306-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of a discussion on lldb-dev, see http://lists.llvm.org/pipermail/lldb-dev/2018-January/013111.html for background. For each test (should be eventually: each test configuration) a separate build directory is created and we execute make VPATH=$srcdir/path/to/test -C $builddir/path/to/test -f $srcdir/path/to/test/Makefile -I $srcdir/path/to/test In order to make this work all LLDB tests need to be updated to find the executable in the test build directory, since CWD still points at the test's source directory, which is a requirement for unittest2. Although we have done extensive testing, I'm expecting that this first attempt will break a few bots. Please DO NOT HESITATE TO REVERT this patch in order to get the bots green again. We will likely have to iterate on this some more. Differential Revision: https://reviews.llvm.org/D42281 llvm-svn: 323803
* Wrap all references to build artifacts in the LLDB testsuite (NFC)Adrian Prantl2018-01-1923-29/+29
| | | | | | | | | in TestBase::getBuildArtifact(). This NFC commit is in preparation for https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree). Differential Revision: https://reviews.llvm.org/D42280 llvm-svn: 323007
* TestConflictingSymbols: simplify test by using run_break_set_by_source_regexpPavel Labath2018-01-091-14/+8
| | | | | | follow-up to r321271 based on post-commit feedback by Jim Ingham. llvm-svn: 322075
* Work around test failures on red-hat linuxPavel Labath2017-12-211-6/+39
| | | | | | | | | | | | | | | | Two tests were failing because the debugger was picking up multiply defined internal symbols from the system libraries. This is a bug, as there should be no ambiguity because the tests are defining variables with should shadow these symbols, but lldb is not smart enough to figure that out. I work around the issue by renaming the variables in these tests, and in exchange I create a self-contained test which reproduces the issue without depending on the system libraries. This increases the predictability of our test suite. llvm-svn: 321271
* [testsuite] Un-XFAIL the global variables tests.Davide Italiano2017-12-171-6/+0
| | | | | | | | <rdar://problem/28725399> Differential Revision: https://reviews.llvm.org/D41312 llvm-svn: 320952
* Disable tests in lang/c/shared_lib on WindowsStephane Sezer2017-11-071-0/+3
| | | | | | | | | | | | | | Summary: These fail because `-fPIC` is not supported on Windows. Reviewers: zturner, jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39692 llvm-svn: 317529
* Remove getCategories mechanism of specifying test categoriesPavel Labath2017-11-023-7/+2
| | | | | | | | | | | | | | | | | | Summary: This mechanism was mostly redundant with the file-based .categories mechanism, and it was interfering with it, as any test which implemented a getCategories method would not inherit the filesystem categories. This patch removes it. The existing categories are preserved either by adding a .categories file, or using the @add_test_categories decorator. Reviewers: jingham, clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39515 llvm-svn: 317277
* Initial patchset to get the testsuite running against armv7 and arm64 iOS ↵Jason Molenda2017-09-252-2/+4
| | | | | | | | | | | | | | | | | | | | | | | devices. Normal customer devices won't be able to run these tests, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures. I have seen some instability with the armv7 test runs, I may submit additional patches to address this. arm64 looks good. I'll be watching the bots for the rest of today; if any problems are introduced by this patch I'll revert it - if anyone sees a problem with their bot that I don't see, please do the same. I know it's a rather large patch. One change I had to make specifically for iOS devices was that debugserver can't create files. There were several tests that launch the inferior process redirecting its output to a file, then they retrieve the file. They were not trying to test file redirection in these tests, so I rewrote those to write their output to a file directly. llvm-svn: 314132
* Revert "Initial patchset to get the testsuite running against armv7 and ↵Chris Bieneman2017-09-252-4/+2
| | | | | | | | | | | | | arm64 iOS devices. Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures." This patch has been causing LLDB test failures on ObjC tests. A test log may still be available here: http://lab.llvm.org:8080/green/view/LLDB/job/lldb/1650/ This reverts commit r314038. llvm-svn: 314122
* Initial patchset to get the testsuite running against armv7 and arm64 iOS ↵Jason Molenda2017-09-222-2/+4
| | | | | | | | | | | | | | | | | | | | | | | devices. Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures. I have seen some instability with the armv7 test runs, I may submit additional patches to address this. arm64 looks good. I'll be watching the bots for the rest of today; if any problems are introduced by this patch I'll revert it - if anyone sees a problem with their bot that I don't see, please do the same. I know it's a rather large patch. One change I had to make specifically for iOS devices was that debugserver can't create files. There were several tests that launch the inferior process redirecting its output to a file, then they retrieve the file. They were not trying to test file redirection in these tests, so I rewrote those to write their output to a file directly. llvm-svn: 314038
* Revert this patch; I was emailing with Eugene and they have some other ↵Jason Molenda2017-09-212-4/+2
| | | | | | | | | changes going in today and don't want the two changes to confuse the situation with the build bots. I'll commit tomorrow once they're known good. llvm-svn: 313934
* Initial patchset to get the testsuite running against armv7 and arm64 iOS ↵Jason Molenda2017-09-212-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | devices. Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. There will be some smaller follow-on patches. The changes to tools/lldb-server are verbose and I'm not thrilled with having to skip all of these tests manually. There are a few places where I'm making the assumption that "armv7", "armv7k", "arm64" means it's an ios device, and I need to review & clean these up with an OS check as well. (Android will show up as "arm" and "aarch64" so by pure luck they shouldn't cause problems, but it's not an assumption I want to rely on). I'll be watching the bots for the rest of today; if any problems are introduced by this patch I'll revert it - if anyone sees a problem with their bot that I don't see, please do the same. I know it's a rather large patch. One change I had to make specifically for iOS devices was that debugserver can't create files. There were several tests that launch the inferior process redirecting its output to a file, then they retrieve the file. They were not trying to test file redirection in these tests, so I rewrote those to write their output to a file directly. llvm-svn: 313932
* [LLDB][MIPS] Fix TestRegisterVariables.py.Nitesh Jain2017-06-141-1/+1
| | | | | | | | | Clang does not accept regparm attribute on these platforms. Fortunately, the default calling convention passes arguments in registers any way Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 305378
* Make TestConflictingSymbol run on non-darwin targetsPavel Labath2017-05-171-7/+11
| | | | | | | | | | | For remote targets we need to call registerSharedLibrariesWithTarget to make sure they are installed alongside main executable. This also required a small fixup in the the mentioned function as in this case "One" was both a directory name and a library name template. I fixed it to make sure it checks that the string refers to a file before it assumed it was a full library path. llvm-svn: 303248
* [Expression parser] Look up module symbols before hunting globallySean Callanan2017-05-1611-0/+161
| | | | | | | | | | | | | | | | | | | When it resolves symbol-only variables, the expression parser currently looks only in the global module list. It should prefer the current module. I've fixed that behavior by making it search the current module first, and only search globally if it finds nothing. I've also added a test case. After review, I moved the core of the lookup algorithm into SymbolContext for use by other code that needs it. Thanks to Greg Clayton and Pavel Labath for their help. Differential Revision: https://reviews.llvm.org/D33083 llvm-svn: 303223
* 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
* [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
* 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
* 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
* Fix TestRegisterVariables for linux arm/arm64 gcc ver > 5Omair Javaid2017-01-131-1/+1
| | | | | | | | | We are going to turn off buffer overflow introduced by gcc by turning off FORTIFY_SOURCE. Differential revision: https://reviews.llvm.org/D28666 llvm-svn: 291949
* XFAIL TestRegisterVariables on gcc-4.8-x86_64Pavel Labath2017-01-101-0/+2
| | | | | | | I have previously enabled this test for this configuration. However, it turns out it only passes for gcc-4.9. llvm-svn: 291563
* Enable TestBitfields on linux with clangPavel Labath2016-11-241-7/+0
| | | | | | The test has been passing for a while now. llvm-svn: 287884
* Enable TestRegisterVariables for some configurationsPavel Labath2016-11-241-5/+2
| | | | | | It consistently passes for linux-clang-i386, and linux-gcc-x86_64. llvm-svn: 287883
* Un-XFail test on Windows. Has been in "unexpected success" mode for a while.Adrian McCarthy2016-11-101-2/+0
| | | | llvm-svn: 286476
* Added a decorator for the macOS version and switched over testcases that ↵Sean Callanan2016-10-201-3/+1
| | | | | | used platform.release llvm-svn: 284674
* Remove a debug print statement.Jim Ingham2016-10-181-1/+0
| | | | llvm-svn: 284448
* Added a radar on our end for this test's failure.Jim Ingham2016-10-111-1/+1
| | | | llvm-svn: 283956
* Add some logging when trace is on. We're getting a bot failure on i386 that ↵Jim Ingham2016-09-291-8/+15
| | | | | | | | doesn't I can't reproduce locally. Hopefully this will help us catch the reason. llvm-svn: 282810
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0623-534/+909
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* 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
* Join TestTlsGlobal tests again and use the proper decoratorPavel Labath2016-07-041-12/+2
| | | | llvm-svn: 274490
* Fixed thread local storage test case to run normally with no expected fail ↵Greg Clayton2016-07-011-2/+12
| | | | | | for Darwin, always skip on windows, and expected fail for all other OSs while mentioning the new bug I filed to track fixing TLS variables: https://llvm.org/bugs/show_bug.cgi?id=28392 llvm-svn: 274393
* Thread local storage was already broken on Linux and the tests were passing ↵Greg Clayton2016-07-011-0/+1
| | | | | | | | | | | because there was a dectorator: @unittest2.expectedFailure("rdar://7796742") Which was covering up the fact this was failing on linux and hexagon. I added back a decorator so we don't break any build bots. llvm-svn: 274388
* Added support for thread local variables on all Apple OS variants.Greg Clayton2016-07-013-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had support that assumed that thread local data for a variable could be determined solely from the module in which the variable exists. While this work for linux, it doesn't work for Apple OSs. The DWARF for thread local variables consists of location opcodes that do something like: DW_OP_const8u (x) DW_OP_form_tls_address or DW_OP_const8u (x) DW_OP_GNU_push_tls_address The "x" is allowed to be anything that is needed to determine the location of the variable. For Linux "x" is the offset within the TLS data for a given executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of the data structure that contains a pthread key that can be used with pthread_getspecific() and the offset needed. This fix passes the "x" along to the thread: virtual lldb::addr_t lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr); Then this is passed along to the DynamicLoader::GetThreadLocalData(): virtual lldb::addr_t lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr); This allows each DynamicLoader plug-in do the right thing for the current OS. The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key from the data structure that is in memory and call "void *pthread_getspecific(pthread_key_t key)" to get the value of the thread local storage and it caches it per thread since it never changes. I had to update the test case to access the thread local data before trying to print it as on Apple OS variants, thread locals are not available unless they have been accessed at least one by the current thread. I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so that we can ask SBValue objects for their ValueType and be able to tell when we have a thread local variable. <rdar://problem/23308080> llvm-svn: 274366
* XFAIL tests which fail with gcc on linuxPavel Labath2016-06-291-1/+1
| | | | llvm-svn: 274116
* Enable some tests on linuxPavel Labath2016-06-093-4/+2
| | | | | | | | | This enables a couple of tests which have been shown to run reliably on the linux x86 buildbot. If you see a failure after this commit, feel free to add the xfail back, but please make it as specific as possible (i.e., try to make it not cover i386/x86_64 with clang-3.5, clang-3.9 or gcc-4.9). llvm-svn: 272326
* Revert "Make lldbinline.py regenerate the Makefile each time it builds."Pavel Labath2016-06-071-9/+0
| | | | | | This reverts commit r272024 as it is not windows-compatible. llvm-svn: 272062
* Make lldbinline.py regenerate the Makefile each time it builds.Sean Callanan2016-06-071-0/+9
| | | | | | | | | | | | | If a lldbinline test's source file changed language, then the Makefile wasn't updated. This was a problem if the Makefile was checked into the repository. Now lldbinline.py always regenerates the Makefile and asserts if the newly-generated version is not the same as the one already there. This ensures that the repository will never be out of date without a buildbot failing. http://reviews.llvm.org/D21032 llvm-svn: 272024
* Add "-gmodules" support to the test suite.Todd Fiala2016-05-261-1/+1
| | | | | | | | | | | | | | This change adds the capability of building test inferiors with the -gmodules flag to enable module debug info support. Windows is excluded per @zturner. Reviewers: granata.enrico, aprantl, zturner, labath Subscribers: zturner, labath, lldb-commits Differential Revision: http://reviews.llvm.org/D19998 llvm-svn: 270848
* Mark some aarch64-linux specific xfails marking bug entriesOmair Javaid2016-05-251-0/+1
| | | | | | | | TestBSDArchives.py and TestWatchLocation.py fail due to unicode error and bug has already been reported for arm and macOSx. TestConstVariables.py fails because lldb cant figure out frame variable type when used in expr. llvm-svn: 270780
OpenPOWER on IntegriCloud