summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix windows build broken by r347846Pavel Labath2018-11-291-1/+0
| | | | | | | | | The changed order of includes caused compile errors on MSVC due to snprintf macro definition. snprintf should available since VS2015, and the rest of the code seems to be able to use snprintf just fine without this macro, so this removes it from the lldb driver as well. llvm-svn: 347855
* Remove getopt includes from the driverPavel Labath2018-11-292-13/+0
| | | | | | | | | | | | | They are not needed now that we use LLVMOption for command-line parsing thank you, Jonas). This also allows us to avoid linking of lldbHost into the driver which was breaking liblldb encapsulation. (Technically, there is still a lldb/Host/windows/windows.h include which is needed on windows, but this is a header-only wrapper for <windows.h>, so it is not necessary to link lldbHost for that. But ideally, that should go away too.) llvm-svn: 347846
* [LLDB] - Fix setting the breakpoints when -gsplit-dwarf and DWARF 5 were ↵George Rimar2018-11-294-4/+140
| | | | | | | | | | | | | | | | used for building the executable. The issue happens because starting from DWARF v5 DW_AT_addr_base attribute should be used instead of DW_AT_GNU_addr_base. LLDB does not do that and we end up reading the .debug_addr header as section content (as addresses) instead of skipping it and reading the real addresses. Then LLDB is unable to match 2 similar locations and thinks they are different. Differential revision: https://reviews.llvm.org/D54751 llvm-svn: 347842
* [driver] Fix --core/-c and add testJonas Devlieghere2018-11-294-50/+52
| | | | | | | | | | | Because the optarg variable was shadowed we didn't notice we weren't extracting the value from the option. This patch fixes that and renames the variable to prevent this from happening in the future. I also added two tests to check the error output for --core and --file when the given value doesn't exist. llvm-svn: 347821
* [driver] Some NFC cleanupJonas Devlieghere2018-11-282-30/+33
| | | | | | | This patch includes some small things I noticed while refactoring the driver but didn't want to include in that patch. llvm-svn: 347817
* Make standalone build find tabelgenJonas Devlieghere2018-11-281-0/+1
| | | | | | | The standalone build couldn't find tablegen because we didn't include it. This patch rectifies that. llvm-svn: 347814
* [lldb] Add GetCurrentException APIs to SBThread, add frame recognizer for ↵Kuba Mracek2018-11-2812-10/+187
| | | | | | | | | | | | | | objc_exception_throw for Obj-C runtimes This adds new APIs and a command to deal with exceptions (mostly Obj-C exceptions): SBThread and Thread get GetCurrentException API, which returns an SBValue/ValueObjectSP with the current exception for a thread. "Current" means an exception that is currently being thrown, caught or otherwise processed. In this patch, we only know about the exception when in objc_exception_throw, but subsequent patches will expand this (and add GetCurrentExceptionBacktrace, which will return an SBThread/ThreadSP containing a historical thread backtrace retrieved from the exception object. Currently unimplemented, subsequent patches will implement this). Extracting the exception from objc_exception_throw is implemented by adding a frame recognizer. This also add a new sub-command "thread exception", which prints the current exception. Differential Revision: https://reviews.llvm.org/D43886 llvm-svn: 347813
* [unittests] Fix the File System Test on WindowsStella Stamenova2018-11-281-8/+0
| | | | | | Two of the file system tests are failing on Windows - this updates them to expect the correct values after the refactor of the file system code. llvm-svn: 347796
* Revert r347673 "Catch up with EvaluateAsInt() clang API change."Hans Wennborg2018-11-281-5/+6
| | | | | | r347417 was re-committed in Clang. llvm-svn: 347758
* [unittest] Fix the FileSystem test on Windows. (Attempt #2)Jonas Devlieghere2018-11-281-5/+5
| | | | | | | This fixes the double escaping and compares FileSpecs instead of strings. llvm-svn: 347725
* Remove dead code from IOHandlerAlex Langford2018-11-271-4/+0
| | | | | | This has been dead since 2014 according to the blame llvm-svn: 347721
* [lldbsuite] Each lldb suite test must have a unique class nameStella Stamenova2018-11-272-2/+2
| | | | | | A couple of new tests have been added that use existing class names. This causes failures on Windows if the tests run at the same time and on any platform it results in the logs being overwritten. llvm-svn: 347717
* [Reproducers] Improve reproducer API and add unit tests.Jonas Devlieghere2018-11-2712-137/+283
| | | | | | | | | | | | | | | | | | | When I landed the initial reproducer framework I knew there were some things that needed improvement. Rather than bundling it with a patch that adds more functionality I split it off into this patch. I also think the API is stable enough to add unit testing, which is included in this patch as well. Other improvements include: - Refactor how we initialize the loader and generator. - Improve naming consistency: capture and replay seems the least ambiguous. - Index providers by name and make sure there's only one of each. - Add convenience methods for creating and accessing providers. Differential revision: https://reviews.llvm.org/D54616 llvm-svn: 347716
* [unittest] Fix the FileSystem test on Windows.Jonas Devlieghere2018-11-271-0/+8
| | | | | | | | On Windows, when using the VFS without going through FileSpec, the absolute path to `/foo` is `\\foo`. This updates the unittest to expect that. llvm-svn: 347712
* [Driver] Use libOption with tablegen.Jonas Devlieghere2018-11-2711-648/+661
| | | | | | | | | | | | | This patch modifies the lldb driver to use libOption for option parsing. It allows us to decouple option parsing from option processing which is important when arguments affect initialization. This was previously not possible because the debugger need to be initialized as some option interpretation (like the scripting language etc) was handled by the debugger, rather than in the driver. Differential revision: https://reviews.llvm.org/D54692 llvm-svn: 347709
* [CMake] Pass full libedit path to linkerTatyana Krasnukha2018-11-272-2/+2
| | | | | | Otherwise, linker fails with "cannot find -ledit" in case of custom libedit installation. llvm-svn: 347693
* Catch up with EvaluateAsInt() clang API change.Davide Italiano2018-11-271-6/+5
| | | | llvm-svn: 347673
* Move time cast to SymbolFileDWARFDebugMapJonas Devlieghere2018-11-273-23/+12
| | | | | | | | | When trying to fix the bots we expected that the cast would be needed in different places. Ultimately it turned out only the SymbolFileDWARFDebugMap was affected so, as Pavel correctly notes, it makes more sense to do the cast just there instead of in teh FS. llvm-svn: 347660
* Add support for the Dylan language to ClangASTContextBruce Mitchener2018-11-271-1/+3
| | | | | | | | | | | | | | | | | | | Summary: This change adds eLanguageTypeDylan to the set of languages supported by ClangASTContext. Debug info generated by the Open Dylan compiler's LLVM back-end was designed to be compatible with C debug info. Patch by Peter Housel. Reviewers: clayborg Reviewed By: clayborg Subscribers: brucem, lldb-commits, aprantl Differential Revision: https://reviews.llvm.org/D54886 llvm-svn: 347637
* 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
OpenPOWER on IntegriCloud