aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Make breakpoint names real entities.Jim Ingham1-3/+6
When introduced, breakpoint names were just tags that you could apply to breakpoints that would allow you to refer to a breakpoint when you couldn't capture the ID, or to refer to a collection of breakpoints. This change makes the names independent holders of breakpoint options that you can then apply to breakpoints when you add the name to the breakpoint. It adds the "breakpoint name configure" command to set up or reconfigure breakpoint names. There is also full support for then in the SB API, including a new SBBreakpointName class. The connection between the name and the breakpoints sharing the name remains live, so if you reconfigure the name, all the breakpoint options all change as well. This allows a quick way to share complex breakpoint behavior among a bunch of breakpoints, and a convenient way to iterate on the set. You can also create a name from a breakpoint, allowing a quick way to copy options from one breakpoint to another. I also added the ability to make hidden and delete/disable protected names. When applied to a breakpoint, you will only be able to list, delete or disable that breakpoint if you refer to it explicitly by ID. This feature will allow GUI's that need to use breakpoints for their own purposes to keep their breakpoints from getting accidentally disabled or deleted. <rdar://problem/22094452> llvm-svn: 313292
2017-08-02Fix a mis-feature with propagation of breakpoint options -> location options.Jim Ingham1-31/+32
When an option was set at on a location, I was just copying the whole option set to the location, and letting it shadow the breakpoint options. That was wrong since it meant changes to unrelated options on the breakpoint would no longer take on this location. I added a mask of set options and use that for option propagation. I also added a "location" property to breakpoints, and added SBBreakpointLocation.{G,S}etCommandLineCommands since I wanted to use them to write some more test cases. <rdar://problem/24397798> llvm-svn: 309772
2017-05-12Rename Error -> Status.Zachary Turner1-6/+6
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
2017-03-22Delete some more dead includes.Zachary Turner1-0/+1
This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
2016-11-12Make Options::SetOptionValue take a StringRef.Zachary Turner1-7/+6
llvm-svn: 286723
2016-10-05Convert various CommandInterpreter functions to StringRef.Zachary Turner1-2/+2
llvm-svn: 283370
2016-09-26Fix serialization of Python breakpoint commands.Jim Ingham1-7/+0
CommandData breakpoint commands didn't know whether they were Python or Command line commands, so they couldn't serialize & deserialize themselves properly. Fix that. I also changed the "breakpoint list" command to note in the output when the commands are Python commands. Fortunately only one test was relying on this explicit bit of text output. llvm-svn: 282432
2016-09-23Update OptionGroup::SetValue to take StringRef.Zachary Turner1-1/+2
Then deal with all the fallout. Differential Revision: https://reviews.llvm.org/D24847 llvm-svn: 282265
2016-09-22Try to fix build errors on Android.Zachary Turner1-2/+2
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
2016-09-22Convert option tables to ArrayRefs.Zachary Turner1-44/+36
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
2016-09-20Add some more tests for breakpoint serialization.Jim Ingham1-2/+2
Serialize breakpoint names & the hardware_requested attributes. Also added a few missing affordances to SBBreakpoint whose absence writing the tests pointed out. <rdar://problem/12611863> llvm-svn: 282036
2016-09-19Fix more functions in Args to use StringRef.Zachary Turner1-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
2016-09-13Some more pointer safety in Breakpoint.Zachary Turner1-6/+6
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
2016-09-12This is the main part of a change to add breakpoint save and restore to lldb.Jim Ingham1-57/+10
Still to come: 1) SB API's 2) Testcases 3) Loose ends: a) serialize Thread options b) serialize Exception resolvers 4) "break list --file" should list breakpoints contained in a file and "break read -f 1 3 5" should then read in only those breakpoints. <rdar://problem/12611863> llvm-svn: 281273
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone1-639/+582
*** 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
2016-08-26Tables of command options in LLDB benefit from hand-formatting to make itKate Stone1-20/+12
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
2016-08-11Decoupled Options from CommandInterpreter.Todd Fiala1-11/+13
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
2016-07-14LLDB help content has accumulated over time without a recent attempt toKate Stone1-13/+12
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
2016-02-19Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in ↵Eugene Zelenko1-63/+46
some files in source/Commands; other minor fixes. llvm-svn: 261356
2015-10-07commands: Use override instead of virtual.Bruce Mitchener1-32/+27
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
2015-07-14Fixed line wrapping for the "long help" content in LLDB commands. Content ↵Kate Stone1-137/+114
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
2015-05-29Don't #include "lldb-python.h" from anywhere.Zachary Turner1-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
2014-12-16Add the ability to tag one or more breakpoints with a name. TheseJim Ingham1-3/+3
names can then be used in place of breakpoint id's or breakpoint id ranges in all the commands that operate on breakpoints. <rdar://problem/10103959> llvm-svn: 224392
2014-12-06Add the ability to set breakpoints with conditions, commands, etc,Jim Ingham1-3/+84
in the "dummy-target". The dummy target breakpoints prime all future targets. Breakpoints set before any target is created (e.g. breakpoints in ~/.lldbinit) automatically get set in the dummy target. You can also list, add & delete breakpoints from the dummy target using the "-D" flag, which is supported by most of the breakpoint commands. This removes a long-standing wart in lldb... <rdar://problem/10881487> llvm-svn: 223565
2014-10-11Rework the way we pass "run multiple command" options to the various API's thatJim Ingham1-10/+9
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
2014-08-29Allow "breakpoint command add" to add commands to more than one breakpoint ↵Jim Ingham1-58/+70
at a time. <rdar://problem/13314462> llvm-svn: 216747
2014-08-28Make it clear in the help that "breakpoint command add" will act on the last setJim Ingham1-2/+3
breakpoint if no breakpoint id is specified. <rdar://problem/17885160> llvm-svn: 216637
2014-08-21Fixed a typo.Sean Callanan1-1/+1
<rdar://problem/18084105> llvm-svn: 216189
2014-07-09Revert "Fix broken tests due to new error output."Zachary Turner1-5/+5
This reverts commit ec7c94f8e6860968d384b578e5564a9c55c80b4a and re-enables OptionValidators. llvm-svn: 212627
2014-07-08Fix broken tests due to new error output.Todd Fiala1-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
2014-07-03Adds the notion of an OptionValidator.Zachary Turner1-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
2014-05-08lldb TOT is dropping the last entry for multi-line IOHandlers that use the ↵Greg Clayton1-1/+1
IOHandlerDelegateMultiline. <rdar://problem/16844164> llvm-svn: 208336
2014-05-02"DONE" is being left in multi-line results when it shouldn't for non ↵Greg Clayton1-1/+1
terminal input. <rdar://problem/16790579> llvm-svn: 207818
2014-04-02Add the ability to set python breakpoint commands from the SBBreakpoint & ↵Jim Ingham1-8/+2
SBBreakpointLocation API's. You can either provide the function name, or function body text. Also propagate the compilation error up from where it is checked so we can report compilation errors. <rdar://problem/9898371> llvm-svn: 205380
2014-01-27Merging the iohandler branch back into main. Greg Clayton1-117/+39
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
2013-09-05Add OptionParser.hVirgile Bello1-4/+4
llvm-svn: 190063
2013-05-16Note in the documentation about the fact that Python callbacks can return a ↵Enrico Granata1-0/+6
value and if that value is False, LLDB won’t stop at the breakpoint llvm-svn: 182059
2013-05-15<rdar://problem/13883385>Enrico Granata1-1/+2
Python breakpoint actions can return False to say that they don't want to stop at the breakpoint to which they are associated Almost all of the work to support this notion of a breakpoint callback was in place, but two small moving parts were missing: a) the SWIG wrapper was not checking the return value of the script b) when passing a Python function by name, the call statement was dropping the return value of the function This checkin addresses both concerns and makes this work Care has been taken that you only keep running when an actual value of False has been returned, and that any other value (None included) means Stop! llvm-svn: 181866
2013-04-18After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton1-2/+2
the macros and just use C++11. llvm-svn: 179805
2013-04-18Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton1-2/+2
C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
2013-02-28breakpoint command add currently doesn't support adding commands to more ↵Jim Ingham1-0/+7
than one breakpoint at a time. Enforce this for now (we should relax the requirement when we have a little more time.) <rdar://problem/13314462> llvm-svn: 176291
2012-12-05Fix Linux build warnings due to redefinition of macros:Daniel Malea1-0/+2
- add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
2012-12-04<rdar://problem/12798131> Greg Clayton1-1/+1
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189
2012-10-26Updated the "breakpoint command add" documentation and fixed the web site ↵Greg Clayton1-109/+124
docs for the signature of the python breakpoint callback functions. llvm-svn: 166789
2012-09-11Change the NULL to a 0 since we need a uint32_tFilipe Cabecinhas1-4/+4
llvm-svn: 163625
2012-08-08<rdar://problem/11975483> Removing user-visible references to 'dict' as a ↵Enrico Granata1-1/+1
parameter name for Python summary-generating functions since it is a Python keyword. llvm-svn: 161467
2012-07-17Ran the static analyzer on the codebase and found a few things.Greg Clayton1-4/+3
llvm-svn: 160338
2012-06-08Make raw & parsed commands subclasses of CommandObject rather than having ↵Jim Ingham1-574/+581
the raw version implement an Execute which was never going to get run and another ExecuteRawCommandString. Took the knowledge of how to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs. Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for the overall command and moved them into the .cpp file. Made the CommandObject flags work for raw as well as parsed commands. Made "expr" use the flags so that it requires you to be paused to run "expr". llvm-svn: 158235
2012-05-31<rdar://problem/11328896> Fixing a bug where regex commands were saved in ↵Enrico Granata1-1/+2
the history even if they came from a 'command sourced' file - this fix introduces a command sourcing depth and disables history for all levels of depth > 0, which means no commands go into history when being sourced from a file. we need an integer depth because command files might themselves source other command files, ... llvm-svn: 157727
2012-04-25Fix the docs for "breakpoint command add" to specify the arguments passed ↵Jim Ingham1-21/+32
into the python function. llvm-svn: 155517