summaryrefslogtreecommitdiffstats
path: root/lldb/tools
Commit message (Collapse)AuthorAgeFilesLines
* [lldb-server] Prefer target_include_directoriesAlex Langford2020-01-131-2/+1
| | | | | | | In the documentation of `include_directories`, it notes that `target_include_directories` is preferred because it affects specific targets intead of propagating include search paths to the entire project.
* [lldb-server] Remove dead CMake codeAlex Langford2020-01-131-24/+0
| | | | | | No files in lldb-server are including a header from a plugin without the whole path to the header relative to the lldb source directory. There is no need to include the specific directories as a result.
* Save more descriptive error msg from FBS/BKS, relay it up to lldb.Jason Molenda2020-01-081-20/+26
| | | | | | | | | | | | | | | | | | | When lldb requests an app launch through FrontBoard/BackBoard, we get back an NSError object if there was a problem with an integer error code and a descriptive text string. debugserver would log the descriptive text string to the console, but it would only save the error code value, ask for the much-less-specific name of that error code, and send that very generic error word back to lldb. This patch saves the longer description of the failure when available, and sends that to lldb. If unavailable, it falls back to sending up the generic description of the error code as it was doing before. This only impacts the iOS on-device debugserver. <rdar://problem/49953304>
* Rewrite comment about what watchpoints Aarch64 supports.Jason Molenda2020-01-071-21/+29
|
* [lldb][NFC] Use static_cast instead of reinterpret_cast where possibleRaphael Isemann2020-01-073-29/+31
| | | | | | | | | | | | | | Summary: There are a few places in LLDB where we do a `reinterpret_cast` for conversions that we could also do with `static_cast`. This patch moves all this code to `static_cast`. Reviewers: shafik, JDevlieghere, labath Reviewed By: labath Subscribers: arphaman, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72161
* [lldb][NFC] Return a reference from ClangASTContext::getASTContext and ↵Raphael Isemann2019-12-211-4/+2
| | | | | | | | | | | remove dead nullptr checks ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a while that the ASTContext is not a nullptr. This causes that we still have a lot of code that is doing nullptr checks on the result of getASTContext() which is all unreachable code. This patch changes the return value to a reference to make it clear this can't be a nullptr and deletes all the nullptr checks.
* [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHONJonas Devlieghere2019-12-131-2/+2
| | | | | | | This matches the naming scheme used by LLVM and all the other optional dependencies in LLDB. Differential revision: https://reviews.llvm.org/D71482
* [lldb/Host] Use cmakedefine01 for LLDB_ENABLE_POSIXJonas Devlieghere2019-12-131-2/+3
| | | | | Rename LLDB_DISABLE_POSIX to LLDB_ENABLE_POSIX and use cmakedefine01 for consistency.
* The field ‘totalFrames’ which is total number of frames available, is ↵Serhiy Redko2019-12-091-0/+2
| | | | | | | | | | | | mandatory in StackTraces response for VSCode extension that implements DAP and declares capability 'supportsDelayedStackTraceLoading': "The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the 'StackTrace' request are supported." Lack of this field makes VSCode incorrectly display stack traces information D71034
* Upstream debugserver arm64e support.Jason Molenda2019-12-043-4/+117
| | | | | | | | | The changes are minor; primarily debugserver needs to go through accessor functions/macros when changing pc/fp/sp/lr, and debugserver needs to clear any existing pointer auth bits from values in two cases. debugserver can fetch the number of bits used for addressing from a sysctl, and will include that in the qHostInfo reply. Update qHostInfo documentation to document it.
* [lldb/Reproducer] Add version checkJonas Devlieghere2019-12-032-1/+5
| | | | | | | | | | | | | | | | | | | To ensure a reproducer works correctly, the version of LLDB used for capture and replay must match. Right now the reproducer already contains the LLDB version. However, this is purely informative. LLDB will happily replay a reproducer generated with a different version of LLDB, which can cause subtle differences. This patch adds a version check which compares the current LLDB version with the one in the reproducer. If the version doesn't match, LLDB will refuse to replay. It also adds an escape hatch to make it possible to still replay the reproducer without having to mess with the recorded version. This might prove useful when you know two versions of LLDB match, even though the version string doesn't. This behavior is triggered by passing a new flag -reproducer-skip-version-check to the lldb driver. Differential revision: https://reviews.llvm.org/D70934
* [lldb] Remove FileSpec->CompileUnit inheritancePavel Labath2019-11-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: CompileUnit is a complicated class. Having it be implicitly convertible to a FileSpec makes reasoning about it even harder. This patch replaces the inheritance by a simple member and an accessor function. This avoid the need for casting in places where one needed to force a CompileUnit to be treated as a FileSpec, and does not add much verbosity elsewhere. It also fixes a bug where we were wrongly comparing CompileUnit& and a CompileUnit*, which compiled due to a combination of this inheritance and the FileSpec*->FileSpec implicit constructor. Reviewers: teemperor, JDevlieghere, jdoerfert Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D70827
* [lldb] fix a -Wcast-qual warningPavel Labath2019-11-261-1/+1
|
* Register Objective-C property accessors with their property decls.Adrian Prantl2019-11-221-1/+1
| | | | | | | | | | This is a correctness fix for the Clang DWARF parser that primarily matters for swift-lldb's ability to import Clang types that were reconstructed from DWARF into Swift. rdar://problem/55025799 Differential Revision: https://reviews.llvm.org/D70580
* [Driver] Fix newline at the end of help outputJonas Devlieghere2019-11-211-3/+2
| | | | | Print a regular newline at the end of the help output. The current string literal seems to throw off shells.
* [Reproducer] Instruct users to replay reproducerJonas Devlieghere2019-11-211-4/+12
| | | | | | | | | | | | | | | | | | | | Improve the message printed when LLDB crashes by asking the user to replay the reproducer before attaching it to a bugreport.. ******************** Crash reproducer for lldb version 10.0.0 (git@github.com:llvm/llvm-project.git revision ...) clang revision ... llvm revision ... Reproducer written to '/path/to/reproducer' Before attaching the reproducer to a bug report: - Look at the directory to ensure you're willing to share its content. - Make sure the reproducer works by replaying the reproducer. Replay the reproducer with the following command: ./bin/lldb -replay /path/to/reproducer ********************
* [Docs] Generate the LLDB man page with SphinxJonas Devlieghere2019-11-211-1/+3
| | | | | | | | | | | This patch replaces the existing out-of-date man page for lldb and replaces it with an RST file from which sphinx generates the actual troff file. This is similar to how man pages are generated for the rest of the LLVM utilities. The man page is generated by building the `docs-lldb-man` target. Differential revision: https://reviews.llvm.org/D70514
* [Driver] Fix missing space in lldb --help output.Jonas Devlieghere2019-11-201-1/+1
|
* [Reproducer] Generate LLDB reproducer on crashJonas Devlieghere2019-11-201-0/+17
| | | | | | | | | | | | | | | | | | | | This patch hooks the reproducer infrastructure with the signal handlers. When lldb crashes with reproducers capture enabled, it will now generate the reproducer and print a short message the standard out. This doesn't affect the pretty stack traces, which are still printed before. This patch also introduces a new reproducer sub-command that intentionally raises a given signal to test the reproducer signal handling. Currently the signal handler is doing too much work. Instead of copying over files into the reproducers in the signal handler, we should re-invoke ourselves with a special command line flag that looks at the VFS mapping and performs the copy. This is a NO-OP when reproducers are disabled. Differential revision: https://reviews.llvm.org/D70474
* [debugserver] Set arch based on TARGET_TRIPLEVedant Kumar2019-11-201-4/+4
| | | | | | Use TARGET_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE, as the latter isn't exported by LLVMConfig.cmake, which means arch detection fails if lldb is built separately from llvm.
* [LLDB] Fix formatting in the driver (NFC)Jonas Devlieghere2019-11-191-2/+1
|
* [Signal] Allow llvm clients to opt into one-shot SIGPIPE handlingVedant Kumar2019-11-182-21/+2
| | | | | | | | | | | | | | | | | | | | Allow clients of the llvm library to opt-in to one-shot SIGPIPE handling, instead of forcing them to undo llvm's SIGPIPE handler registration (which is brittle). The current behavior is preserved for all llvm-derived tools (except lldb) by means of a default-`true` flag in the InitLLVM constructor. This prevents "IO error" crashes in long-lived processes (lldb is the motivating example) which both a) load llvm as a dynamic library and b) *really* need to ignore SIGPIPE. As llvm signal handlers can be installed when calling into libclang (say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the current model. Differential Revision: https://reviews.llvm.org/D70277
* [lldb] Fix JSON parser to allow empty arraysAlex Cameron2019-11-182-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=39405 ``` alexc@kitty:~/work/wiredtiger/build_posix$ cat breakpoint.json [{"Breakpoint" : {"BKPTOptions" : {"AutoContinue" : false,"ConditionText" : "","EnabledState" : true,"IgnoreCount" : 0,"OneShotState" : false},"BKPTResolver" : {"Options" : {"NameMask" : [56],"Offset" : 0,"SkipPrologue" : true,"SymbolNames" : ["__wt_btcur_search"]},"Type" : "SymbolName"},"Hardware" : false,"SearchFilter" : {"Options" : {},"Type" : "Unconstrained","Foo" : []}}}] ``` **Before** ``` (lldb) breakpoint read --file breakpoint.json error: Invalid JSON from input file: /home/alexc/work/wiredtiger/build_posix/breakpoint.json. ``` **After** ``` (lldb) breakpoint read --file breakpoint.json New breakpoints: Breakpoint 1: where = libwiredtiger-3.2.2.so`__wt_btcur_search + 15 at bt_cursor.c:522:5, address = 0x00007ffff576ab2f ``` Reviewers: xbolva00, davide, labath Reviewed By: davide, labath Subscribers: mgorny, jingham, labath, davide, JDevlieghere, lldb-commits Tags: #llvm, #lldb Differential Revision: https://reviews.llvm.org/D68179
* [lldb-vscode] support the completion requestWalter Erquinigo2019-11-151-1/+148
| | | | | | | | | | | | | | | | Summary: The DAP has a completion request that has been unimplemented. It allows showing autocompletion tokens inside the Debug Console. I implemented it in a very simple fashion mimicking what the user would see when autocompleting an expression inside the CLI. There are two cases: normal variables and commands. The latter occurs when a text is prepepended with ` in the Debug Console. These two cases work well and have tests. Reviewers: clayborg, aadsm Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69873
* [CMake] Configure the Info.plist so it contains a real version number.Jonas Devlieghere2019-11-154-3/+17
| | | | | Use CMake to configure the Info.plist file so that we have a real version number in things like crash reporter.
* [LLDB] Don't install the pretty stack trace handler twice.Jonas Devlieghere2019-11-131-7/+3
| | | | | | | | | I noticed that currently we are printing LLVM's pretty stack trace twice. The reason is that we're calling PrintStackTraceOnErrorSignal in addition to InitLLVM, which besides some other useful things, also register LLVM's pretty stack trace handler. Differential revision: https://reviews.llvm.org/D70216
* [LLDB] Fix a bunch of -Wdocumentation warningsJonas Devlieghere2019-11-131-2/+2
|
* Performance: Add a set of visited SymbolFiles to the other FindFiles variant.Adrian Prantl2019-11-121-1/+1
| | | | | | | | | | | | | | This is basically the same bug as in r260434. SymbolFileDWARF::FindTypes has exponential worst-case when digging through dependency DAG of .pcm files because each object file and .pcm file may depend on an already-visited .pcm file, which may again have dependencies. Fixed here by carrying a set of already visited SymbolFiles around. rdar://problem/56993424 Differential Revision: https://reviews.llvm.org/D70106
* [lldb] Record framework build path and use it everywhereHaibo Huang2019-11-063-6/+3
| | | | This avoids config time dependencies on liblldb. And enables other refactoring.
* DebugServer: be more lenient about the target tripleSaleem Abdulrasool2019-10-301-1/+5
| | | | | | | When building standalone, `LLVM_DEFAULT_TARGET_TRIPLE` may be undefined. Matching against an empty string does not work as desired in CMake, so, fallback to the old behaviour, defaulting `LLDB_DEBUGSERVER_ARCH` to `CMAKE_OSX_ARCHITECTURES`.
* lldb-vscode: Add a forgotten cast to voidPavel Labath2019-10-301-0/+1
| | | | "git push" works even with a dirty working tree. :/
* [lldb-vscod] fix build with NDEBUG on windowsSquallATF2019-10-301-3/+4
| | | | | | | | | | | | | | Summary: _setmode in assert will not run when build with NDEBUG Reviewers: mstorsjo, labath, amccarth Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69612
* build: workaround stale caches (NFC)Saleem Abdulrasool2019-10-291-1/+1
| | | | | | | | `LLVM_DEFAULT_TARGET_TRIPLE` is a cached variable, which means that it may actually be unset. Furthermore, in standalone builds, the variable may be fully undefined. Apply the regular expression over the empty string in such a case. This should improve the state of the green dragon bot.
* [debugserver] Detect arch from LLVM_DEFAULT_TARGET_TRIPLEVedant Kumar2019-10-281-3/+17
| | | | | | | | | | | | | | | | The debugserver build needs to conditionally include files depending on the target architecture. Switch on the architecture specified by LLVM_DEFAULT_TARGET_TRIPLE, as the llvm and swift build systems use this variable to identify the target (the latter, indirectly, through LLVM_HOST_TRIPLE). It would be possible to switch on CMAKE_OSX_ARCHITECTURES, but the swift build does not provide it, preferring instead to pass arch-specific CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option, but it breaks down when cross-compiling. Differential Revision: https://reviews.llvm.org/D69523
* [Driver] Force llvm to install its handlers before lldb'sVedant Kumar2019-10-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | Install llvm's signal handlers up front to prevent lldb's handlers from being ignored. This is (hopefully) a stopgap workaround. When lldb invokes an llvm API that installs signal handlers (e.g. llvm::sys::RemoveFileOnSignal, possibly via a compiler embedded within lldb), lldb's signal handlers are overriden if llvm is installing its handlers for the first time. To work around llvm's behavior, force it to install its handlers up front, and *then* install lldb's handlers. In practice this is used to prevent lldb test processes from exiting due to IO_ERR when SIGPIPE is received. Note that when llvm installs its handlers, it 1) records the old handlers it replaces and 2) re-installs the old handlers when its new handler is invoked. That means that a signal not explicitly handled by lldb can fall back to being handled by llvm's handler the first time it is received, and then by the default handler the second time it is received. Differential Revision: https://reviews.llvm.org/D69403
* Revert "Disable exit-on-SIGPIPE in lldb"Vedant Kumar2019-10-241-10/+0
| | | | | | | This reverts commit 32ce14e55e5a99dd99c3b4fd4bd0ccaaf2948c30. In post-commit review, Pavel pointed out that there's a simpler way to ignore SIGPIPE in lldb that doesn't rely on llvm's handlers.
* Disable exit-on-SIGPIPE in lldbVedant Kumar2019-10-181-0/+10
| | | | | | | | | | | | | | | | | | Occasionally, during test teardown, LLDB writes to a closed pipe. Sometimes the communication is inherently unreliable, so LLDB tries to avoid being killed due to SIGPIPE (it calls `signal(SIGPIPE, SIG_IGN)`). However, LLVM's default SIGPIPE behavior overrides LLDB's, causing it to exit with IO_ERR. Opt LLDB out of the default SIGPIPE behavior. I expect that this will resolve some LLDB test suite flakiness (tests randomly failing with IO_ERR) that we've seen since r344372. rdar://55750240 Differential Revision: https://reviews.llvm.org/D69148 llvm-svn: 375288
* Modernize the rest of the Find.* API (NFC)Adrian Prantl2019-10-171-2/+4
| | | | | | | | | | | | This patch removes the size_t return value and the append parameter from the remainder of the Find.* functions in LLDB's internal API. As in the previous patches, this is motivated by the fact that these parameters aren't really used, and in the case of the append parameter were frequently implemented incorrectly. Differential Revision: https://reviews.llvm.org/D69119 llvm-svn: 375160
* Add arm64_32 support to lldb, an ILP32 codegen Jason Molenda2019-10-162-2/+3
| | | | | | | | | | that runs on arm64 ISA targets, specifically Apple watches. Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 375032
* [lldb-test] Modify lldb-test to print out ASTs from symbol fileShafik Yaghmour2019-10-111-3/+43
| | | | | | | | | | | Summary: Currently when invoking lldb-test symbols -dump-ast it parses all the debug symbols and calls print(...) on the TranslationUnitDecl. While useful the TranslationUnitDecl::print(...) method gives us a higher level view then the dump from ASTDumper which is what we get when we invoke dump() on a specific AST node. The main motivation for this change is allow us to verify that the AST nodes we create when we parse DWARF. For example in order to verify we are correctly using DIFlagExportSymbols added by D66667 Differential Revision: https://reviews.llvm.org/D67994 llvm-svn: 374570
* [LLDB] [lldb-server] Use llvm::InitLLVM for doing unicode conversion of ↵Martin Storsjo2019-10-111-0/+2
| | | | | | | | | | | | | | | | arguments for windows This should allow lldb-server to operate on files with non-ascii pathnames. I tried looking around in lldb/tools, and this seemed like the only other tool (other than the main lldb driver itself) that would be used (implicitly) by an end user (which could be working in non-ascii paths). Differential Revision: https://reviews.llvm.org/D68864 llvm-svn: 374537
* [LLDB] [Driver] Use llvm::InitLLVM to do unicode argument conversion on WindowsMartin Storsjo2019-10-111-17/+3
| | | | | | | | | This avoids the currently MSVC specific codepath of using the wchar entry point and converting that to utf8. Differential Revision: https://reviews.llvm.org/D68770 llvm-svn: 374526
* [lldb-test] Remove unused headerAlex Langford2019-10-101-1/+0
| | | | llvm-svn: 374468
* Change debugserver to use the brk #0 for breakpoints.Jason Molenda2019-10-101-3/+1
| | | | | | | | | | debugserver had been using an instruction that would work for armv7 or aarch64 processes, but we don't have armv7 code running on arm64 devices any more so this is unnecessary. <rdar://problem/56133118> llvm-svn: 374264
* SBFile support in SBCommandReturnObjectLawrence D'Anna2019-10-091-6/+7
| | | | | | | | | | | | | | | | | | Summary: This patch add SBFile interfaces to SBCommandReturnObject, and removes the internal callers of its FILE* interfaces. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68434 llvm-svn: 374238
* [debugserver] Include the correct header.Davide Italiano2019-10-071-1/+1
| | | | | | <rdar://problem/55916729> llvm-svn: 373957
* [debugserver] Don't link against Cocoa, it's not needed.Davide Italiano2019-10-041-2/+0
| | | | | | <rdar://problem/55916729> llvm-svn: 373795
* [lldb] [cmake] Support linking against clang-cpp dylibMichal Gorny2019-10-041-1/+1
| | | | | | | | | Link against clang-cpp dylib rather than split libs when CLANG_LINK_CLANG_DYLIB is enabled. Differential Revision: https://reviews.llvm.org/D68456 llvm-svn: 373734
* [lldb] Fix that 'ninja clean' breaks the build by deleting debugserver_vers.cRaphael Isemann2019-10-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We mark debugserver_vers.c as a generated file in CMake. This means that when we run `ninja clean` we end up deleting that file, but any following `ninja` invocation will fail due to the file missing. The file can't be generated as `ninja` doesn't know it has to rerun CMake to create the file. Turns out that marking the output of configure_file as generated is wrong as explained in this bug report: https://gitlab.kitware.com/cmake/cmake/issues/18032 This patch just removes that property. The only side effect of this seems to be that this file maybe shows up in your IDE when opening our CMake project, but that seems like a small sacrifice. This patch can be quickly tested by running `ninja clean ; ninja lldbDebugserverCommon`. Before this patch the build will fail due to debugserver_vers.c missing. Reviewers: JDevlieghere, labath Reviewed By: labath Subscribers: mgorny, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68376 llvm-svn: 373723
* [JSON] Use LLVM's library for argdumperJonas Devlieghere2019-10-012-19/+7
| | | | | | | | | This patch replaces the LLDB's JSON implementation with the one from LLVM in argdumper. Differential revision: https://reviews.llvm.org/D68279 llvm-svn: 373361
OpenPOWER on IntegriCloud