summaryrefslogtreecommitdiffstats
path: root/lldb/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [lldb-mi] Implement -gdb-set breakpoint pending on/offMarc-Andre Laperle2018-10-307-3/+110
| | | | | | | | | | | | | | | | | | Summary: This allows creating pending breakpoint automatically when a location is not found. This is used by some front-ends instead of doing "-break-insert -f" every time. See also https://sourceware.org/gdb/onlinedocs/gdb/Set-Breaks.html Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com> Subscribers: MaskRay, llvm-commits, lldb-commits, ki.stfu Tags: #lldb Differential Revision: https://reviews.llvm.org/D52953 llvm-svn: 345563
* Remove an early-return from Driver::ParseArgs thatJason Molenda2018-10-261-4/+0
| | | | | | | | | | was added as a part of D52604 / r343348. If the lldb driver is run without any arguments, .lldbinit file reading was not enabled. <rdar://problem/45570242> llvm-svn: 345422
* Fix typos.Bruce Mitchener2018-10-045-14/+14
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* [Driver] Remove unused declarations and "include" directivesTatyana Krasnukha2018-09-282-9/+1
| | | | llvm-svn: 343357
* Clean-up usage of OptionDefinition arraysTatyana Krasnukha2018-09-282-87/+61
| | | | | | Differential Revision: https://reviews.llvm.org/D52604 llvm-svn: 343348
* [NFC] Turn "load dependent files" boolean into an enumJonas Devlieghere2018-09-201-4/+3
| | | | | | | | | | | | | | This is an NFC commit to refactor the "load dependent files" parameter from a boolean to an enum value. We want to be able to specify a default, in which case we decide whether or not to load the dependent files based on whether the target is an executable or not (i.e. a dylib). This is a dependency for D51934. Differential revision: https://reviews.llvm.org/D51859 llvm-svn: 342633
* 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
* [PDB] Restore AST from PDB symbolsAleksandr Urakov2018-09-101-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds an implementation of retrieving of declarations and declaration contexts based on PDB symbols. PDB has different type symbols for const-qualified types, and this implementation ensures that only one declaration was created for both const and non-const types, but creates different compiler types for them. The implementation also processes the case when there are two symbols corresponding to a variable. It's possible e.g. for class static variables, they has one global symbol and one symbol belonging to a class. PDB has no info about namespaces, so this implementation parses the full symbol name and tries to figure out if the symbol belongs to namespace or not, and then creates nested namespaces if necessary. Reviewers: asmith, zturner, labath Reviewed By: asmith Subscribers: aleksandr.urakov, teemperor, lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51162 llvm-svn: 341782
* Re-instate a bit of code that was commented out in r188246 whichJason Molenda2018-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | reads an ObjectFileMachO's string table in one chunk. Originally this was commented out because binaries in the system's shared cache all share a mega-string table and so reading the entire mega-strtab for each binary was a performance problem. In the reinstated code, I add a check that the binary we're reading from memory is not in the shared cache (there isn't a constant in <mach-o/loader.h> for this bit yet; we hardcode the value in one other place in ObjectFileMachO alread). For binaries that we're reading out of memory that are NOT in the shared cache, reading the string table in one chunk is a big performance improvement. Also have debugserver send up the flags value for binaries in its response to the jGetLoadedDynamicLibrariesInfos request. NFC. <rdar://problem/33604496> llvm-svn: 341511
* [PDB] Resolve a symbol context block info correctlyAleksandr Urakov2018-08-291-0/+48
| | | | | | | | | | | | | | | | | | | Summary: This patch allows to resolve a symbol context block info even if a function info was not requested. Also it adds the correct resolving of nested blocks (the previous implementation used function blocks instead of them). Reviewers: zturner, asmith, labath Reviewed By: asmith Subscribers: lldb-commits, stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51104 llvm-svn: 340901
* Remove unnecessary entitlement in debugserver for iOS.Jason Molenda2018-08-281-2/+0
| | | | | | <rdar://problem/43631901> llvm-svn: 340877
* [cmake] Add option to skip building lldb-serverAlex Langford2018-08-231-1/+1
| | | | | | | | | | | | | | | Summary: There is currently a way to skip the debugserver build. See how the CMake variables SKIP_DEBUGSERVER and LLDB_CODESIGN_IDENTITY are used if you're interested in that. This allows us to skip building lldb-server as well. There is another debug server called ds2 that can be used with LLDB. If you choose to use ds2, this flag is very useful because it can cut down the build time of LLDB. Differential Revision: https://reviews.llvm.org/D49282 llvm-svn: 340560
* 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-1622-0/+5500
| | | | | | | | | | | | 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
* [lldb-mi] Re-implement target-select commandAlexander Polyakov2018-08-071-41/+18
| | | | | | | | | | Now target-select uses SB API instead of HandleCommand. This patch has been reviewed along with the r339175. Differential Revision: https://reviews.llvm.org/D49739 llvm-svn: 339178
* [lldb-mi] Re-implement MI HandleProcessEventStateSuspended.Alexander Polyakov2018-08-071-9/+11
| | | | | | | | | | | | | | Summary: Now this function uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg, labath Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49632 llvm-svn: 339160
* Fix windows build after r337689Alexander Polyakov2018-07-231-0/+1
| | | | | | Added missing header. llvm-svn: 337692
* [lldb-mi] Re-implement data-info-line command.Alexander Polyakov2018-07-232-143/+77
| | | | | | | | | | | | | | Summary: Now data-info-line command uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg, jingham Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D49062 llvm-svn: 337689
* Invert dependency between lldb-framework and lldb-suiteAlex Langford2018-07-171-1/+1
| | | | | | | | | | | | | | | | | Summary: Currently, if you build lldb-framework the entire framework doesn't actually build. In order to build the entire framework, you need to actually build lldb-suite. This abstraction doesn't feel quite right because lldb-framework truly does depend on lldb-suite (liblldb + related tools). In this change I want to invert their dependency. This will mean that lldb and finish_swig will depend on lldb-framework in a framework build, and lldb-suite otherwise. Instead of adding conditional logic everywhere to handle this, I introduce LLDB_SUITE_TARGET to handle it. Differential Revision: https://reviews.llvm.org/D49406 llvm-svn: 337311
* Move pretty stack trace printer into driver.Jonas Devlieghere2018-07-173-0/+21
| | | | | | | | | | | | We used to have a pretty stack trace printer in SystemInitializerCommon. This was disabled on Apple because we didn't want the library to be setting signal handlers, as this was causing issues when loaded into Xcode. However, I think it's useful to have this for the LLDB driver, so I moved it up to use the PrettyStackTraceProgram in the driver's main. Differential revision: https://reviews.llvm.org/D49377 llvm-svn: 337261
* Allow specifying an exit code for the 'quit' commandRaphael Isemann2018-07-112-4/+15
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the possibility to specify an exit code when calling quit. We accept any int, even though it depends on the user what happens if the int is out of the range of what the operating system supports as exit codes. Fixes rdar://problem/38452312 Reviewers: davide, jingham, clayborg Reviewed By: jingham Subscribers: clayborg, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D48659 llvm-svn: 336824
* Fix build on Windows with SDK build version >= 17134.Tatyana Krasnukha2018-07-071-5/+0
| | | | | | Platform.h doesn't define signal() and SIGINT since commit r263858. Code was compiled successfully because signal.h didn't have "ifndef" include guard in previous versions of Windows SDK. Now it does. llvm-svn: 336483
* Ammend "Fix MSVC2015 compilation failure after r336206 patch".Alexander Polyakov2018-07-031-0/+2
| | | | llvm-svn: 336235
* Fix MSVC2015 compilation failure after r336206 patch.Alexander Polyakov2018-07-031-0/+6
| | | | | | Added missing headers. llvm-svn: 336212
* [lldb-mi] Re-implement symbol-list-lines command.Alexander Polyakov2018-07-032-158/+66
| | | | | | | | | | | | | | Summary: Now this command uses SB API instead of HandleCommand. Reviewers: aprantl, clayborg Reviewed By: aprantl, clayborg Subscribers: ki.stfu, eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D48802 llvm-svn: 336206
* [lldb-mi] Re-implement a few MI commands.Alexander Polyakov2018-07-022-115/+72
| | | | | | | | | | | | | | | Summary: This patch updates exec-next-instruction, exec-step-instruction, exec-finish, exec-interrupt commands to use SB API instead of HandleCommand. Reviewers: aprantl, clayborg Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D48520 llvm-svn: 336155
* [lldb-mi] Clean up and update a few MI commands.Alexander Polyakov2018-06-292-51/+35
| | | | | | | | | | | | | | | | | Summary: This patch updates a few MI commands using a new way of handling an errors in lldb-mi and removes unnecessary m_lldbResult variables. Reviewers: aprantl, clayborg, labath Reviewed By: aprantl, clayborg Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47992 llvm-svn: 336009
* Add a test for reading lld-generated build-idsPavel Labath2018-06-291-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This test makes sure we are able to read the shorter build-ids which are generated by lld. To make this work, I've extended lldb-test to print the UUID of the loaded object file. I've renamed the lldb-test subcommand from "module-sections" to "object-file" to reflect the fact it prints more than just the sections. I've also added the module Architecture to the output, so we could avoid printing the entire symbol file information just to get the ArchSpec details in the lc_version_min test (which was also the only test in it's folder not using the module-sections command). Reviewers: aprantl, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D48646 llvm-svn: 335967
* Retrieve a function PDB symbol correctly from nested blocksPavel Labath2018-06-281-24/+58
| | | | | | | | | | | | | | | | | | | Summary: This patch fixes a problem with retrieving a function symbol by an address in a nested block. In the current implementation of ResolveSymbolContext function it retrieves a symbol with PDB_SymType::None and then checks if found symbol's tag equals to PDB_SymType::Function. So, if nested block's symbol was found, ResolveSymbolContext does not resolve a function. Reviewers: asmith, labath, zturner Reviewed By: asmith, labath Differential Revision: https://reviews.llvm.org/D47939 Patch by Aleksandr Urakov <aleksandr.urakov@jetbrains.com> llvm-svn: 335822
* Fix windows build for r335541.Alexander Polyakov2018-06-251-0/+2
| | | | | | I didn't include <functional> header and used std::function. llvm-svn: 335552
* Implement new methods for handling an error in MI commands.Alexander Polyakov2018-06-252-0/+68
| | | | | | | | | | | | | | | | Summary: The new methods take SBError object and call handler, specified by user, depending on SBError status. Reviewers: aprantl, clayborg, labath Reviewed By: aprantl, clayborg Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D48295 llvm-svn: 335541
* Introduce lldb-framework CMake target and centralize its logicAlex Langford2018-06-185-13/+5
| | | | | | | | | | | | | Summary: In this patch I aim to do the following: 1) Create an lldb-framework target that acts as the target that handles generating LLDB.framework. Previously, liblldb acted as the target for generating the framework in addition to generating the actual lldb library. This made the target feel overloaded. 2) Centralize framework generation as much as it makes sense to do so. 3) Create a target lldb-suite, which depends on every tool and library that makes liblldb fully functional. One result of having this target is it makes tracking dependencies much clearer. Differential Revision: https://reviews.llvm.org/D48060 llvm-svn: 334968
* Sort the files in the PBXBuildFile and PBXFileReference sectionsJason Molenda2018-06-151-152/+152
| | | | | | | | of debugserver's xcode project file to reduce automerger issues with the github swift repository of lldb where the order of these entries has drifted significantly over the years. llvm-svn: 334873
* Revert "[lldb-mi] Add overload method for setting an error"Alexander Polyakov2018-06-152-20/+0
| | | | | | | | | | | | | | | Summary: This reverts commit r334245 because it duplicates functionality of Status::AsCString used in SBError. Reviewers: aprantl, clayborg Reviewed By: clayborg Subscribers: lldb-commits, ki.stfu Differential Revision: https://reviews.llvm.org/D48212 llvm-svn: 334860
* Add support for PLATFORM_*SIMULATORFrederic Riss2018-06-151-0/+8
| | | | | | | | | | The toolchain in Xcode 10 uses a new LC_BUILD_VERSION entry to identify simulator binaries. Add support for reading those to debugserver. The exisitng test testing that code is currently failling when run with Xcode 10, no need for a new test. llvm-svn: 334784
* Add an entitlement to debugserverFrederic Riss2018-06-142-4/+3
| | | | | | | | | On macOS 10.14, debugserver needs to have an entitlement do be allowed to debug processes. Adding this to both the Xcode and cmake build system. This shouldn't have any impact on previous OSs. llvm-svn: 334772
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-132-2/+2
| | | | | | | | | | | | | | | | SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
* Added modulemap for lldb-miRaphael Isemann2018-06-121-0/+79
| | | | | | | | | | | | | | Summary: This patch allows building a C++ module for the lldb-mi headers. Reviewers: bruno, aprantl Reviewed By: aprantl Subscribers: lldb-commits, ki.stfu Differential Revision: https://reviews.llvm.org/D47996 llvm-svn: 334549
* Fix build error introduced in r334498Pavel Labath2018-06-121-2/+2
| | | | | | | | | | Some gcc versions (circa 4.9) do not accept initializing Expected objects containing a reference to a function from a function. Change the Expected object to contain function pointers to work around this. llvm-svn: 334501
* lldb-test symbols: Add -file argument and the ability to dump global ↵Pavel Labath2018-06-121-73/+101
| | | | | | | | | | | | | | | variables in a file The motivation for this is to be able to Dwarf index ability to look up variables within a given compilation unit. It also fits in with the patch in progress at D47939, which will add the ability to look up funtions using file+line pairs. The verification of which lldb-test options can be used together was getting a bit unwieldy, so I moved the logic out into a separate function. llvm-svn: 334498
* [lldb-mi] Re-implement MI -exec-step command.Alexander Polyakov2018-06-102-23/+21
| | | | | | | | | | | | | | Summary: Now -exec-step uses SB API instead of HandleCommand hack. Reviewers: aprantl, clayborg, labath, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47838 llvm-svn: 334364
* [lldb, lldb-mi] Re-implement MI -exec-continue command.Alexander Polyakov2018-06-092-34/+10
| | | | | | | | | | | | | | Summary: Now -exec-continue command uses SB API to resume target's process. Reviewers: aprantl, clayborg, labath Reviewed By: clayborg Subscribers: apolyakov, labath, ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47415 llvm-svn: 334350
* Delete some dead codeAlex Langford2018-06-082-6/+0
| | | | llvm-svn: 334320
* PDB support of function-level linking and splitted functionsAaron Smith2018-06-081-17/+94
| | | | | | | | | | | | | | | | | | | Summary: The patch adds support of splitted functions (when MSVC is used with PGO) and function-level linking feature. SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of compiled source files in the binary are continuous and don't intersect each other. The function creates LineSequence for each file and inserts it into LineTable, and implementation of last one relies on continuity of the sequence. But it's not always true when function-level linking enabled, e.g. in added input test file test-pdb-function-level-linking.exe there is xstring's std__basic_string_char_std__char_traits_char__std__allocator_char_____max_size (.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and main (.004548F0). To fix the problem this patch renews the sequence on each address gap. Reviewers: asmith, zturner Reviewed By: asmith Subscribers: aleksandr.urakov, labath, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47708 llvm-svn: 334260
* [lldb-mi] Add overloaded method for setting an error.Alexander Polyakov2018-06-072-0/+20
| | | | | | | | | | | | Reviewers: aprantl, clayborg Reviewed By: clayborg Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47914 llvm-svn: 334245
* [lldb-mi] Re-implement MI -exec-next command.Alexander Polyakov2018-06-071-6/+12
| | | | | | | | | | | | | | Summary: Now -exec-next command uses SB API for stepping over. Reviewers: aprantl, clayborg, stella.stamenova, labath Reviewed By: aprantl, clayborg, labath Subscribers: labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47797 llvm-svn: 334215
* [IRMemoryMap] Use labels in the "malloc" and "free" lldb-test commandsVedant Kumar2018-06-041-37/+54
| | | | | | | | | | | | | | | | Change the syntax of the malloc and free commands in lldb-test's ir-memory-map subcommand to: <malloc> ::= <label> = malloc <size> <alignment> <free> ::= free <label> This should make it easier to read and extend tests in the future, e.g to test IRMemoryMap::WriteMemory or double-free behavior. Differential Revision: https://reviews.llvm.org/D47646 llvm-svn: 333930
* [lldb, lldm-mi] Fix hanging of -exec-run command.Alexander Polyakov2018-06-031-0/+13
| | | | | | | | | | | | | | Summary: -exec-run command hanged in case of invalid or dummy target. Reviewers: aprantl, stella.stamenova Reviewed By: aprantl Subscribers: ki.stfu, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D47678 llvm-svn: 333844
* Test commit. Fix typo in comment.Alexander Polyakov2018-06-031-1/+1
| | | | llvm-svn: 333837
OpenPOWER on IntegriCloud