summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language/ObjC
Commit message (Collapse)AuthorAgeFilesLines
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-131-1/+1
| | | | llvm-svn: 334614
* [ObjC] Fix the formatter for NSOrderedSet.Davide Italiano2018-05-291-28/+5
| | | | | | | | While I'm here, delete some dead code. <rdar://problem/40622096> llvm-svn: 333465
* [NSDictionary] Simplify the formatter. NFCI.Davide Italiano2018-05-021-5/+1
| | | | llvm-svn: 331415
* Reflow paragraphs in comments.Adrian Prantl2018-04-305-29/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [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
* 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
* 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
* 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-128-54/+54
| | | | | | | | | | | | | | | 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
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-048-8/+8
| | | | llvm-svn: 296943
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-149-15/+14
| | | | | | | | | | 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-061-2/+4
| | | | | | | | | | | | | | | | | | | | | 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-0216-27/+27
| | | | | | | | | | | | | | | | | | | | | | | 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-311-1/+12
| | | | | | 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
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-165-14/+14
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Make some code not manipulate the underlying string of a StreamString.Zachary Turner2016-11-151-32/+34
| | | | | | Differential Revision: https://reviews.llvm.org/D26618 llvm-svn: 287017
* Add support to the ObjC type scavenger for finding types via debug infoEnrico Granata2016-11-031-1/+14
| | | | llvm-svn: 285941
* Add helpers for the notion of a type scavenger that is "either this or that" ↵Enrico Granata2016-11-011-50/+55
| | | | | | | | source, and one that is "both this and that" source Use the helper to rewrite the ObjC type lookup logic (first modules, then runtime) in terms of an either scavenger llvm-svn: 285736
* This debugging message has been left in the code for years, until one day it ↵Enrico Granata2016-10-201-2/+1
| | | | | | | | | | randomly hit on some corrupted memory It is misleading to users in its current form, and only interesting to me - remove it rdar://28812568 llvm-svn: 284787
* Convert UniqueCStringMap to use StringRef.Zachary Turner2016-10-062-28/+39
| | | | llvm-svn: 283494
* Fix an issue where, in i386 mode, the wrong values were being copied into ↵Enrico Granata2016-09-291-2/+2
| | | | | | | | the pair object for a single-entry NSDictionary Fixes rdar://28502335 llvm-svn: 282754
* Make it so that one can register prefix matches as well as identical matches ↵Enrico Granata2016-09-202-14/+78
| | | | | | as extra cases for NSDictionary data formatting llvm-svn: 281993
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0618-5386/+5123
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Change the formula for tagged NSIndexPath data formattingEnrico Granata2016-09-011-11/+29
| | | | | | Fixes rdar://25192935 llvm-svn: 280389
* Add a non-code-running data formatter for __NSCFBooleanEnrico Granata2016-08-222-0/+39
| | | | llvm-svn: 279446
* Tweaks to the NSIndexPath formatter to enhance stabilityEnrico Granata2016-07-121-89/+118
| | | | | | rdar://problem/25767901 llvm-svn: 275199
* Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, ↵Enrico Granata2016-07-063-27/+17
| | | | | | | | | | | | | | | | synthetic children caching is a tricky area: - if a synthetic child comes from the same hierarchy as its parent object, then it can't be cached by SharedPointer inside the synthetic provider, or it will cause a reference loop; - but, if a synthetic child is made from whole cloth (e.g. from an expression, a memory region, ...), then it better be cached by SharedPointer, or it will be cleared out and cause an assert() to fail if used at a later point For most cases of self-rooted synthetic children, we have a flag we set "IsSyntheticChildrenGenerated", but we were not using it to track caching. So, what ended up happening is each provider would set up its own cache, and if it got it wrong, a hard to diagnose crash would ensue This patch fixes that by centralizing caching in ValueObjectSynthetic - if a provider returns a self-rooted child (as per the flag), then it gets cached centrally by the ValueObject itself This cache is used only for lifetime management and not later retrieval of child values - a different cache handles that (because we might have a mix of self-rooted and properly nested child values for the same parent, we can't trivially use this lifetime cache for retrieval) Fixes rdar://26480007 llvm-svn: 274683
* Add NSTaggedPointerString to the table of data formattersEnrico Granata2016-06-291-0/+1
| | | | | | Fixes rdar://27002512 llvm-svn: 274164
* Fix an issue where LLDB would show the key and value of a single entry ↵Enrico Granata2016-06-241-2/+2
| | | | | | | | NSDictionary in the wrong order Fixes rdar://26478641 llvm-svn: 273695
* It has been brought to my attention that, given two variablesEnrico Granata2016-05-251-6/+8
| | | | | | | | | | | | | | | | | T x; U y; doing x = *((T*)y) is undefined behavior, even if sizeof(T) == sizeof(U), due to pointer aliasing rules Fix up a couple of places in LLDB that were doing this, and transform them into a defined and safe memcpy() operation Also, add a test case to ensure we didn't regress by doing this w.r.t. tagged pointer NSDate instances llvm-svn: 270793
* Fix an issue where the NSDate data formatter was not using the proper ↵Enrico Granata2016-05-241-1/+3
| | | | | | | | alignment on watchOS targets Fixes rdar://problem/23298264 llvm-svn: 270621
* Add support for additional NSArray formattersEnrico Granata2016-04-112-2/+41
| | | | llvm-svn: 265979
* Add a formatter for zero-sized NSDataEnrico Granata2016-04-111-0/+4
| | | | llvm-svn: 265978
* Remove what I believe are the last known instances of formatters that run codeEnrico Granata2016-04-081-38/+22
| | | | llvm-svn: 265865
* Remove even more of the data formatters that silently run codeEnrico Granata2016-04-083-20/+0
| | | | | | Fixes <rdar://problem/25629755> llvm-svn: 265849
* Remove more of the code-running ObjC data formatter supportEnrico Granata2016-04-013-139/+40
| | | | llvm-svn: 265181
* On some platforms, the compiler is allowed to assume that BOOL == bool. On ↵Enrico Granata2016-03-151-6/+12
| | | | | | | | | | | | others, BOOL == signed char. This can cause differences in which bit patterns end up meaning YES or NO. In general, however, 0 == NO and 1 == YES. To keep it simple, LLDB will now show "YES" and "NO" only for 1 and 0 respectively, and format other values as the plain numeric value instead. Fixes rdar://24809994 llvm-svn: 263604
* Make it so that the data formatter for NSError can see through a variable of ↵Enrico Granata2016-03-152-26/+34
| | | | | | type NSError**. Fixes rdar://25060684 llvm-svn: 263603
* Fix warning in NSDictionary.cppPavel Labath2016-03-011-1/+1
| | | | llvm-svn: 262322
OpenPOWER on IntegriCloud