summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ValueObjectDisplay] Generalize the description of an option.Davide Italiano2019-10-291-1/+1
|
* [lldb][NFC] Remove dead code that is supposed to handle invalid command optionsRaphael Isemann2019-08-221-2/+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
* 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-21/+19
| | | | | | | | llvm::ArrayRef Differential Revision: https://reviews.llvm.org/D49017 llvm-svn: 343130
* Move Args::StringTo*** functions to a new OptionArgParser classPavel Labath2018-04-101-4/+5
| | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | 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-1/+1
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Break some dependencies in lldbUtility.Zachary Turner2017-02-011-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D29359 llvm-svn: 293806
* 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 OptionGroup::SetValue to take StringRef.Zachary Turner2016-09-231-22/+26
| | | | | | | | 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-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+4
| | | | | | | | | | | | | | | 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-173/+191
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-111-8/+11
| | | | | | | | | | | | | | | | 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
* Add a --element-count option to the expression commandEnrico Granata2016-04-251-1/+11
| | | | | | | | | | | | | 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
* Add a more tweakable way for ValueObjectPrinter to control pointer ↵Enrico Granata2015-07-271-1/+1
| | | | | | expansion. NFC. llvm-svn: 243301
* 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
* Moved Args::StringToXIntYZ to StringConvert::ToXIntYZVince Harron2015-01-151-3/+4
| | | | | | | | | | The refactor was motivated by some comments that Greg made http://reviews.llvm.org/D6918 and also to break a dependency cascade that caused functions linking in string->int conversion functions to pull in most of lldb llvm-svn: 226199
* Do some cleanup of DumpValueObjectOptions. The whole concept of raw printing ↵Enrico Granata2014-11-211-1/+1
| | | | | | was split between feature-specific flags, and an m_be_raw flag, which then drove some other changes in printing behavior. Clean that up, so that each functionality has its own flag .. oh, and make the bools all go in a bitfield since I may want to add more of those over time llvm-svn: 222548
* Add a -V <bool> flag to frame variable/expression that enables execution of ↵Enrico Granata2014-09-061-0/+11
| | | | | | type validators. The jury is still out on what the user experience of type validators should be, so for now gate it on a specific flag. The mode I am using is prefix variables that fail to validate with a bang, and then emitting the actual validation error on a separate line. Of course, given the total absence of validators, this should never actually happen to you llvm-svn: 217303
* Revert "Fix broken tests due to new error output."Zachary Turner2014-07-091-12/+12
| | | | | | | This reverts commit ec7c94f8e6860968d384b578e5564a9c55c80b4a and re-enables OptionValidators. llvm-svn: 212627
* Fix broken tests due to new error output.Todd Fiala2014-07-081-12/+12
| | | | | | | | | | | 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-12/+12
| | | | | | | | | | | | | | | | | | 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
* Switch NULL to C++11 nullptr in source/InterpreterEd Maste2014-04-201-12/+12
| | | | | | Patch by Robert Matusewicz llvm-svn: 206711
* <rdar://problem/14393032>Enrico Granata2013-09-301-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DumpValueObject() 2.0 This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command: - expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull) When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in (lldb) expr -O -v -- foo (id) $0 = 0x000000010010baf0 { 1 = 2; 2 = 3; } When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in (lldb) expr -O -- foo { 1 = 2; 2 = 3; } - for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display (lldb) po 5 5 -v also works in this mode (lldb) expr -O -vfull -- 5 (int) $4 = 5 On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed Test case to follow llvm-svn: 191694
* Add OptionParser.hVirgile Bello2013-09-051-11/+11
| | | | llvm-svn: 190063
* Our commands that end up displaying a ValueObject as part of their workflow ↵Enrico Granata2013-03-261-0/+33
| | | | | | | | | | | use OptionGroupValueObjectDisplay as their currency for deciding the final representation ValueObjects themselves use DumpValueObjectOptions as the currency for the same purpose The code to convert between these two units was replicated (to varying degrees of correctness) in several spots in the code This checkin provides one and only one (and hopefully correct :-) entry point for this conversion llvm-svn: 178044
* Option changes:Enrico Granata2012-12-121-11/+11
| | | | | | | | | | | | | | | | | the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command. All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o) This is a breaking change: frame variable used --objc as the long option name expression used -o as a shortcut memory read uses --objd as the long option name Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works The test suite has been tweaked accordingly. llvm-svn: 169961
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-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
* <rdar://problem/12798131> Greg Clayton2012-12-041-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
* Some more typing-related fixes.Filipe Cabecinhas2012-09-111-1/+1
| | | | llvm-svn: 163638
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-3/+2
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* <rdar://problem/11576169> Better documentation string for the -Y option to ↵Enrico Granata2012-08-081-1/+1
| | | | | | frame variable llvm-svn: 161464
* Include llvm/ADT/STLExtras.h from lldb/Utility/Utils.h and use ↵Johnny Chen2012-05-151-1/+1
| | | | | | llvm::array_lengthof(), instead. llvm-svn: 156876
* A simple fix for the GDB format strings so the byte size parameter getsGreg Clayton2011-10-261-0/+1
| | | | | | | | | | | | | properly marked as valid. Also modified the "memory read" command to be able to intelligently repeat subsequent memory requests, so now you can do: (lldb) memory read --format hex --count 32 0x1000 Then hit enter to keep viewing the memory that follows the last valid request. llvm-svn: 143015
* Cleaned up many error codes. For any who is filling in error strings intoGreg Clayton2011-10-261-5/+5
| | | | | | | | | | | | | lldb_private::Error objects the rules are: - short strings that don't start with a capitol letter unless the name is a class or anything else that is always capitolized - no trailing newline character - should be one line if possible Implemented a first pass at adding "--gdb-format" support to anything that accepts format with optional size/count. llvm-svn: 142999
* Re-organized the contents of RangeMap.h to be more concise and also allow ↵Greg Clayton2011-10-071-5/+2
| | | | | | | | | | for a Range, RangeArray, RangeData (range + data), or a RangeDataArray. We have many range implementations in LLDB and I will be converting over to using the classes in RangeMap.h so we can have one set of code that does ranges and searching of ranges. Fixed up DWARFDebugAranges to use the new range classes. Fixed the enumeration parsing to take a lldb_private::Error to avoid a lot of duplicated code. Now when an invalid enumeration is supplied, an error will be returned and that error will contain a list of the valid enumeration values. llvm-svn: 141382
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* Refactoring: replace a bunch of static array size computation or hardcoded ↵Johnny Chen2011-09-101-3/+2
| | | | | | | | constant with a template function 'arraysize(static_array)', defined in Utils.h. llvm-svn: 139444
* *Some more optimizations in usage of ConstStringEnrico Granata2011-08-121-10/+13
| | | | | | | | | | | | *New setting target.max-children-count gives an upper-bound to the number of child objects that will be displayed at each depth-level This might be a breaking change in some scenarios. To override the new limit you can use the --show-all-children (-A) option to frame variable or increase the limit in your lldbinit file *Command "type synthetic" has been split in two: - "type synthetic" now only handles Python synthetic children providers - the new command "type filter" handles filters Because filters and synthetic providers are both ways to replace the children of a ValueObject, only one can be effective at any given time. llvm-svn: 137416
* CFString.py now shows contents in a more NSString-like way (e.g. you get ↵Enrico Granata2011-08-091-1/+5
| | | | | | | | | | @"Hello" instead of "Hello") new --raw-output (-R) option to frame variable prevents using summaries and synthetic children other future formatting enhancements will be excluded by using the -R option test case enhanced to check that -R works correctly llvm-svn: 137185
* when typing a summary string you can use the %S symbol to explicitly ↵Enrico Granata2011-07-221-2/+9
| | | | | | | | | | | | | | | indicate that you want the summary to be used to print the target object (e.g. ${var%S}). this might already be the default if your variable is of an aggregate type new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset - the restricted list of children obeys the typical rules (e.g. summaries prevail over children) - one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible - to provide a synthetic children list use the "type synth add" command, as in: type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4] (you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported) - a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones llvm-svn: 135731
* Some descriptive text for the Python script feature:Enrico Granata2011-07-161-9/+19
| | | | | | | | | | | | | | | - help type summary add now gives some hints on how to use it frame variable and target variable now have a --no-summary-depth (-Y) option: - simply using -Y without an argument will skip one level of summaries, i.e. your aggregate types will expand their children and display no summary, even if they have one. children will behave normally - using -Y<int>, as in -Y4, -Y7, ..., will skip as many levels of summaries as given by the <int> parameter (obviously, -Y and -Y1 are the same thing). children beneath the given depth level will behave normally -Y0 is the same as omitting the --no-summary-depth parameter entirely This option replaces the defined-but-unimplemented --no-summary llvm-svn: 135336
* Headers have been moved to /includes/lldb/Interpreter. This patchJohnny Chen2011-05-131-2/+2
| | | | | | | | reflects this change. Marco Minutoli <mminutoli@gmail.com> llvm-svn: 131306
* Change "frame var" over to using OptionGroups (and thus the ↵Jim Ingham2011-05-041-2/+25
| | | | | | | | | OptionGroupVariableObjectDisplay). Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target, and dynamic with running target. llvm-svn: 130832
* Added the ability to specify dumping options (show types, show location,Greg Clayton2011-04-281-14/+11
| | | | | | | depth control, pointer depth, and more) when dumping memory and viewing as a type. llvm-svn: 130436
* Added a new OptionValue subclass for lldb::Format: OptionValueFormat. AddedGreg Clayton2011-04-271-0/+106
new OptionGroup subclasses for: - output file for use with options: long opts: --outfile <path> --append--output short opts: -o <path> -A - format for use with options: long opts: --format <format> - variable object display controls for depth, pointer depth, wether to show types, show summary, show location, flat output, use objc "po" style summary. Modified ValueObjectMemory to be able to be created either with a TypeSP or a ClangASTType. Switched "memory read" over to use OptionGroup subclasses: one for the outfile options, one for the command specific options, and one for the format. llvm-svn: 130334
OpenPOWER on IntegriCloud