summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move classes from Core -> Utility.Zachary Turner2017-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Fix incorrectly named variables.Jim Ingham2016-12-151-1/+1
| | | | llvm-svn: 289746
* Adopt PrettyStackTrace in LLDBSean Callanan2016-12-141-7/+3
| | | | | | | | | | LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683. We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead. We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition. Differential Revision: https://reviews.llvm.org/D27735 llvm-svn: 289711
* Calling SBDebugger::CeeateTarget being called on multiple threads was ↵Greg Clayton2016-12-091-9/+8
| | | | | | | | | | | | | | | | crashing LLDB. I found the race condition in: ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create); More than one "ScriptInterpreter *" was being returned due to the race which caused any clients with the first one to now be pointing to freed memory and we would quickly crash. Added a test to catch this so we don't regress. <rdar://problem/28356584> llvm-svn: 289169
* Use Timeout<> in EvaluateExpressionOptions classPavel Labath2016-12-061-1/+1
| | | | llvm-svn: 288797
* Re-add "demonstrate new Args API"Zachary Turner2016-11-221-4/+3
| | | | | | This fixes the build breakage due to the use of C++14. llvm-svn: 287647
* Fix build failure on Linux and BSD by reverting r287597Omair Javaid2016-11-221-3/+4
| | | | | | Linux and BSD builds failing after this changes from rev 287597. llvm-svn: 287631
* Add the new Args / entry-access API.Zachary Turner2016-11-211-4/+3
| | | | | | | | | | | | The long-term goal here is to get rid of the functions GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead replacing them with operator based access and range-based for enumeration. There are a lot of callsites, though, so the changes will be done incrementally, starting with this one. Differential Revision: https://reviews.llvm.org/D26883 llvm-svn: 287597
* Convert CommandHistory functions to StringRef.Zachary Turner2016-11-181-9/+9
| | | | llvm-svn: 287401
* Make Apropos functions accept StringRefs.Zachary Turner2016-11-161-4/+4
| | | | llvm-svn: 287157
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-35/+42
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Fix some StringRef Printf warnings.Zachary Turner2016-11-141-1/+1
| | | | llvm-svn: 286906
* Change IOHandlerConfirm to use StringRefs.Zachary Turner2016-11-131-1/+1
| | | | llvm-svn: 286743
* Rewrite OutputFormattedHelpText in terms of StringRef.Zachary Turner2016-11-081-60/+49
| | | | | | | | | | This makes the logic easier to follow and also propagates StringRef up to the API boundary, which is necessary for making higher up StringRef API changes. Differential Revision: https://reviews.llvm.org/D26325 llvm-svn: 286204
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-021-5/+5
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Convert some Args index-based iteration to range-style iteration.Zachary Turner2016-10-051-3/+3
| | | | | | | | | | | | | | This is better for a number of reasons. Mostly style, but also: 1) Signed-unsigned comparison warnings disappear since there is no loop index. 2) Iterating with the range-for style gives you back an entry that has more than just a const char*, so it's more efficient and more useful. 3) Makes code safter since the type system enforces that it's impossible to index out of bounds. llvm-svn: 283413
* Convert some more aliasing and CI functions to StringRef.Zachary Turner2016-10-051-13/+6
| | | | llvm-svn: 283386
* Update some command aliasing functions to use StringRef.Zachary Turner2016-10-051-20/+17
| | | | llvm-svn: 283385
* Convert CommandObject constructors to StringRef.Zachary Turner2016-10-051-61/+57
| | | | llvm-svn: 283384
* Make lldb -Werror clean on Windows.Zachary Turner2016-10-051-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D25247 llvm-svn: 283344
* Fix TestNestedAliases.pyZachary Turner2016-10-041-5/+6
| | | | | | I missed an if/else branch when doing the conversion. llvm-svn: 283176
* Modernize some code related to Args usage / implementation.Zachary Turner2016-10-031-110/+107
| | | | | | | Mostly this involves simplifying some logical constructs and using some ranges instead of index-based iteration. NFC llvm-svn: 283159
* Update the prompt related functions to use StringRefs.Zachary Turner2016-09-231-10/+12
| | | | llvm-svn: 282269
* Convert 3 more functions to use a StringRef.Zachary Turner2016-09-191-2/+2
| | | | | | | | This converts Args::Unshift, Args::AddOrReplaceEnvironmentVariable, and Args::ContainsEnvironmentVariable to use StringRefs. The code is also simplified somewhat as a result. llvm-svn: 281942
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-191-9/+14
| | | | | | | | | | | | | | | 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
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-3085/+2869
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Delete Host/windows/win32.hZachary Turner2016-08-091-3/+3
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* LLDB help content has accumulated over time without a recent attempt toKate Stone2016-07-141-119/+96
| | | | | | | | | 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 an issue where one could not define a Python command with the same name ↵Enrico Granata2016-07-111-2/+7
| | | | | | as an existing alias (or rather, one could but the results of invoking the command were far from satisfactory) llvm-svn: 275080
* Fix an issue where the apropos command would not print fully qualified ↵Enrico Granata2016-05-021-1/+1
| | | | | | | | command names for nested command objects rdar://problem/26020072 llvm-svn: 268309
* Add a --element-count option to the expression commandEnrico Granata2016-04-251-0/+2
| | | | | | | | | | | | | This option evaluates an expression and, if the result is of pointer type, treats it as if it was an array of that many elements and displays such elements This has a couple subtle points but is mostly as straightforward as it sounds Add a parray N <expr> alias for this new mode Also, extend the --object-description mode to do the moral equivalent of the above but display each element in --object-description mode Add a poarray N <expr> alias for this llvm-svn: 267372
* Fix a bug where LLDB would crash if 'apropos <anything>' was used after ↵Enrico Granata2016-04-201-1/+1
| | | | | | spawning an inferior process llvm-svn: 266911
* Add help for our regular expression commands when aliasedEnrico Granata2016-04-081-16/+12
| | | | llvm-svn: 265819
* Change 'apropos' such that it doesn't look into the "long help/syntax" ↵Enrico Granata2016-03-231-41/+50
| | | | | | | | | | strings for commands This solves issues such as 'apropos foo' returning valid matches just because syntax examples happen to use 'foo' as a placeholder token Fixes rdar://9043025 llvm-svn: 264123
* Make it so that a command alias can actually remove the help/long help from ↵Enrico Granata2016-03-221-4/+8
| | | | | | its parent command by setting itself to an empty help string llvm-svn: 264108
* Fix a bug caused by my alias refactoring where, if an alias was defined in ↵Enrico Granata2016-03-221-2/+3
| | | | | | terms of another alias, trying to run the nested command would actually cause a crash in the command interpreter llvm-svn: 264096
* Use Enrico's new CommandAlias to give better help to the "sif" command.Jim Ingham2016-03-191-1/+7
| | | | llvm-svn: 263865
* Workaround the fact that "b" is now a separate command object from ↵Enrico Granata2016-03-151-5/+5
| | | | | | | | | | "_regexp-break", and thus "help b" doesn't show the possible syntaxes It would be nice to have a longer-term plan for how to handle help for regular expression commands, since their syntax is highly irregular. I can see a few options (*), but for now this is a reasonable stop-gag measure for the most blatant regression. (*) the simplest is, of course, to detect a regex command and inherit the syntax for any aliases thereof; it would be nice if this also didn't show the underlying regex command name when the alias is used llvm-svn: 263523
* Lots of progress on the CommandAlias refactoringEnrico Granata2016-03-141-4/+5
| | | | | | | | | This cleans things up such CommandAlias essentially can work as its own object; the aliases still live in a separate map, but are now just full-fledged CommandObjectSPs This patch also cleans up help generation for aliases, allows aliases to vend their own help, and adds a tweak such that "dash-dash aliases", such as po, don't show the list of options for their underlying command, since those can't be provided anyway I plan to fix up a few more things here, and then add a test case and proclaim victory llvm-svn: 263499
* More of the alias refactoring work! CommandAlias is now a CommandObjectEnrico Granata2016-03-141-14/+13
| | | | llvm-svn: 263468
* Last round of preliminary cleanup in my refactoring of aliases.Enrico Granata2016-03-091-98/+3
| | | | | | | | | | | | | | The next step is to actually turn CommandAlias into a full-blown CommandObject citizen. This is tricky given the current architecture of the CommandInterpreter but I think I have found a reasonable path forward. The current plan is to make class CommandAlias : public CommandObject, and have all the several GetCommand calls not actually traverse through the alias to the underlying command object The only times that an alias will be traversed are: a) execution; when time comes to run an alias, I will just grab the underlying command and options, and make the interpreter execute that according to its current algorithm b) subcommand traversal; if one has an alias to a multiword command, grabbing a subcommand will see through to the subcommand Other operations, e.g. command listing, command names, command helps, ..., will all use the alias directly. This will, in turn, lead to the removal of the separate alias dictionary, and just mix user commands and aliases in one map llvm-svn: 262986
* Move CommandAlias to its own file; alsoEnrico Granata2016-03-081-17/+17
| | | | | | Store std::unique_ptr<CommandAlias> instead of instances llvm-svn: 262958
* Use c_str() instead of GetCString() to fix build Ewan Crawford2016-03-081-1/+1
| | | | llvm-svn: 262920
* This is actually a FileSpec, so use .GetCString() insteadEnrico Granata2016-03-081-1/+1
| | | | llvm-svn: 262914
* Use .c_str() here to unbreak the Linux buildEnrico Granata2016-03-081-1/+1
| | | | llvm-svn: 262913
* A few more improvements on the way to the command alias refactoringEnrico Granata2016-03-081-104/+96
| | | | | | | | - move alias help generation to CommandAlias, out of CommandInterpreter - make alias creation use argument strings instead of OptionArgVectorSP; the former is a more reasonable currency than the latter - remove m_is_alias from CommandObject, it wasn't actually being used llvm-svn: 262912
* Turn GetAliasOptions() into GetAlias()Enrico Granata2016-03-081-7/+14
| | | | | | | Eventually, there will be more things that CommandAlias contains, and I don't want accessors for each of them on the CommandIntepreter Eventually, we also won't pass around copies of CommandAlias, but that's for a later patch llvm-svn: 262909
* Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free ↵Enrico Granata2016-03-081-16/+0
| | | | | | template function in lldb_private llvm-svn: 262905
* Unbreak linux build broken by r262901Jason Molenda2016-03-081-1/+1
| | | | llvm-svn: 262904
* Move ProcessAliasOptionsArgs to be a static on CommandAlias; it wasn't using ↵Enrico Granata2016-03-081-58/+58
| | | | | | | | any instance data on the CommandInterpreter anyway This small step removes one piece of alias machinery from the CommandInterpreter into the CommandAlias llvm-svn: 262901
OpenPOWER on IntegriCloud