summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* Update some command aliasing functions to use StringRef.Zachary Turner2016-10-052-21/+18
| | | | llvm-svn: 283385
* Convert CommandObject constructors to StringRef.Zachary Turner2016-10-056-100/+96
| | | | llvm-svn: 283384
* Convert various CommandInterpreter functions to StringRef.Zachary Turner2016-10-051-47/+40
| | | | llvm-svn: 283370
* Make lldb -Werror clean on Windows.Zachary Turner2016-10-052-5/+6
| | | | | | 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-033-222/+205
| | | | | | | Mostly this involves simplifying some logical constructs and using some ranges instead of index-based iteration. NFC llvm-svn: 283159
* Refactor the Args class.Zachary Turner2016-10-031-291/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a number of issues with the Args class preventing efficient use of strings and incoporating LLVM's StringRef class. The two biggest were: 1. Backing memory stored in a std::string, so we would frequently have to use const_cast to get a mutable buffer for passing to various low level APIs. 2. backing std::strings stored in a std::list, which doesn't provide random access. I wanted to solve these two issues so that we could provide StringRef access to the underlying arguments, and also a way to provide range-based access to the underlying argument array while still providing convenient c-style access via an argv style const char**. The solution here is to store arguments in a single "entry" class which contains the backing memory, a StringRef with precomputed length, and the quote char. The backing memory is a manually allocated const char* so that it is not invalidated when the container is resized, and there is a separate argv array provided for c-style access. Differential revision: https://reviews.llvm.org/D25099 llvm-svn: 283157
* Fix serialization of Python breakpoint commands.Jim Ingham2016-09-261-0/+13
| | | | | | | | | | | 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
* Try again to match the logic of the code before re-writing.Zachary Turner2016-09-231-1/+1
| | | | llvm-svn: 282271
* Try to fix failing TestDataFormatterSkipSummary test case.Zachary Turner2016-09-231-1/+3
| | | | llvm-svn: 282270
* Update the prompt related functions to use StringRefs.Zachary Turner2016-09-233-13/+15
| | | | llvm-svn: 282269
* Update OptionGroup::SetValue to take StringRef.Zachary Turner2016-09-2320-121/+94
| | | | | | | | 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-227-7/+7
| | | | | | | 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-2210-166/+114
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* added environment variable-related Args gtestsTodd Fiala2016-09-221-4/+6
| | | | | | | | Also fixed up a couple misbehaving functions. It is perfectly legal to have env vars with no values (i.e. the '=' and following need not be present). llvm-svn: 282171
* fix Args function broken in r281942Todd Fiala2016-09-221-1/+1
| | | | | | | | The method was hard-coded to check only the 0th element of the array. This manifested as NSLog messages behaving incorrectly on macOS. (This is independent of the broken DarwinLog feature). llvm-svn: 282128
* 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
OpenPOWER on IntegriCloud