summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language
Commit message (Collapse)AuthorAgeFilesLines
...
* [NSDictionary] Simplify the formatter. NFCI.Davide Italiano2018-05-021-5/+1
| | | | llvm-svn: 331415
* Reflow paragraphs in comments.Adrian Prantl2018-04-3012-75/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* [DataFormatters] Implement summary for __NSDictionary0.Davide Italiano2018-03-141-0/+4
| | | | | | | | | | | | | | | | | | | Before the patch: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 After: (lldb) frame var emptyDictionary (__NSDictionary0 *) emptyDictionary = 0x0000000100304420 0 key/value pairs There's nothing much else we can do, as this is always empty by definition. <rdar://problem/34806516> llvm-svn: 327587
* [DataFormatter] Remove dead code for the NSDictionary formatter.Davide Italiano2018-03-131-10/+0
| | | | | | | I'm going to make changes in this area soon, so I figured I could clean things a bit while I was around. llvm-svn: 327445
* Fix std unique pointer pretty-printer for new stl versionsPavel Labath2018-03-081-4/+23
| | | | | | | | | | | | | | | Summary: The unique pointer layout was changed in libstdc++ 6.0.23. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: luporl, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D44015 Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>. llvm-svn: 327017
* [ObjC] Fix the NSConcreteData formatter and test itVedant Kumar2018-02-221-8/+14
| | | | | | | The length field of an NSConcreteData lives one word past the start of the object, not two. llvm-svn: 325841
* Recognize MSVC style mangling in CPlusPlusLanguage::IsCPPMangledNameAaron Smith2018-02-081-7/+11
| | | | | | | | | | | | Reviewers: zturner, lldb-commits, labath Reviewed By: zturner Subscribers: jingham, labath, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D43059 llvm-svn: 324672
* More correct handling of error cases C++ name parserEugene Zemtsov2018-02-061-2/+1
| | | | | | | | | | Now incorrect type argument that looks like T<A><B> doesn't cause an assert, but just a parsing error. Bug: 36224 Differential Revision: https://reviews.llvm.org/D42939 llvm-svn: 324380
* Disable warnings related to anonymous types in the ObjC pluginVedant Kumar2017-12-071-0/+12
| | | | | | | | | | | This part of lldb make use of anonymous structs and unions. The usage is idiomatic and doesn't deserve a warning. Logic in the NSDictionary and NSSet plugins use anonymous structs in a manner consistent with the relevant Apple frameworks. Differential Revision: https://reviews.llvm.org/D40757 llvm-svn: 320071
* Switch from C++1z to C++17; corresponds to r319688 in Clang.Aaron Ballman2017-12-041-1/+1
| | | | llvm-svn: 319694
* Fix assertion in ClangASTContextPavel Labath2017-11-301-4/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: llvm::APSInt(0) asserts because it creates an int with bit-width 0 and not (as I thought) a value 0. Theoretically it should be sufficient to change this to APSInt(1), as the intention there was that the value of the first argument should be ignored if the type is invalid, but that would look dodgy. Instead, I use llvm::Optional to denote an invalid value and use a special struct instead of a std::pair, to reduce typing and increase clarity. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40615 llvm-svn: 319414
* Add a data formatter for libc++ std::bitsetPavel Labath2017-11-144-0/+125
| | | | | | | | | | Reviewers: jingham, EricWF Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D39966 llvm-svn: 318145
* CompilerType: Add ability to retrieve an integral template argumentPavel Labath2017-11-137-22/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: Despite it's name, GetTemplateArgument was only really working for Type template arguments. This adds the ability to retrieve integral arguments as well (which I've needed for the std::bitset data formatter). I've done this by splitting the function into three pieces. The idea is that one first calls GetTemplateArgumentKind (first function) to determine the what kind of a parameter this is. Based on that, one can then use specialized functions to retrieve the correct value. Currently, I only implement two of these: GetTypeTemplateArgument and GetIntegralTemplateArgument. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39844 llvm-svn: 318040
* Update tuple/list/deque data formatters to work with newest libc++Pavel Labath2017-11-072-6/+18
| | | | | | | | | | | | | | Summary: A couple of members of these data structures have been renamed in recent months. This makes sure they still work with the latest libc++ version. Reviewers: jingham, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39602 llvm-svn: 317624
* Add data formatter for libc++ std::queuePavel Labath2017-11-014-0/+74
| | | | | | | | | | | | | | Summary: std::queue is just a fancy wrapper around another container, so all we need to do is to delegate to the it. Reviewers: jingham, EricWF Subscribers: srhines, mgorny, lldb-commits, eugene Differential Revision: https://reviews.llvm.org/D35666 llvm-svn: 317099
* Add data formatter for libc++ std::tuplePavel Labath2017-11-014-0/+91
| | | | | | | | | | Reviewers: jingham, EricWF Subscribers: srhines, eugene, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D35615 llvm-svn: 317095
* Add data formatter for libc++'s forward_listPavel Labath2017-10-313-85/+183
| | | | | | | | | | | | | | | Summary: This adds a data formatter for the implementation of forward_list in libc++. I've refactored the existing std::list data formatter a bit to enable more sharing of code (mainly the loop detection stuff). Reviewers: jingham, EricWF Subscribers: srhines, eugene, lldb-commits Differential Revision: https://reviews.llvm.org/D35556 llvm-svn: 316992
* ObjC: fix some -Wpedantic warnings by removing ';'Saleem Abdulrasool2017-08-231-3/+3
| | | | | | Remove some stray ';' that were in the source code. NFC. llvm-svn: 311577
* [Plugins/ObjC] Remove more semicolons to placate -Wpedantic. NFCI.Davide Italiano2017-08-191-3/+3
| | | | llvm-svn: 311245
* [Plugins/ObjC] Remove unneded semicolon(s) to placate GCC -Wpedantic.Davide Italiano2017-08-191-4/+4
| | | | llvm-svn: 311244
* Update NSArray/NSDictionary/NSSet formatters to handle newJason Molenda2017-08-153-467/+546
| | | | | | | | | macOS 10.13 - High Sierra - internal layouts. Patch by Sean Callanan. <rdar://problem/33282015> llvm-svn: 310959
* Enable parsing C++ names generated by lambda functions.Jim Ingham2017-07-132-0/+34
| | | | | | https://reviews.llvm.org/D34911 from Weng Xuetian. llvm-svn: 307944
* switch on enum should be exhaustive and warning-freeTim Hammerquist2017-07-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Testing the value of type_code against the closed enum TypeCodes provides statically verifiable completeness of testing. However, one branch assigns to type_code by casting directly from a masked integer value. This is currently handled by adding a default: case after checking each TypeCodes instance. This patch introduces a bool variable containing the "default" state value, allowing the switch to be exhaustive, protect against future instances not being handled in the switch, and preserves the original logic. This addresses the warning: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default] As an issue of maintainability, the bitmask on line 524 handles the current values of TypeCodes enum, but this will be invalid if the enum is extended. This patch does not address this, and a more closed conversion from cfinfoa -> TypeCodes would help protect against this. Reviewers: spyffe, lhames, sas Reviewed By: sas Subscribers: sas, lldb-commits Differential Revision: https://reviews.llvm.org/D35036 llvm-svn: 307712
* [Data formatters] Make NSSetM support both old- and new-style representationSean Callanan2017-06-301-28/+76
| | | | | | | | | | | NSSetM has two in-memory representations depending on what Foundation version is in use. This patch separates the two. rdar://33057292 Differential Revision: https://reviews.llvm.org/D34821 llvm-svn: 306773
* Fix some type-based warningsTim Hammerquist2017-06-291-2/+2
| | | | llvm-svn: 306765
* Updated the NSArray and NSDictionary formatters to support new storage formats.Sean Callanan2017-06-232-17/+493
| | | | | | | | Also un-xfailed a testcase that was affected by this. Thanks to Jason Molenda for the patch. <rdar://problem/32827216> llvm-svn: 306180
* Updated NSNumber formatter for new internal representation.Sean Callanan2017-06-192-15/+106
| | | | | | <rdar://problem/32780109> llvm-svn: 305727
* Avoid invalid string access in ObjCLanguage::MethodName::SetNameStephane Sezer2017-06-051-1/+1
| | | | | | | | | | | | | | | | | Summary: Don't access `name[1] if the string is only of length 1. Avoids a crash/assertion failure when parsing the string `-`. Test Plan: Debug a swift binary, set a breakpoint, watch lldb not crash Original change by Paul Menage <menage@fb.com> Reviewers: lldb-commits, clayborg Differential Revision: https://reviews.llvm.org/D33853 llvm-svn: 304725
* Rename Error -> Status.Zachary Turner2017-05-1219-85/+85
| | | | | | | | | | | | | | | 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
* Remove unused code related to CPlusPlusLanguage::FindEquivalentNamesPavel Labath2017-05-022-150/+0
| | | | | | | | | | | | | | | Summary: It is simply unused, and the header for it is private, so there should be no external dependencies. Reviewers: #lldb, zturner Reviewed By: zturner Subscribers: zturner, tberghammer, jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D32503 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 301903
* Fix libcxx formatters for changes in r300140.Lang Hames2017-04-263-16/+87
| | | | | | | | | | | | | | | | | | Summary: LLVM r300140 changed the layout and field names of __compressed_pair, which broke LLDB's std::vector, std::map and std::unsorted_map formatters. This patch attempts to fix these formatters by having them interogate the __compressed_pair values to determine whether they're pre- or post-r300140 variants, then access them accordingly. Reviewers: jingham, EricWF Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D32554 llvm-svn: 301493
* Use llvm::ArrayRef rather than std::vector/std::initializer lists for someLang Hames2017-04-261-1/+2
| | | | | | | | | | | ValueObject methods. Using ArrayRef allows us to remove some overloads, work with more array-like types, and avoid some std::vector temporaries. https://reviews.llvm.org/D32518 llvm-svn: 301441
* Add libc++ category to the remaining libc++ data formattersPavel Labath2017-04-121-1/+1
| | | | llvm-svn: 300054
* Fix libc++ vector<bool> data formatter (bug #32553)Pavel Labath2017-04-124-207/+142
| | | | | | | | | | | | | | | | | Summary: The iteration list through the available data formatters was undefined, which meant that the vector<bool> formatter kicked in only in cases where it happened to be queried before the general vector formatter. To fix this, I merge the two data formatter entries into one, and select which implementation to use in the factory function. Reviewers: jasonmolenda, tberghammer, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31880 llvm-svn: 300047
* New C++ function name parsing logic (Resubmit)Eugene Zemtsov2017-04-065-119/+881
| | | | | | | | | | | | | | | | | | | | | Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't get anywhere close to covering full extent of possible function declarations. It causes incorrect behavior in avoid-stepping and sometimes messes printing of thread backtrace. This change implements more methodical parsing logic based on clang lexer and simple recursive parser. Examples: void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&) void (*&std::_Any_data::_M_access<void (*)()>())() Previous version of this change (D31451) was rolled back due to an issue with Objective-C selectors being incorrectly recognized as a C++ identifier. Differential Revision: https://reviews.llvm.org/D31451 llvm-svn: 299721
* Reverting r299374 & r299402 due to testsuite failure.Jim Ingham2017-04-055-862/+119
| | | | | | | | | | | | | | This caused a failure in the test case: functionalities/breakpoint/objc/TestObjCBreakpoints.py When we are parsing up names we stick interesting parts of the names in various buckets, one of which is the ObjC selector bucket. The new C++ name parser must be interfering with this process somehow. <rdar://problem/31439305> llvm-svn: 299489
* New C++ function name parsing logicEugene Zemtsov2017-04-035-119/+862
| | | | | | | | | | | | | | | | | | Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't get anywhere close to covering full extent of possible function declarations. It causes incorrect behavior in avoid-stepping and sometimes messes printing of thread backtrace. This change implements more methodical parsing logic based on clang lexer and simple recursive parser. Examples: void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&) void (*&std::_Any_data::_M_access<void (*)()>())() Differential Revision: https://reviews.llvm.org/D31451 llvm-svn: 299374
* Stop calling ValueObject::SetName from synthetic child providersTamas Berghammer2017-03-313-14/+11
| | | | | | | | | | | | | | | Summary: Calling ValueObject::SetName from a sythetic child provider would change the underying value object used for the non-synthetic child as well what is clearly unintentional. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31371 llvm-svn: 299259
* Add support for sythetic operator dereferenceTamas Berghammer2017-03-311-1/+2
| | | | | | | | | | | | | | | | Summary: After this change a sythetic child provider can generate a special child named "$$dereference$$" what if present is used when "operator*" or "operator->" used on a ValueObject. The goal of the change is to make expressions like "up->foo" work inside the "frame variable" command. Reviewers: labath, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31368 llvm-svn: 299251
* Do not dereference std::unique_ptr by defaultTamas Berghammer2017-03-311-7/+5
| | | | | | | | | | | | | | | Summary: Displaying the object pointed by the unique_ptr can cause an infinite recursion when we have a pointer loop so this change stops that behavior. Additionally it makes the unique_ptr act more like a class containing a pointer (what is the underlying truth) instead of some "magic" class. Reviewers: labath, jingham Differential Revision: https://reviews.llvm.org/D31366 llvm-svn: 299249
* Move many other files from Core -> Utility.Zachary Turner2017-03-061-1/+1
| | | | llvm-svn: 297043
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-0414-14/+14
| | | | llvm-svn: 296943
* Move Log from Core -> Utility.Zachary Turner2017-03-031-1/+1
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Three LoadLibCxxFormatters formatters were given a regex string toJason Molenda2017-02-251-3/+3
| | | | | | | | | | match but the 'is_regex' argument was not passed as true. Not sure this is causing a bug, but noticed it while working on another bug. These formatters gained a regex in r274489 for NDK but didn't pick up the is_regex flag at the time. <rdar://problem/30646077> llvm-svn: 296243
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-1415-23/+22
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-064-14/+19
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* Move classes from Core -> Utility.Zachary Turner2017-02-0240-58/+58
| | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] [2/4] Update a batch of pluginsChris Bieneman2017-01-316-6/+56
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293699
* include Host/Time.h in Cocoa.cppPavel Labath2017-01-251-0/+1
| | | | | | | Time.h contains the necessary magic to enable timegm on all android targets. llvm-svn: 293047
* Expression evaluation for overloaded C functions (redux)Luke Drummond2016-12-192-3/+109
| | | | | | | | | | | | | | | | | | | This is a redux of [Ewan's patch](https://reviews.llvm.org/D17957) , refactored to properly substitute primitive types using a hook in the itanium demangler, and updated after the previous patch went stale The new `SubsPrimitiveParmItanium` function takes a symbol name and replacement primitive type parameter as before but parses it using the FastDemangler, which has been modified to be able to notify clients of parse events (primitive types at this point). Additionally, we now use a `set` of `ConstStrings` instead of a `vector` so that we don't try and resolve the same invalid candidate multiple times. Differential Revision: https://reviews.llvm.org/D27223 Subscribers: lldb-commits llvm-svn: 290117
OpenPOWER on IntegriCloud