summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix an incorrect nullptr conversion.Zachary Turner2016-09-211-1/+1
| | | | llvm-svn: 282117
* Make lldb::Regex use StringRef.Zachary Turner2016-09-213-10/+11
| | | | | | | | | | This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079
* Convert 3 more functions to use a StringRef.Zachary Turner2016-09-194-59/+29
| | | | | | | | 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-197-53/+41
| | | | | | | | | | | | | | | 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
* Convert many functions to use StringRefs.Zachary Turner2016-09-174-32/+23
| | | | | | | | | | | | | Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
* Add unit tests for a few string conversion functions in Args.Zachary Turner2016-09-163-44/+31
| | | | | | | Also provided a StringRef overload for these functions and have the const char* overloads delegate to the StringRef overload. llvm-svn: 281764
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0646-12316/+10740
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Revert r280137 and 280139 and subsequent build fixesPavel Labath2016-08-311-18/+6
| | | | | | | | | | The rewrite of StringExtractor::GetHexMaxU32 changes functionality in a way which makes lldb-server crash. The crash (assert) happens when parsing the "qRegisterInfo0" packet, because the function tries to drop_front more bytes than the packet contains. It's not clear to me whether we should consider this a bug in the caller or the callee, but it any case, it worked before, so I am reverting this until we can figure out what the proper interface should be. llvm-svn: 280207
* A few minor stylistic cleanups in StringExtractor.Zachary Turner2016-08-301-6/+18
| | | | | | | | | | | Makes Peek() return a StringRef instead of a const char*. This leads to a few callers of Peek() being able to be made a little nicer (for example using StringRef member functions instead of c-style strncmp and related functions) and generally safer usage. llvm-svn: 280139
* Fix fallout from the GetNameColonValue() refactor (r280000)Pavel Labath2016-08-301-8/+9
| | | | | | This fixes the linux test suite. llvm-svn: 280074
* Convert GetNameColonValue to return StringRefs.Zachary Turner2016-08-291-50/+53
| | | | | | | | | | | | StringExtractor::GetNameColonValue() looks for a substring of the form "<name>:<value>" and returns <name> and <value> to the caller. This results in two unnecessary string copies, since the name and value are not translated in any way and simply returned as-is. By converting this to return StringRefs we can get rid of hundreds of string copies. llvm-svn: 280000
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-191-1/+45
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-191-45/+1
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-191-1/+45
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-1119-97/+160
| | | | | | | | | | | | | | | | 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
* Delete Host/windows/win32.hZachary Turner2016-08-092-3/+4
| | | | | | | | | | | | | | | | | | | 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
* If x/i is followed by x/g, the format should be reset to 'x'.Jim Ingham2016-07-201-4/+22
| | | | | | | | | Otherwise, you have to say "x/gx" to what you obviously intended to happen to happen. <rdar://problem/27415507> llvm-svn: 276132
* LLDB help content has accumulated over time without a recent attempt toKate Stone2016-07-143-216/+169
| | | | | | | | | 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 command-line LLDB so NSLog messages show upTodd Fiala2016-07-141-0/+41
| | | | | | | | | | | Changes to the underlying logging infrastructure in Fall 2016 Darwin OSes were no longer showing up NSLog messages in command-line LLDB. This change restores that functionality, and adds test cases to verify the new behavior. rdar://26732492 llvm-svn: 275472
* 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
* When calling "settings set target.source-map <old-path> <new-path>", make ↵Greg Clayton2016-07-081-14/+66
| | | | | | | | | | sure that <new-path> exists before accepting it as a remapping. We had some clients that had added old source paths remappings to their .lldbinit files and they were causing trouble at a later date. This fix should help mitigate these issues. <rdar://problem/26358860> llvm-svn: 274948
* Allows "experimental" settings that will either route to their containingJim Ingham2016-07-061-2/+17
| | | | | | | | | | | | | | settings or raise no error if not found. From time to time it is useful to add some setting to work around or enable a transitory feature. We've been reluctant to remove them later because then we will break folks .lldbinit files. With this change you can add an "experimental" node to the settings. If you later decide you want to keep the option, just move it to the level that contained the "experimental" setting and it will still be found. Or just remove it - setting it will then silently fail and won't halt the .lldbinit file execution. llvm-svn: 274593
* Validate the option index before trying to access an array element using it ↵Enrico Granata2016-06-291-0/+7
| | | | | | - OptionArgElement can potentially use negative indices to mean interesting, but non option, states llvm-svn: 274159
* Implement ProcessInfo::Dump(), log gdb-remote stub launchTodd Fiala2016-05-311-5/+8
| | | | | | | | | | | | | | | | | | This change implements dumping the executable, triple, args and environment when using ProcessInfo::Dump(). It also tweaks the way Args::Dump() works so that it prints a configurable label rather than argv[{index}]={value}. By default it behaves the same, but if the Dump() method with the additional arg is provided, it can be overridden. The environment variables dumped as part of ProcessInfo::Dump() make use of that. lldb-server has been modified to dump the gdb-remote stub's ProcessInfo before launching if the "gdb-remote process" channel is logged. llvm-svn: 271312
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-192-8/+9
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-12/+9
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* 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-252-1/+13
| | | | | | | | | | | | | 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
* Improve the way LLDB escapes arguments before passing them to the shellEnrico Granata2016-04-041-3/+31
| | | | | | | | | | | | | Teach LLDB that different shells have different characters they are sensitive to, and use that knowledge to do shell-aware escaping This helps solve a class of problems on OS X where LLDB would try to launch via sh, and run into problems if the command line being passed to the inferior contained such special markers (hint: the shell would error out and we'd fail to launch) This makes those launch scenarios work transparently via shell expansion Slightly improve the error message when this kind of failure occurs to at least suggest that the user try going through 'process launch' directly Fixes rdar://problem/22749408 llvm-svn: 265357
* Fix an issue with nested aliases where the help system wouldn't correctly ↵Enrico Granata2016-03-251-0/+11
| | | | | | | | track the fact that an alias is an alias to a dash-dash alias (and I hope I typed the word 'alias' enough times in this commit message :-) llvm-svn: 264468
* Change 'apropos' such that it doesn't look into the "long help/syntax" ↵Enrico Granata2016-03-232-45/+59
| | | | | | | | | | 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-223-37/+54
| | | | | | 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-222-2/+22
| | | | | | 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
* Improve the way we decide whether an alias is a dashdash aliasEnrico Granata2016-03-151-1/+2
| | | | llvm-svn: 263519
* This was printing arguments twice in dash-dash aliases; don't do thatEnrico Granata2016-03-151-24/+24
| | | | llvm-svn: 263517
* Lots of progress on the CommandAlias refactoringEnrico Granata2016-03-144-135/+255
| | | | | | | | | 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-142-26/+53
| | | | llvm-svn: 263468
* This change introduces a "ExpressionExecutionThread" to the ThreadList. Jim Ingham2016-03-121-0/+25
| | | | | | | | | | | | | | | | | | | Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on behalf of the expression parser was using the currently selected thread. But sometimes, e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread we're running on, we instead set the context for the interpreter, and explicitly pass that to other callers. That wasn't getting communicated to these utility expressions, so they would run on some other thread instead, and that could cause a variety of subtle and hard to reproduce problems. I also went through the commands and cleaned up the use of GetSelectedThread. All those uses should have been trying the thread in the m_exe_ctx belonging to the command object first. It would actually have been pretty hard to get misbehavior in these cases, but for correctness sake it is good to make this usage consistent. <rdar://problem/24978569> llvm-svn: 263326
* Last round of preliminary cleanup in my refactoring of aliases.Enrico Granata2016-03-092-98/+115
| | | | | | | | | | | | | | 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
* Add CommandAlias.cpp to CMakeListsEnrico Granata2016-03-081-0/+1
| | | | llvm-svn: 262959
* Move CommandAlias to its own file; alsoEnrico Granata2016-03-082-17/+28
| | | | | | 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-082-105/+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
OpenPOWER on IntegriCloud