summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [lldb/CommandInterpreter] Remove flag that's always true (NFC)Jonas Devlieghere2020-01-141-1/+0
| | | | | | | The 'asynchronously' argument to both GetLLDBCommandsFromIOHandler and GetPythonCommandsFromIOHandler is true for all call sites. This commit simplifies the API by dropping it and giving the baton a default argument.
* [lldb/Commands] Honor the scripting language passed (2/2)Jonas Devlieghere2019-12-211-14/+26
| | | | | | This ensures that watchpoint command honors the scripting language passed with `-s`. Currently the argument ignores the actual language and only uses it to differentiate between lldb and script commands.
* [lldb][NFC] Remove unnecessary includes in source/CommandsRaphael Isemann2019-12-161-2/+0
| | | | | | | | | | | | | | Summary: This removes most of unnecessary includes in the `source/Commands` directory. This was generated by IWYU and a script that fixed all the bogus reports from IWYU. Patch is tested on Linux and macOS. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: krytarowski, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71489
* [lldb][NFC] Use raw_ostream instead of Stream in Baton::GetDescriptionRaphael Isemann2019-12-021-4/+4
| | | | | Removing raw_ostream here is getting us closer to removing LLDB's Stream class.
* remove File::SetStream(), make new files instead.Lawrence D'Anna2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of calling SetStream() on a file, we make a new file and replace it. My ultimate goal here is to introduce a new API class SBFile, which has full support for python io.IOStream file objects. These can redirect read() and write() to python code, so lldb::Files will need a way to dispatch those methods. Additionally it will need some form of sharing and assigning files, as a SBFile will be passed in and assigned to the main IO streams of the debugger. In my prototype patch queue, I make File itself copyable and add a secondary class FileOps to manage the sharing and dispatch. In that case SBFile was a unique_ptr<File>. (here: https://github.com/smoofra/llvm-project/tree/files) However in review, Pavel Labath suggested that it be shared_ptr instead. (here: https://reviews.llvm.org/D67793) In order for SBFile to use shared_ptr<File>, everything else should as well. If this patch is accepted, I will make SBFile use a shared_ptr I will remove FileOps from future patches and use subclasses of File instead. Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67891 llvm-svn: 373090
* [lldb] Unify target checking in CommandObjectRaphael Isemann2019-08-311-30/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have several CommandObjects that manually reimplement the checking for a selected target or a target in the execution context (which is the selected target when they are invoked). This patch removes all these checks and replaces them by setting the eCommandRequiresTarget flag that Pavel suggested. With this flag we are doing the same check but without having to duplicate this code in all these CommandObjects. I also added a `GetSelectedTarget()` variant of the `GetSelectedOrDummyTarget()` function to the CommandObject that checks that the flag is set and then returns a reference to the target. I didn't rewrite all the `target` variables from `Target *` to `Target &` in this patch as last time this change caused a lot of merge conflicts in Swift and I would prefer having that in a separate NFC commit. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: clayborg, JDevlieghere, jingham, amccarth, abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66863 llvm-svn: 370571
* [lldb][NFC] Remove dead code that is supposed to handle invalid command optionsRaphael Isemann2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We currently have a bunch of code that is supposed to handle invalid command options, but all this code is unreachable because invalid options are already handled in `Options::Parse`. The only way we can reach this code is when we declare but then not implement an option (which will be made impossible with D65386, which is also when we can completely remove the `default` cases). This patch replaces all this code with `llvm_unreachable` to make clear this is dead code that can't be reached. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66522 llvm-svn: 369625
* Format OptionEnumValueElement (NFC)Jonas Devlieghere2019-08-021-11/+18
| | | | | | | | | | Reformat OptionEnumValueElement to make it easier to distinguish between its fields. This also removes the need to disable clang-format for these arrays. Differential revision: https://reviews.llvm.org/D65489 llvm-svn: 367638
* [lldb] Also include the array definition in CommandOptions.incRaphael Isemann2019-07-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Right now our CommandOptions.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the CommandOptions.inc generate it alongside the initializers. This patch will also allow us to generate additional declarations related to that option list in the future (e.g. a enum class representing the specific options which would make our handling code less prone). This patch also fixes a few option tables that didn't follow our naming style. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65331 llvm-svn: 367186
* [lldb][NFC] Tablegenify watchpoint commandsRaphael Isemann2019-07-171-6/+2
| | | | | | | Part of the project that migrates these struct initializers to our new lldb-tablegen. llvm-svn: 366316
* Propagate command interpreter errors from lldlbinitJonas Devlieghere2019-05-081-0/+1
| | | | | | | | | | | | | | This patch ensures that we propagate errors coming from the lldbinit file trough the command/script interpreter. Before, if you did something like command script import syntax_error.py, and the python file contained a syntax error, lldb wouldn't tell you about it. This changes with the current patch: errors are now propagated by default. PS: Jim authored this change and I added testing. Differential revision: https://reviews.llvm.org/D61579 llvm-svn: 360216
* [CommandObject] Use GetDebugger() helper method (NFC)Jonas Devlieghere2019-04-271-3/+3
| | | | | | | | | | In r359354 a GetDebugger() method was added to the CommandObject class, so that we didn't have to go through the command interpreter to obtain the script interpreter. This patch simplifies other call sites where m_interpreter.GetDebugger() was used, and replaces them with a shorter call to the new method. llvm-svn: 359373
* [ScriptInterpreter] Move ownership into debugger (NFC)Jonas Devlieghere2019-04-261-3/+4
| | | | | | | | | | | | | | This is part two of the change started in r359330. This patch moves the ownership of the script interpreter from the command interpreter into the debugger. I would've preferred to remove the lazy initialization, however the fact that the scripting language is set after the debugger is created makes that tricky. So for now this does exactly the same thing as when it was under the command interpreter. The result is that this patch is fully NFC. Differential revision: https://reviews.llvm.org/D61211 llvm-svn: 359354
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-8/+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
* Quiet command regex instructions during batch executionDave Lee2019-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Within .lldbinit, regex commands can be structured as a list of substitutions over multiple lines. It's possible that this is uninentional, but it works and has benefits. For example: command regex <command-name> s/pat1/repl1/ s/pat2/repl2/ ... I use this form of `command regex` in my `~/.lldbinit`, because it makes it clearer to write and read compared to a single line definition, because multiline substitutions don't need to be quoted, and are broken up one per line. However, multiline definitions result in usage instructions being printed for each use. The result is that every time I run `lldb`, I get a dozen or more lines of noise. With this change, the instructions are only printed when `command regex` is invoked interactively, or from a terminal, neither of which are true when lldb is sourcing `~/.lldbinit`. Reviewers: clayborg, jingham Reviewed By: clayborg Subscribers: jdoerfert, kastiglione, xiaobai, keith, lldb-commits Differential Revision: https://reviews.llvm.org/D48752 llvm-svn: 355793
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-131-9/+9
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Replace "nullptr-terminated" C-arrays of OptionValueEnumeration with safer ↵Tatyana Krasnukha2018-09-261-8/+11
| | | | | | | | llvm::ArrayRef Differential Revision: https://reviews.llvm.org/D49017 llvm-svn: 343130
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-071-1/+1
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* Typo fixes.Bruce Mitchener2018-05-291-1/+1
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Move Args::StringTo*** functions to a new OptionArgParser classPavel Labath2018-04-101-2/+4
| | | | | | | | | | | | | | | | Summary: The idea behind this is to move the functionality which depend on other lldb classes into a separate class. This way, the Args class can be turned into a lightweight arc+argv wrapper and moved into the lower lldb layers. Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44306 llvm-svn: 329677
* Rename Error -> Status.Zachary Turner2017-05-121-3/+3
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Delete some more dead includes.Zachary Turner2017-03-221-0/+1
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Make Options::SetOptionValue take a StringRef.Zachary Turner2016-11-121-7/+6
| | | | llvm-svn: 286723
* Update OptionGroup::SetValue to take StringRef.Zachary Turner2016-09-231-2/+3
| | | | | | | | Then deal with all the fallout. Differential Revision: https://reviews.llvm.org/D24847 llvm-svn: 282265
* Try to fix build errors on Android.Zachary Turner2016-09-221-1/+1
| | | | | | | It doesn't like the implicit conversion from T[] to ArrayRef<T> so I'm using `llvm::makeArrayRef()`. Hopefully I got everything. llvm-svn: 282195
* Convert option tables to ArrayRefs.Zachary Turner2016-09-221-30/+26
| | | | | | | | | | | | | | | | | | | | | | | | | This change is very mechanical. All it does is change the signature of `Options::GetDefinitions()` and `OptionGroup:: GetDefinitions()` to return an `ArrayRef<OptionDefinition>` instead of a `const OptionDefinition *`. In the case of the former, it deletes the sentinel entry from every table, and in the case of the latter, it removes the `GetNumDefinitions()` method from the interface. These are no longer necessary as `ArrayRef` carries its own length. In the former case, iteration was done by using a sentinel entry, so there was no knowledge of length. Because of this the individual option tables were allowed to be defined below the corresponding class (after all, only a pointer was needed). Now, however, the length must be known at compile time to construct the `ArrayRef`, and as a result it is necessary to move every option table before its corresponding class. This results in this CL looking very big, but in terms of substance there is not much here. Differential revision: https://reviews.llvm.org/D24834 llvm-svn: 282188
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-191-1/+2
| | | | | | | | | | | | | | | This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
* Some more pointer safety in Breakpoint.Zachary Turner2016-09-131-3/+4
| | | | | | | | | | | Plumb unique_ptrs<> all the way through the baton interface. NFC, this is a minor improvement to remove the possibility of an accidental pointer ownership issue. Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D24495 llvm-svn: 281360
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-521/+489
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Tables of command options in LLDB benefit from hand-formatting to make itKate Stone2016-08-261-13/+7
| | | | | | | | | | | | | easier to scan a set of options with a relatively large number of positional arguments. This commit standardizes their formatting throughout LLDB and applies surrounding directives to exempt them from being formatted by clang-format. These kinds of exemptions should be rare cases that benefit significantly from alternative formatting. They also imply a long-term obligation to maintain their format since the automated tools will not do so. llvm-svn: 279882
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-111-5/+6
| | | | | | | | | | | | | | | | Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
* LLDB help content has accumulated over time without a recent attempt toKate Stone2016-07-141-12/+10
| | | | | | | | | review it for consistency, accuracy, and clarity. These changes attempt to address all of the above while keeping the text relatively terse. <rdar://problem/24868841> llvm-svn: 275485
* Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in ↵Eugene Zelenko2016-02-231-64/+43
| | | | | | some files in source/Commands; other minor fixes. llvm-svn: 261602
* commands: Use override instead of virtual.Bruce Mitchener2015-10-071-25/+20
| | | | | | | | | | | | | | | | | Summary: This removes all uses of virtual on functions where override could be used, including on destructors. It also adds override where virtual was previously missing. Reviewers: clayborg, labath Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13503 llvm-svn: 249564
* Fixed line wrapping for the "long help" content in LLDB commands. Content ↵Kate Stone2015-07-141-115/+106
| | | | | | | | | | is now dynamically wrapped for the column width of the current terminal. Lines that begin with whitespace will be indented identically on subsequent lines to maintain formatting. Existing commands supplying this type of help content have been reworked to take advantage of the changes. In addition to formatting changes, content was changes for accuracy and clarity purposes. <rdar://problem/21269977> llvm-svn: 242122
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Rework the way we pass "run multiple command" options to the various API's thatJim Ingham2014-10-111-8/+7
| | | | | | | | | | | | | | | do that (RunCommandInterpreter, HandleCommands, HandleCommandsFromFile) to gather the options into an options class. Also expose that to the SB API's. Change the way the "-o" options to the lldb driver are processed so: 1) They are run synchronously - didn't really make any sense to run the asynchronously. 2) The stop on error 3) "quit" in one of the -o commands will not quit lldb - not the command interpreter that was running the -o commands. I added an entry to the run options to stop-on-crash, but I haven't implemented that yet. llvm-svn: 219553
* Revert "Fix broken tests due to new error output."Zachary Turner2014-07-091-5/+5
| | | | | | | This reverts commit ec7c94f8e6860968d384b578e5564a9c55c80b4a and re-enables OptionValidators. llvm-svn: 212627
* Fix broken tests due to new error output.Todd Fiala2014-07-081-5/+5
| | | | | | | | | | | This reverses out the options validators changes. We'll get these back in once the changes to the output can be resolved. Restores broken tests on FreeBSD, Linux, MacOSX. Changes reverted: r212500, r212317, r212290. llvm-svn: 212543
* Adds the notion of an OptionValidator.Zachary Turner2014-07-031-5/+5
| | | | | | | | | | | | | | | | | | The purpose of the OptionValidator is to determine, based on some arbitrary set of conditions, whether or not a command option is valid for a given debugger state. An example of this might be to selectively disable or enable certain command options that don't apply to a particular platform. This patch contains no functional change, and does not actually make use of an OptionValidator for any purpose yet. A follow-up patch will begin to add the logic and users of OptionValidator. Reviewed by: Greg Clayton, Jim Ingham Differential Revision: http://reviews.llvm.org/D4369 llvm-svn: 212290
* lldb TOT is dropping the last entry for multi-line IOHandlers that use the ↵Greg Clayton2014-05-081-1/+1
| | | | | | | | IOHandlerDelegateMultiline. <rdar://problem/16844164> llvm-svn: 208336
* "DONE" is being left in multi-line results when it shouldn't for non ↵Greg Clayton2014-05-021-1/+1
| | | | | | | | terminal input. <rdar://problem/16790579> llvm-svn: 207818
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-120/+38
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* Add OptionParser.hVirgile Bello2013-09-051-4/+4
| | | | llvm-svn: 190063
* Use the "last created watchpoint" rather than asserting on watchpoint ↵Jim Ingham2013-07-021-3/+3
| | | | | | | | commands passing no watchpoint ID. <rdar://problem/14327560> llvm-svn: 185406
* Fixed some linux buildbot warnings.Greg Clayton2013-04-191-4/+3
| | | | llvm-svn: 179892
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-2/+2
| | | | | | the macros and just use C++11. llvm-svn: 179805
OpenPOWER on IntegriCloud