summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
Commit message (Collapse)AuthorAgeFilesLines
* Add support for synthetic child providers to optionally return a customized ↵Enrico Granata2016-05-021-0/+9
| | | | | | typename for display llvm-svn: 268208
* Add a --element-count option to the expression commandEnrico Granata2016-04-252-12/+46
| | | | | | | | | | | | | 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
* Remove even more of the data formatters that silently run codeEnrico Granata2016-04-081-177/+0
| | | | | | Fixes <rdar://problem/25629755> llvm-svn: 265849
* This change introduces a "ExpressionExecutionThread" to the ThreadList. Jim Ingham2016-03-121-3/+8
| | | | | | | | | | | | | | | | | | | 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
* Fix a typo in FormatCache.cpp such that the cache would potentially return ↵Enrico Granata2016-02-181-1/+1
| | | | | | an invalid format in some cases llvm-svn: 261246
* Data formatter support for libc++ std::atomic<T>Enrico Granata2016-02-121-2/+2
| | | | | | | | | | On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_" All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable Fixes rdar://24329405 llvm-svn: 260752
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-101-1/+3
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
* Fix TestDataFormatterScript for Linux.Chaoren Lin2016-01-291-5/+4
| | | | | | | | | | | | | | Summary: m_function_name will contain a dummy name for the auto-generated function from the python script on Linux. Check for script name first. Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16703 llvm-svn: 259153
* Fix a bug where LLDB would not print the name of the function that a ↵Enrico Granata2016-01-291-3/+17
| | | | | | | | scripted summary is bound to rdar://24380076 llvm-svn: 259131
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Fix some compiler warnings with MSVC 2015.Zachary Turner2016-01-131-1/+1
| | | | llvm-svn: 257671
* Fix a bug where language categories would hold on to their caches even after ↵Enrico Granata2015-12-152-4/+22
| | | | | | changes llvm-svn: 255603
* Fix a bug where one-lining display of child values would ignore the user's ↵Enrico Granata2015-12-011-1/+1
| | | | | | choice of format llvm-svn: 254349
* Reapply r253423 and r253424 (which cleanup the data formatters iteration ↵Enrico Granata2015-11-183-56/+2
| | | | | | model, as well as the type X list commands), along with a change by Zachary Turner to bypass a MSVC bug with SFINAE llvm-svn: 253493
* Revert 2 commits breaking the MSVC buildTamas Berghammer2015-11-183-2/+56
| | | | | | | | | | Revert "Remove a few vestigial typedefs from the old world" This reverts commit 05872cda2a00fbd988c4fc761b1f87fe9edce224. Revert "Cleanup the type X list commands to use the new ForEach goodness" This reverts commit 85b1d83819a22cdc9ef12f58fd4fa92b473a4f81. llvm-svn: 253455
* Cleanup the type X list commands to use the new ForEach goodnessEnrico Granata2015-11-183-56/+2
| | | | llvm-svn: 253423
* The existing logic to loop over formatters is very pre-C++11, using void* ↵Enrico Granata2015-11-143-0/+54
| | | | | | | | | batons, and function pointers, and raw memory allocations instead of safer more modern constructs This is a first pass at a cleanup of that code, modernizing the "type X clear" commands, and providing the basic infrastructure I plan to use all over More cleanup will come over the next few days llvm-svn: 253125
* Upstream some data formatter related cleanupsEnrico Granata2015-11-131-7/+18
| | | | llvm-svn: 253093
* Fix indentationEnrico Granata2015-11-131-21/+21
| | | | llvm-svn: 253089
* Introduce a way for Languages to specify whether values of "reference types" ↵Enrico Granata2015-11-101-7/+22
| | | | | | | | | | are "nil" (not pointing to anything) or uninitialized (never made to point at anything) This latter determination may or may not be possible on a per-language basis; and neither is mandatory to implement for any language Use this knowledge in the ValueObjectPrinter to generalize the notion of IsObjCNil() and the respective printout llvm-svn: 252663
* Upstream changes to the ValueObjectPrinter; nfcEnrico Granata2015-11-102-43/+147
| | | | llvm-svn: 252638
* Extend the TypeSystem's ShouldPrintAsOneLiner implementation so that the ↵Enrico Granata2015-11-091-1/+18
| | | | | | ValueObject itself also gets a say in the process; NFC llvm-svn: 252516
* Fix an issue where LLDB would truncate summaries for string types without ↵Enrico Granata2015-11-041-4/+28
| | | | | | producing any evidence thereof llvm-svn: 252018
* All instance variables start with "m_". Fix "options" to be "m_options".Greg Clayton2015-11-031-56/+56
| | | | llvm-svn: 252013
* Add a --language (-l) option to the formatter delete commands in order to ↵Enrico Granata2015-10-291-0/+8
| | | | | | | | | allow removing formatters from language categories This is slightly harder to test because formatters cannot be added to language categories, so deletions are irreversible (in a debugger run) I plan to add a test case soon, but I need to think about the right approach to obtain one llvm-svn: 251660
* Remove an unused local variableEnrico Granata2015-10-281-1/+0
| | | | llvm-svn: 251581
* Fix Clang-tidy modernize-use-override warnings in some files in source; ↵Eugene Zelenko2015-10-261-23/+27
| | | | | | other minor fixes. llvm-svn: 251309
* [SBValue] Add a method GetNumChildren(uint32_t max)Siva Chandra2015-10-211-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Along with this, support for an optional argument to the "num_children" method of a Python synthetic child provider has also been added. These have been added with the following use case in mind: Synthetic child providers currently have a method "has_children" and "num_children". While the former is good enough to know if there are children, it does not give any insight into how many children there are. Though the latter serves this purpose, calculating the number for children of a data structure could be an O(N) operation if the data structure has N children. The new method added in this change provide a middle ground. One can call GetNumChildren(K) to know if a child exists at an index K which can be as large as the callers tolerance can be. If the caller wants to know about children beyond K, it can make an other call with 2K. If the synthetic child provider maintains state about it counting till K previosly, then the next call is only an O(K) operation. Infact, all calls made progressively with steps of K will be O(K) operations. Reviewers: vharron, clayborg, granata.enrico Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D13778 llvm-svn: 250930
* Rationalization of includes in the data formatters codeEnrico Granata2015-10-2010-24/+14
| | | | llvm-svn: 250798
* Introduce the concept of a type that is meaningless without dynamic ↵Enrico Granata2015-10-201-18/+12
| | | | | | | | resolution, which are essentially placeholder types meant to appease a language's type system but do not offer any actual information to the debugger, unless further resolved This is currently meant for data formatters to know to ignore such types in caching and lookup llvm-svn: 250767
* Let Language plugins vend a default DeclPrintingHelper in case a custom one ↵Enrico Granata2015-10-193-11/+253
| | | | | | is not specified for the specific invocation llvm-svn: 250744
* Silence -Wreturn-type with gcc 5.2Saleem Abdulrasool2015-10-181-0/+1
| | | | | | The switch is fully covered, mark "default" as unreachable. NFC. llvm-svn: 250667
* Silence -Wqual-cast warnings from GCC 5.2Saleem Abdulrasool2015-10-181-2/+2
| | | | | | | | There were a number of const qualifiers being cast away which caused warnings. This cluttered the output hiding real errors. Silence them by explicit casting. NFC. llvm-svn: 250662
* Teach an old pony a few new tricks.Enrico Granata2015-10-171-25/+81
| | | | | | | | ValueObjectPrinter can now mask out pointer values during a printout; also, it supports helper functions to print declarations in different formats if needed Practically speaking however, this change is NFC as nothing yet uses it in the codebase llvm-svn: 250599
* Move TypeSummaryImpl over to LLVM-style RTTI for subclassingEnrico Granata2015-10-161-8/+10
| | | | llvm-svn: 250567
* Resubmit: RenderScript command for printing allocation contents Ewan Crawford2015-10-161-0/+2
| | | | | | | | | Previous commit r250281 broke TestDataFormatterSmartArray.py Resolved in in this patch by adding the new enum eFormatVectorOfFloat16 to FormatManager. Differential Revision: http://reviews.llvm.org/D13730 llvm-svn: 250499
* Fix build with python disabled after r249597Keno Fischer2015-10-161-5/+0
| | | | | | | | | | | | | | | Summary: r249597 introduced a usage of GetTypeSummary in lldb-mi. That function used to only be available when python is enabled. However, there is no reason for that anymore since that is now dealt with at a different abstraction layer. Reviewers: ki.stfu, evgeny777, clayborg, granata.enrico Subscribers: elehcim, brucem, lldb-commits Differential Revision: http://reviews.llvm.org/D13577 llvm-svn: 250494
* Route the preferred-display-language mechanism to the ValueObjectPrinter and ↵Enrico Granata2015-10-071-2/+3
| | | | | | actually fill in a few gaps for dynamic and synthetic values to be able to adopt this in useful ways llvm-svn: 249507
* Enable the StringPrinter to have prefixes that are strings instead of just a ↵Enrico Granata2015-10-071-5/+12
| | | | | | single character; and also introduce a comparable suffix mechanism llvm-svn: 249506
* Introduce a variant of GetSummaryAsCString() that takes a LanguageType ↵Enrico Granata2015-10-071-2/+5
| | | | | | | | argument, and use it when crafting summaries by running selectors This is the first in a series of commits that are meant to teach LLDB how to properly handle multi-language formatting of values llvm-svn: 249503
* Create a logging category that is specific to data formatters activityEnrico Granata2015-10-062-8/+8
| | | | llvm-svn: 249433
* Introduce a FormattersMatchData class which contains all the information ↵Enrico Granata2015-10-064-150/+177
| | | | | | | | that data formatters need in one place, and also allows for lazy computation of expensive chunks of information if need be This is a NFC commit that is essentially plumbing the new currency through the system llvm-svn: 249366
* Made GetScratchTypeSystemForLanguage return an error if desired.Sean Callanan2015-10-021-1/+1
| | | | | | | Also made it not store nullptrs in its TypeSystemMap, so it will retry to make the AST context if it errored out last time. llvm-svn: 249167
* Fix evaluation of unicode character arrays (char16_t[] and char32_t[])Dawn Perchik2015-09-251-0/+13
| | | | | | | | | | | | | | | | Suppose we have the UTF-16 string: char16_t[] s = u"hello"; Before this patch, evaluating the string in lldb would get: (char16_t [6]) $0 = ([0] = U+0068 u'h', [1] = U+0065 u'e', [2] = U+006c u'l', [3] = U+006c u'l', [4] = U+006f u'o', [5] = U+0000 u'\0') After applying the patch, we now get: (char16_t [6]) $0 = u"hello" Patch from evgeny.leviant@gmail.com Reviewed by: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13053 llvm-svn: 248555
* Fix covered-switch-default warning in FormatManager.Bruce Mitchener2015-09-231-1/+0
| | | | | | | | | | | | | | | | Summary: The default case doesn't need to be here as the switch covers all possible values. If there's a new "lazy bool" value added in the future, the compiler would start to warn about the new case not being covered. Reviewers: granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13084 llvm-svn: 248365
* Allow CompilerType to express a vote on whether oneliner printing should happenEnrico Granata2015-09-231-0/+17
| | | | llvm-svn: 248363
* Add {TypeSystem|CompilerType}::GetTypeForFormatters()Enrico Granata2015-09-231-1/+1
| | | | | | | | | Different type system may have different notions of attributes of a type that do not matter for data formatters matching purposes For instance, in the case of clang types, we remove some qualifiers (e.g. "volatile") as it doesn't make much sense to differentiate volatile T from T in the data formatters This new API allows each type system to generate, if needed, a type that does not have those unwanted attributes that the data formatters can then consume to generate matches llvm-svn: 248359
* TypeSystem is now a plugin interface and removed any "ClangASTContext ↵Greg Clayton2015-09-172-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | &Class::GetClangASTContext()" functions. This cleans up type systems to be more pluggable. Prior to this we had issues: - Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()" - Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem - Cleaned up Module so that it no longer has dedicated type system member variables: lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module. lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module. Now we have a type system map: typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap; TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module - Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract: class CompilerType { ... //---------------------------------------------------------------------- // Return a new CompilerType that is a L value reference to this type if // this type is valid and the type system supports L value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetLValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType that is a R value reference to this type if // this type is valid and the type system supports R value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetRValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a const modifier to this type if // this type is valid and the type system supports const modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddConstModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a volatile modifier to this type if // this type is valid and the type system supports volatile modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddVolatileModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a restrict modifier to this type if // this type is valid and the type system supports restrict modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddRestrictModifier () const; //---------------------------------------------------------------------- // Create a typedef to this type using "name" as the name of the typedef // this type is valid and the type system supports typedefs, else return // an invalid type. //---------------------------------------------------------------------- CompilerType CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const; }; Other changes include: - Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);" - Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed llvm-svn: 247953
* DataFormatters: Rename clang_type to compiler_type.Bruce Mitchener2015-09-173-21/+21
| | | | | | | | | | Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12930 llvm-svn: 247915
* Add the ability for formatter categories to be bound to one or more languagesEnrico Granata2015-09-175-14/+164
| | | | | | What that does is it restricts formatters in those categories to only match to types coming from "compatible" source languages llvm-svn: 247872
OpenPOWER on IntegriCloud