summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-vscode
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [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-152-1/+11
| | | | | Use CMake to configure the Info.plist file so that we have a real version number in things like crash reporter.
* [LLDB] Fix a bunch of -Wdocumentation warningsJonas Devlieghere2019-11-131-2/+2
|
* [lldb] Record framework build path and use it everywhereHaibo Huang2019-11-061-2/+1
| | | | This avoids config time dependencies on liblldb. And enables other refactoring.
* 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
* [lldb-vscode] correctly handle multiple sourceMap entriesAlex Langford2019-09-261-2/+2
| | | | | | | | | | | | | | Summary: `lldb-vscode` concatenates a string of sourceMap entries specified in the config, but fails to put a space between each entry, which causes the settings command to fail. This patch adds a space between each mapping. Patch by Richard Howell Differential Revision: https://reviews.llvm.org/D67569 llvm-svn: 373016
* [LLDB] Rework a MinGW build fix from D65691Martin Storsjo2019-09-231-3/+1
| | | | | | | | | | | That change didn't contain any explanation for this bit. There shouldn't be any need for a check for MinGW ifdefs here, as long as the include uses lowercase windows.h (as is used consistently elsewhere in the llvm projects). Differential Revision: https://reviews.llvm.org/D67894 llvm-svn: 372656
* [LLDB] Cast -1 (as invalid socket) to the socket type before comparingMartin Storsjo2019-09-211-2/+3
| | | | | | | | | | This silences warnings about comparison of integers between unsigned long long (which is what the Windows SOCKET type is) and signed int when building in MinGW mode. Differential Revision: https://reviews.llvm.org/D67863 llvm-svn: 372486
* [lldb-vscode] add `launchCommands` to handle launch specific commandsAlex Langford2019-08-191-5/+14
| | | | | | | | | | | | | | Summary: This can help `lldb-vscode` handle launch commands associate with remote platform attach request have field `attachCommands` to handle attach specific commands add a corresponding one for launch request if no launch command is provided, create a new target and launch; otherwise, execute the launch command Differential Revision: https://reviews.llvm.org/D65363 Patch by Wanyi Ye <kusmour@gmail.com> llvm-svn: 369296
* Various build fixes for lldb on MinGWHaibo Huang2019-08-062-0/+4
| | | | | | | | | | Subscribers: mstorsjo, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65691 llvm-svn: 368069
* [lldb] Handle EOF from `lldb-vscode`Jan Kratochvil2019-07-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Sometimes (when running lldb-vscode under strace) I get: read(0, "", 16) = 0 read(0, "", 16) = 0 read(0, "", 16) = 0 ... With this patch testcases finish properly even with strace: read(0, "", 16) = 0 futex(0x1346508, FUTEX_WAKE_PRIVATE, 2147483647) = 0 stat("", 0x7ffe8f2634c8) = -1 ENOENT (No such file or directory) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=9124, si_uid=1001, si_status=SIGINT, si_utime=1, si_stime=0} --- close(4) = 0 exit_group(0) = ? +++ exited with 0 +++ Differential Revision: https://reviews.llvm.org/D64698 llvm-svn: 366187
* [CMake] LLDB.framework tools handlingStefan Granitz2019-05-291-1/+11
| | | | | | | | | | | | | | | | | | | | Summary: Modify the way LLDB.framework tools are collected. This allows for better fine-tuning of the install behavior downstream. Each target calls `lldb_add_to_framework()` individually. When entering the function, the target exists and we can tweak its very own post-build and install steps. This was not possible with the old `LLDB_FRAMEWORK_TOOLS` approach. No function change otherwise. This is a reduced follow-up from the proposal in D61952. Reviewers: xiaobai, compnerd, JDevlieghere Reviewed By: JDevlieghere Subscribers: clayborg, friss, ki.stfu, mgorny, lldb-commits, labath, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D62472 llvm-svn: 361946
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-106-144/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* [lldb] Add missing EINTR handlingMichal Gorny2019-03-211-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D59606 llvm-svn: 356703
* [lldb-vscode] Fix dangling pointer in request_evaluate.Jorge Gorbe Moya2019-03-151-1/+4
| | | | | | | | | | SBError::GetCString() returns a pointer to a string owned by the SBError object. The code here was calling GetCString on a temporary and using the returned pointer after the temporary was destroyed. Differential Revision: https://reviews.llvm.org/D59400 llvm-svn: 356227
* [lldb-vscode] Don't try to launch an invalid program.Jorge Gorbe Moya2019-03-131-0/+1
| | | | | | | | | | | | | | | If an invalid program is specified, lldb-vscode will send back a response with "success" = false, but then will continue executing the rest of request_launch(), try to launch the program anyway and try to send another response (possibly using the `response` object after it was moved). This change adds a return statement so we stop executing the handler after producing the first failing response. Differential Revision: https://reviews.llvm.org/D59340 llvm-svn: 356110
* Bring Doxygen comment syntax in sync with LLVM coding style.Adrian Prantl2019-03-112-77/+77
| | | | | | This changes '@' prefix to '\'. llvm-svn: 355841
* [lldb-vscode] Fix warningJonas Devlieghere2019-03-081-2/+2
| | | | | | | | I changed the variable to an unsigned to get rid of a signed and unsigned compare without realizing the value could be negative. This fixes the assert instead. llvm-svn: 355708
* [lldb-vscode] Report an error if an invalid program is specified.Zachary Turner2019-03-081-5/+8
| | | | | | | | | | | | | | | Previously if an invalid program was specified, there was a bug which, when we attempted to launch the program, would report that the operation succeeded, causing LLDB to then hang while waiting indefinitely to receive some events from the process. After this patch, when an invalid program is specified, we immediately return to vs code with an error message that indicates that the program can not be found. Differential Revision: https://reviews.llvm.org/D59114 llvm-svn: 355656
* Make bytes_read an unsignedJonas Devlieghere2019-03-071-1/+1
| | | | llvm-svn: 355651
* Remove unused functionJonas Devlieghere2019-03-071-6/+0
| | | | llvm-svn: 355650
* [lldb-vscode] Support running in server mode on Windows.Zachary Turner2019-03-077-86/+278
| | | | | | | | | | | | | | | | Windows can't use standard i/o system calls such as read and write to work with sockets, it instead needs to use the specific send and recv calls. This complicates matters for the debug adapter, since it needs to be able to work in both server mode where it communicates over a socket, as well as non-server mode where it communicates via stdin and stdout. To abstract this out, I've introduced a class IOStream which hides all these details and exposes a read/write interface that does the right on each platform. Differential Revision: https://reviews.llvm.org/D59104 llvm-svn: 355637
* [lldb-vscode] Correctly propagate errors back to VS Code.Zachary Turner2019-03-061-12/+12
| | | | llvm-svn: 355557
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1917-68/+51
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [CMake] Revised RPATH handlingStefan Granitz2019-01-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling. * In the build-tree, tools use the absolute path to the framework's actual output location. * In the install-tree, tools get a list of RPATHs to look for the framework when deployed. `LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree. If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree). If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree. For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks". Reviewers: xiaobai, JDevlieghere, aprantl, clayborg Reviewed By: JDevlieghere Subscribers: ki.stfu, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55330 llvm-svn: 350392
* Simplify Boolean expressionsJonas Devlieghere2018-12-151-3/+1
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* 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
* Adjust some id bit shifts to fit inside 32 bit integersNathan Lanza2018-11-074-6/+107
| | | | | | | | | | | | | | | Summary: The DAP on vscode uses a JavaScript `number` for identifiers while the Visual Studio version uses a C# `Int` for identifiers. lldb-vscode is bit shifting identifiers 32 bits and then bitwise ORing another 32 bit identifier into a 64 bit id to form a unique ID. Change this to a a partitioning of the 32 bits that makes sense for the data types. Reviewers: clayborg Differential Revision: https://reviews.llvm.org/D53599 llvm-svn: 346346
* Adjust the comment section of CreateSource to account for lines longer than 60Nathan Lanza2018-11-051-2/+6
| | | | | | | | | | | | | | | | | | Summary: On rare occasions, the address, instruction and arguments of a line of assembly in the CreateSource printout would reach > 60 characters. The function would integer overflow and try to indent a line by `0xfff...`. Change the calculated offset to be the maximum of 60 or `line_strm.str().size()` Reviewers: clayborg, xiaobai Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D52745 llvm-svn: 346179
* Set stdout/stdin to binary mode on WindowsNathan Lanza2018-11-051-0/+12
| | | | | | | | | | | | | | | | | Summary: A file opened in text mode on Windows will have `\n` automatically changed to `13,10` while Darwin and Linux leave it as `10`. Set the file to binary mode to avoid this automatic conversion so that Darwin, Linux and Windows have equivalent treatment of `\r`. Reviewers: clayborg, xiaobai Reviewed By: clayborg Subscribers: emaste, ki.stfu, mgorny, eraman, JDevlieghere, mgrang Differential Revision: https://reviews.llvm.org/D52672 llvm-svn: 346174
* Fix typos.Bruce Mitchener2018-10-044-13/+13
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* Fix lldb-vscode README.mdAlex Langford2018-09-141-8/+8
| | | | | | | | | | Summary: The readme was missing "-" characters to enable links Patch by Nathan Lanza <nathan@lanza.io> Differential Revision: https://reviews.llvm.org/D52069 llvm-svn: 342266
* Update the Core file loading instructions so they keep the process stopped ↵Greg Clayton2018-08-161-0/+1
| | | | | | after attaching to a core file. llvm-svn: 339954
* Fix lldb-vscode build on WindowsReid Kleckner2018-08-164-11/+12
| | | | | | | | Include PosixAPI.h to get a PATH_MAX definition and replace CreateEvent with CreateEventObject to avoid conflicts with the windows.h definition of CreateEvent to CreateEventW. llvm-svn: 339920
* Add a new tool named "lldb-vscode" that implements the Visual Studio Code ↵Greg Clayton2018-08-1621-0/+5499
Debug Adaptor Protocol This patch adds a new lldb-vscode tool that speaks the Microsoft Visual Studio Code debug adaptor protocol. It has full unit tests that test all packets. This tool can be easily packaged up into a native extension and used with Visual Studio Code, and it can also be used by Nuclide Differential Revision: https://reviews.llvm.org/D50365 llvm-svn: 339911
OpenPOWER on IntegriCloud