summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[CMake] Streamline code signing for debugserver and pass ↵Davide Italiano2018-11-276-122/+74
| | | | | | | | entitlements to extended llvm_codesign" It breaks the lldb cmake bots. llvm-svn: 347619
* [FileSystem] Ignore nanoseconds when comparing oso_mod_timeJonas Devlieghere2018-11-263-7/+19
| | | | | | | | | | | After a recent change in LLVM the TimePoint encoding become more precise, exceeding the precision of the TimePoint obtained from the DebugMap. This patch adds a flag to the GetModificationTime helper in the FileSystem to return the modification time with less precision. Thanks to Davide for bisecting this failure on the LLDB bots. llvm-svn: 347615
* [lit] Fully qualify lit_config to avoid runtime crashes.Davide Italiano2018-11-261-1/+1
| | | | llvm-svn: 347579
* [Cmake] Add missing dependency to `count`.Davide Italiano2018-11-261-0/+1
| | | | llvm-svn: 347578
* [ASTImporter] Set MustBuildLookupTable on PrimaryContextGabor Marton2018-11-261-1/+1
| | | | | | | | | | | | Summary: SetMustBuildLookupTable() must always be called on a primary context. Reviewers: labath, shafik, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411 Differential Revision: https://reviews.llvm.org/D54863 llvm-svn: 347575
* Revert r347491 as it's llvm counterpart breaks buildbotsLuke Cheeseman2018-11-232-3/+3
| | | | llvm-svn: 347500
* Revert r343342 together with LLVM commit 347490.Luke Cheeseman2018-11-232-3/+3
| | | | llvm-svn: 347491
* Update call to EvaluateAsInt() to the new syntax.Bill Wendling2018-11-211-5/+6
| | | | llvm-svn: 347418
* [lit] Add pthread to the compilation of the tests on LinuxStella Stamenova2018-11-211-1/+1
| | | | | | | | | | | | Summary: Right now only some platforms add pthread to the compilation, however, at least one of the tests requires the pthread library on Linux as well. Since the library is available, this change adds it by default on Linux. Reviewers: labath, zturner, asmith Subscribers: stella.stamenova, jfb, lldb-commits Differential Revision: https://reviews.llvm.org/D54808 llvm-svn: 347412
* Revert 347365, its prerequisite 347364 got reverted.Nico Weber2018-11-211-6/+5
| | | | llvm-svn: 347391
* Update call to EvaluateAsInt() to the new syntax.Bill Wendling2018-11-201-5/+6
| | | | llvm-svn: 347365
* [lit] Build and link TestIRMemoryMapWindows explicitlyStella Stamenova2018-11-201-1/+2
| | | | | | If we just invoke clang-cl without specifying the linker, the tests fail on Windows because they cannot find the correct linker to use, so it needs to be specified explicitly llvm-svn: 347323
* [lit] Disable the stop hook tests on WindowsStella Stamenova2018-11-202-0/+2
| | | | | | These tests are not able to pass on Windows as written as they don't even build llvm-svn: 347321
* [CMake] Streamline code signing for debugserver and pass entitlements to ↵Stefan Granitz2018-11-206-74/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extended llvm_codesign Summary: Use llvm_codesign to sign debugserver with entitlements. Set global LLVM_CODESIGNING_IDENTITY from LLDB_CODESIGN_IDENTITY (if given). Pass through ENTITLEMENTS from add_lldb_executable to add_llvm_executable. Handle reconfigurations correctly. We have a lot of cases, make them explicit: (1) build and sign debugserver, if all conditions apply: * LLDB_NO_DEBUGSERVER=OFF (default) * On Darwin: LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default) * On Darwin: LLVM_CODESIGNING_IDENTITY == lldb_codesign (2) use system debugserver, if on Darwin and any of: * LLDB_USE_SYSTEM_DEBUGSERVER=ON and found on system (explicit case) * LLVM_CODESIGNING_IDENTITY != lldb_codesign and found on system (fallback case) (3) debugserver will not be available, in case of: * LLDB_NO_DEBUGSERVER=ON * On Darwin: LLVM_CODESIGNING_IDENTITY != lldb_codesign and not found on system (4) error state, in case of: * LLDB_USE_SYSTEM_DEBUGSERVER=ON and not found on system * LLDB_USE_SYSTEM_DEBUGSERVER=ON and LLDB_NO_DEBUGSERVER=ON Reviewers: xiaobai, beanz, vsk, JDevlieghere Subscribers: mgorny, lldb-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D54476 llvm-svn: 347305
* Skip TestTargetCreateDepsJonas Devlieghere2018-11-201-1/+1
| | | | | | Skip this test because Windows deals differently with shared libraries. llvm-svn: 347283
* Fix clang test suite on Windows by reverting part of r347216Reid Kleckner2018-11-191-0/+1
| | | | | | | | | | | Otherwise, the clang analyzer tests fail on Windows when attempting to unpickle AnalyzerTest objects in the worker processes. The pattern of, add to path, import, remove from path, serialize, deserialize, doesn't work. Once something gets added to the path, if we want to move it across the wire for multiprocessing, we need to keep the module on sys.path. llvm-svn: 347254
* [lldbsuite] Invoke sed on Windows to determine the cache dir for clangStella Stamenova2018-11-191-30/+31
| | | | | | | | | | | | Summary: In order to invoke sed on Windows, we need to quote the command correctly. Since we already have commands which do that, move the definitions at the beginning of the file and then re-use them for each command. Reviewers: aprantl, zturner Subscribers: teemperor, lldb-commits Differential Revision: https://reviews.llvm.org/D54709 llvm-svn: 347243
* [lit] On Windows, don't error if MSVC is not in PATH.Zachary Turner2018-11-191-2/+4
| | | | | | | We had some logic backwards, and as a result if MSVC was not found in PATH we would throw a string concatenation exception. llvm-svn: 347224
* Remove non-ASCII characters at the beginning of file.Zachary Turner2018-11-191-1/+1
| | | | | | It's not clear how these ended up in the file, but this fixes it. llvm-svn: 347223
* Fix some issues with LLDB's lit configuration files.Zachary Turner2018-11-1970-189/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently I tried to port LLDB's lit configuration files over to use a on the surface, but broke some cases that weren't broken before and also exposed some additional problems with the old approach that we were just getting lucky with. When we set up a lit environment, the goal is to make it as hermetic as possible. We should not be relying on PATH and enabling the use of arbitrary shell commands. Instead, only whitelisted commands should be allowed. These are, generally speaking, the lit builtins such as echo, cd, etc, as well as anything for which substitutions have been explicitly set up for. These substitutions should map to the build output directory, but in some cases it's useful to be able to override this (for example to point to an installed tools directory). This is, of course, how it's supposed to work. What was actually happening is that we were bringing in PATH and LD_LIBRARY_PATH and then just running the given run line as a shell command. This led to problems such as finding the wrong version of clang-cl on PATH since it wasn't even a substitution, and flakiness / non-determinism since the environment the tests were running in would change per-machine. On the other hand, it also made other things possible. For example, we had some tests that were explicitly running cl.exe and link.exe instead of clang-cl and lld-link and the only reason it worked at all is because it was finding them on PATH. Unfortunately we can't entirely get rid of these tests, because they support a few things in debug info that clang-cl and lld-link don't (notably, the LF_UDT_MOD_SRC_LINE record which makes some of the tests fail. The high level changes introduced in this patch are: 1. Removal of functionality - The lit test suite no longer respects LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. This means there is no more support for gcc, but nobody was using this anyway (note: The functionality is still there for the dotest suite, just not the lit test suite). There is no longer a single substitution %cxx and %cc which maps to <arbitrary-compiler>, you now explicitly specify the compiler with a substitution like %clang or %clangxx or %clang_cl. We can revisit this in the future when someone needs gcc. 2. Introduction of the LLDB_LIT_TOOLS_DIR directory. This does in spirit what LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER used to do, but now more friendly. If this is not specified, all tools are expected to be the just-built tools. If it is specified, the tools which are not themselves being tested but are being used to construct and run checks (e.g. clang, FileCheck, llvm-mc, etc) will be searched for in this directory first, then the build output directory. 3. Changes to core llvm lit files. The use_lld() and use_clang() functions were introduced long ago in anticipation of using them in lldb, but since they were never actually used anywhere but their respective problems, there were some issues to be resolved regarding generality and ability to use them outside their project. 4. Changes to .test files - These are all just replacing things like clang-cl with %clang_cl and %cxx with %clangxx, etc. 5. Changes to lit.cfg.py - Previously we would load up some system environment variables and then add some new things to them. Then do a bunch of work building out our own substitutions. First, we delete the system environment variable code, making the environment hermetic. Then, we refactor the substitution logic into two separate helper functions, one which sets up substitutions for the tools we want to test (which must come from the build output directory), and another which sets up substitutions for support tools (like compilers, etc). 6. New substitutions for MSVC -- Previously we relied on location of MSVC by bringing in the entire parent's PATH and letting subprocess.Popen just run the command line. Now we set up real substitutions that should have the same effect. We use PATH to find them, and then look for INCLUDE and LIB to construct a substitution command line with appropriate /I and /LIBPATH: arguments. The nice thing about this is that it opens the door to having separate %msvc-cl32 and %msvc-cl64 substitutions, rather than only requiring the user to run vcvars first. Because we can deduce the path to 32-bit libraries from 64-bit library directories, and vice versa. Without these substitutions this would have been impossible. Differential Revision: https://reviews.llvm.org/D54567 llvm-svn: 347216
* Don't use -O in lit tests.Zachary Turner2018-11-197-17/+21
| | | | | | | | | | Because of different shell quoting rules, and the fact that LLDB commands often contain spaces, -O is not portable for writing command lines. Instead, we should use explicit lldbinit files. Differential Revision: https://reviews.llvm.org/D54680 llvm-svn: 347213
* Remove unused variable. NFC.Benjamin Kramer2018-11-191-1/+0
| | | | llvm-svn: 347188
* Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD"Zachary Turner2018-11-187-147/+4
| | | | | | | This breaks many tests on Windows, which now all fail with an error such as "Unable to read memory at address <xxxxxxxx>". llvm-svn: 347174
* Just don't even attempt to invoke sed on Windows.Adrian Prantl2018-11-171-0/+5
| | | | llvm-svn: 347125
* Revert "Makefile.rules: Fix the windows-sed-quoting issue harder."Adrian Prantl2018-11-171-11/+11
| | | | llvm-svn: 347124
* add PdbSymUid.cppJason Molenda2018-11-171-0/+4
| | | | llvm-svn: 347122
* Makefile.rules: Fix the windows-sed-quoting issue harder.Adrian Prantl2018-11-171-9/+11
| | | | llvm-svn: 347120
* Make TestAppleSimulatorOSType.py more flexibleFrederic Riss2018-11-171-1/+7
| | | | | | Different versions of Xcode have different outputs for the simctl command llvm-svn: 347117
* Add missing triple from llvm-mc command line.Zachary Turner2018-11-171-1/+1
| | | | llvm-svn: 347114
* Rewrite stop-hook tests as a couple of FileCheck testsFrederic Riss2018-11-169-322/+120
| | | | | | | | Those tests were using pexpect and being flaky on some of ours bots. This patch reimplmeents the tests usinf FileCheck, and it also extends the test coverage to a few more stop-hook options. llvm-svn: 347109
* Makefile.rules: Degrade gracefully on Windows machines without sed.Adrian Prantl2018-11-161-6/+3
| | | | llvm-svn: 347104
* [Cocoa] Prefer llvm::SignExtend64. Pointed out by zturner.Davide Italiano2018-11-161-2/+1
| | | | llvm-svn: 347087
* [SymbolFile] Remove unused function. NFCI.Davide Italiano2018-11-161-18/+0
| | | | llvm-svn: 347084
* Make path more robust so it also works with out-of-tree builds.Adrian Prantl2018-11-161-1/+3
| | | | llvm-svn: 347071
* TypoAdrian Prantl2018-11-161-1/+1
| | | | llvm-svn: 347058
* Use a shared module cache directory for LLDB.Adrian Prantl2018-11-162-3/+4
| | | | | | | | | | | | | This saves about 3 redundant gigabytes from the Objective-C test build directories. Tests that must do unsavory things with the LLDB clang module cache, already specify a per-test module cache in their .py test instructions. <rdar://problem/36002081> Differential Revision: https://reviews.llvm.org/D54602 llvm-svn: 347057
* Makefile.rules: Use a shared clang module cache directory.Adrian Prantl2018-11-162-2/+19
| | | | | | | | | | | | | | | Just to be safe, up until now each test used its own Clang module cache directory. Since the compiler within one testsuite doesn't change it is just as safe to share a clang module directory inside the LLDB test build directory. This saves us from compiling tens of gigabytes of redundant Darwin and Foundation .pcm files and also speeds up running the test suite quite significantly. rdar://problem/36002081 Differential Revision: https://reviews.llvm.org/D54601 llvm-svn: 347056
* [lldb] NFC: Remove the extra ';'Henry Wong2018-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Remove extra `;` to eliminate the following pedantic warning. ``` warning: extra ';' [-Wpedantic] ``` Reviewers: shafik Reviewed By: shafik Subscribers: abidh, lldb-commits Differential Revision: https://reviews.llvm.org/D54528 llvm-svn: 347047
* Don't use uniform initialization syntax.Zachary Turner2018-11-163-11/+21
| | | | llvm-svn: 347020
* [NativePDB] Rewrite the PdbSymUid to use our own custom namespacing scheme.Zachary Turner2018-11-1613-411/+435
| | | | | | | | | | | | | | | | | | | | | | | Originally we created our 64-bit UID scheme by using the first byte as sort of a "tag" to represent what kind of symbol this was, and we re-used the PDB_SymType enumeration for this. For native pdb support, this is not really the right abstraction layer, because what we really want is something that tells us *how* to find the symbol. This means, specifically, is in the globals stream / public stream / module stream / TPI stream / etc, and for whichever one it is in, where is it within that stream? A good example of why the old namespacing scheme was insufficient is that it is more or less impossible to create a uid for a field list member of a class/struction/union/enum that tells you how to locate the original record. With this new scheme, the first byte is no longer a PDB_SymType enum but a new enum created specifically to identify where in the PDB this record lives. This gives us much better flexibility in what kinds of symbols the uids can identify. llvm-svn: 347018
* Fix compilation failure in unit tests on Windows.Zachary Turner2018-11-151-0/+5
| | | | llvm-svn: 346999
* Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLDNathan Lanza2018-11-157-4/+147
| | | | | | | | | | | | | | | Summary: This commit implements basic DidAttach and DidLaunch for the windows DynamicLoader plugin which allow us to load shared libraries from the inferior. Reviewers: sas, zturner Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D54544 llvm-svn: 346994
* Force SHELL to be cmd.exe on Windows for the test suiteNathan Lanza2018-11-151-0/+11
| | | | | | | | | | | | | | | | Summary: Windows make will search for other shells and choose those over cmd if available (e.g. C:\cygdrive\bin\sh.exe). This shell has numerous issues with path handling (/ vs \\ vs \ and C:). So default to using cmd.exe which is known to work. Reviewers: zturner, sas, xiaobai Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D54510 llvm-svn: 346993
* A unit test file moved.Jason Molenda2018-11-151-4/+4
| | | | llvm-svn: 346991
* Add a check whether or not a str is utf8 prior to emplacingNathan Lanza2018-11-154-40/+65
| | | | | | | | | | | | | | | | | | | Summary: Highlighing junk data on VSCode can send a query for evaluate which fails. In particular cases on Windows, this the error message can end up as a c-string of [-35,-35,-35,-35,...]. Attempting to emplace this as the error message causes an assert failure. Prior to emplacing the error message, confirm that it is valid UTF8 to eliminate errors such as mentione above. Reviewers: xiaobai, clayborg Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D53008 llvm-svn: 346988
* Port the Darwin universal binary testcase to x86_64.Adrian Prantl2018-11-152-61/+57
| | | | | | | | | Xcode 10 doesn't ship with an i386 SDK any more. This patch ports the testcase from an i386/x86_64 -> x86_64/x86_64h universal binary. rdar://problem/46099343 llvm-svn: 346981
* Fix a use-after-free of the ABI plugin.Zachary Turner2018-11-151-8/+9
| | | | | | | | | | | This was introduced in r346775. Previously the ABI shared_ptr was declared as a function local static meaning it would live forever. After the change, someone has to create a strong reference to it or it will go away. In this code, we were calling ABI::FindPlugin(...).get(), so it was being immediately destroyed and we were holding onto a dangling pointer. llvm-svn: 346932
* Fix copy/paste mistake for r346919.Jonas Devlieghere2018-11-151-1/+1
| | | | llvm-svn: 346921
* Add setting to require hardware breakpoints.Jonas Devlieghere2018-11-1541-234/+666
| | | | | | | | | | | | | | | | When debugging read-only memory we cannot use software breakpoint. We already have support for hardware breakpoints and users can specify them with `-H`. However, there's no option to force LLDB to use hardware breakpoints internally, for example while stepping. This patch adds a setting target.require-hardware-breakpoint that forces LLDB to always use hardware breakpoints. Because hardware breakpoints are a limited resource and can fail to resolve, this patch also extends error handling in thread plans, where breakpoints are used for stepping. Differential revision: https://reviews.llvm.org/D54221 llvm-svn: 346920
* [reproducer] Post-commit cleanupJonas Devlieghere2018-11-153-8/+14
| | | | | | | | | After committing the initial reproducer feature I noticed a few small issues which warranted addressing here. It fixes incorrect documentation in the command object and extract some duplicated code into the debugger object. llvm-svn: 346919
OpenPOWER on IntegriCloud