summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime/ObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed some linux buildbot warnings.Greg Clayton2013-04-192-5/+5
| | | | llvm-svn: 179892
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-186-26/+26
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-186-40/+42
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* <rdar://problem/13563628>Enrico Granata2013-04-052-6/+15
| | | | | | | | | | Introducing a negative cache for ObjCLanguageRuntime::LookupInCompleteClassCache() This helps speed up the (common) case of us looking for classes that are hidden deep within Cocoa internals and repeatedly failing at finding type information for them. In order for this to work, we need to clean this cache whenever debug information is added. A new symbols loaded event is added that is triggered with add-dsym (before modules loaded would be triggered for both adding modules and adding symbols). Interested parties can register for this event. Internally, we make sure to clean the negative cache whenever symbols are added. Lastly, ClassDescriptor::IsTagged() has been refactored to GetTaggedPointerInfo() that also (optionally) returns info and value bits. In this way, data formatters can share tagged pointer code instead of duplicating the required arithmetic. llvm-svn: 178897
* Fix build.Rafael Espindola2013-04-031-1/+0
| | | | | | This should fix the build breakage caused by the api change in 178663. llvm-svn: 178700
* Fixed a crash if the Objective-C runtime moduleSean Callanan2013-03-291-0/+3
| | | | | | | | | wasn't loaded into the underlying process or couldn't be found. <rdar://problem/13533671> llvm-svn: 178363
* <rdar://problem/13521159>Greg Clayton2013-03-275-17/+15
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Don't use a "uintptr_t" for the metadata key, use a "void *". This removes ↵Greg Clayton2013-03-271-4/+4
| | | | | | all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata. llvm-svn: 178113
* Change the AppleObjCTrampolineHandler to always run all threads when ↵Jim Ingham2013-03-222-1/+11
| | | | | | | | | | | resolving the target of an ObjC method call. Add a StopOthers method to AppleThreadPlanStepThroughObjCTrampoline, don't rely on the setting in the ThreadPlanToCallFunction, since that gets pushed too late to determine which threads will continue. <rdar://problem/13447638> llvm-svn: 177691
* Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_InvalidEnrico Granata2013-03-201-1/+1
| | | | llvm-svn: 177558
* This checkin removes the last Cocoa formatters that were implemented in ↵Enrico Granata2013-03-191-12/+9
| | | | | | Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters llvm-svn: 177366
* Buildbot was failing to build. I guess classes declared in implementation ↵Greg Clayton2013-03-111-3/+4
| | | | | | files are treated differently on various compilers causing a "friend class Foo;" to fail for forward declared classes in global namespace. llvm-svn: 176823
* <rdar://problem/13372857> Greg Clayton2013-03-112-0/+21
| | | | | | Fixed the exception breakpoints to always use a file filter to make setting exception breakpoint efficient. llvm-svn: 176821
* Initial checkin of a new project: LLDB Performance Testing InfrastructureEnrico Granata2013-03-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very basic implementation of a library that easily allows to drive LLDB.framework to write test cases for performance This is separate from the LLDB testsuite in test/ in that: a) this uses C++ instead of Python to avoid measures being affected by SWIG b) this is in very early development and needs lots of tweaking before it can be considered functionally complete c) this is not meant to test correctness but to help catch performance regressions There is a sample application built against the library (in darwin/sketch) that uses the famous sample app Sketch as an inferior to measure certain basic parameters of LLDB's behavior. The resulting output is a PLIST much like the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>fetch-frames</key> <real>0.13161715522222225</real> </dict> <dict> <key>file-line-bkpt</key> <real>0.029111678750000002</real> </dict> <dict> <key>fetch-modules</key> <real>0.00026376766666666668</real> </dict> <dict> <key>fetch-vars</key> <real>0.17820429311111111</real> </dict> <dict> <key>run-expr</key> <real>0.029676525769230768</real> </dict> </array> </plist> Areas for improvement: - code cleanups (I will be out of the office for a couple days this coming week, but please keep ideas coming!) - more metrics and test cases - better error checking This toolkit also comprises a simple event-loop-driven controller for LLDB, similar yet much simpler to what the Driver does to implement the lldb command-line tool. llvm-svn: 176715
* Fix clang warnings related to python macro redefinition and printf format ↵Matt Kopec2013-02-211-2/+2
| | | | | | specifiers. llvm-svn: 175829
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-212-0/+11
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* Handle the case where the runtime uses class_getMethodImplementation for ↵Jim Ingham2013-02-202-8/+140
| | | | | | | | | | both scalar and structure return methods. rdar://problem/13238168 llvm-svn: 175662
* Add a test for handling a function call that throws an exception, and make ↵Jim Ingham2013-02-141-0/+4
| | | | | | | | it work. <rdar://problem/13183944> llvm-svn: 175127
* A lot more cleanup on the AppleObjCRuntimeV2 class.Greg Clayton2013-02-132-569/+13
| | | | llvm-svn: 175106
* Cleaned up and removed unused code.Greg Clayton2013-02-132-1044/+24
| | | | llvm-svn: 175105
* <rdar://problem/13210494>Greg Clayton2013-02-133-348/+1889
| | | | | | | | | | | | | | | | | Parse objective C information as efficiently as possible and without taking dangerous runtime locks. Reworked the way objective C information is parsed by: 1 - don't read all class names up front, this is about 500K of data with names 2 - add a 32 bit hash map that maps a hash of a name to the Class pointer (isa) 3 - Improved name lookups by using the new hash map 4 - split up reading the objc runtime info into dynamic and shared cache since the shared cache only needs to be read once. 5 - When reading all isa values, also get the 32 bit hash instead of the name 6 - Read names lazily now that we don't need all names up front 7 - Allow the hash maps to not be there and still have this function correctly There is dead code in here with all of the various methods I tried. I want to check this in first to not lose any of it in case we need to revert to any of the extra code. I will promptly cleanup and commit again. llvm-svn: 175101
* Made LLDB build with the latest Clang. This meantSean Callanan2013-02-121-4/+7
| | | | | | | | | changing the ClangASTSource to return a bool instead of returning a list of results. Our testsuite mostly works with this change, but some minor issues may remain both on LLDB's side and on Clang's side. llvm-svn: 174949
* Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction ↵Jim Ingham2013-02-092-2/+2
| | | | | | | | | | | interoperate to fix problems where hitting auto-continue signals while running a thread plan would cause us to lose control of the debug session. <rdar://problem/12993641> llvm-svn: 174793
* <rdar://problem/12978143>Enrico Granata2013-01-281-1/+14
| | | | | | | | | | | Data formatters now cache themselves. This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval. Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization. The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime. Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type. Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose. llvm-svn: 173728
* Add "target.process.stop-on-shared-library-events" setting, and make it work.Jim Ingham2013-01-261-0/+1
| | | | | | | | | | | Add the ability to give breakpoints a "kind" string, and have the StopInfoBreakpoint print that in the brief description if set. Also print the kind - if set - in the breakpoint listing. Give kinds to a bunch of the internal breakpoints. We were deleting the Mac OS X dynamic loader breakpoint as though the id we had stored away was a breakpoint site ID, but in fact it was a breakpoint id, so we never actually deleted it. Fixed that. llvm-svn: 173555
* <rdar://problem/13069948>Greg Clayton2013-01-253-26/+26
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/12711206>Enrico Granata2013-01-231-4/+3
| | | | | | | | | | Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP. This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information. Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong. This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays). As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information. llvm-svn: 173216
* Fixes to the code I just committed to reflectSean Callanan2013-01-151-0/+3
| | | | | | | that we now also have to ignore breakpoints when running the expression to collect isas. llvm-svn: 172575
* Modified the Objective-C runtime to fetch Objective-CSean Callanan2013-01-152-8/+364
| | | | | | | | | | | | | | | | | | | | isas and corresponding names from the underlying process in a manner much quicker than the current approach. The current approach accesses memory in the underlying process with a random-access pattern as it walks across the data structures associated with each isa. This involves a great deal of back-and-forth with debugserver, resulting in performance problems, especially with iOS targets. The new approach attempts to run an expression in the target that collects the isas and names into two large buffers, which LLDB then collects in one shot. <rdar://problem/12914539> llvm-svn: 172574
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-153-9/+20
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* Made LLDB compile with LLVM top-of-tree again.Sean Callanan2012-12-211-2/+2
| | | | | | | | | The results from Clang name lookups changed to be ArrayRefs, so I had to change the way we check for the presence of a result and the way we iterate across results. llvm-svn: 170927
* This patch removes the SymbolFileSymtab support Sean Callanan2012-12-194-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | for reporting class types from Objective-C runtime class symbols. Instead, LLDB now queries the Objective-C runtime for class types. We have also added a (minimal) Objective-C runtime type vendor for Objective-C runtime version 1, to prevent regressions when calling class methods in the V1 runtime. Other components of this fix include: - We search the Objective-C runtime in a few more places. - We enable enumeration of all members of Objective-C classes, which Clang does in certain circumstances. - SBTarget::FindFirstType and SBTarget::FindTypes now query the Objective-C runtime as needed. - I fixed several test cases. <rdar://problem/12885034> llvm-svn: 170601
* Fix a few more clang (3.2) warnings on Linux:Daniel Malea2012-12-072-4/+4
| | | | | | | | | | | | | | | | | - remove unused members - add NO_PEDANTIC to selected Makefiles - fix return values (removed NULL as needed) - disable warning about four-char-constants - remove unneeded const from operator*() declaration - add missing lambda function return types - fix printf() with no format string - change sizeof to use a type name instead of variable name - fix Linux ProcessMonitor.cpp to be 32/64 bit friendly - disable warnings emitted by swig-generated C++ code Patch by Matt Kopec! llvm-svn: 169645
* Now that we set ThreadPlanCallFunction to private in the constructor, it is ↵Jim Ingham2012-12-071-1/+0
| | | | | | | | confusing that we set it again in client code after creating the plans. So remove those unnecessary calls. llvm-svn: 169625
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-052-0/+3
| | | | | | | | | - 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
* Cache the names for Objective-C classes if we knowSean Callanan2012-12-041-5/+5
| | | | | | | | | them while making our initial run through the Objective-C runtime's class tables. <rdar://problem/12799087> llvm-svn: 169299
* A few more build fixes for gcc 4.6:Daniel Malea2012-12-042-3/+4
| | | | | | | | - use const char* instead of char* as needed in ObjC language runtime plugin - use int to iterate through enum (operator++ on enum not defined) - use initializer list instead of inline initialization of const field llvm-svn: 169185
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-295-18/+18
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Don't return decorated (i.e., const or pointer)Sean Callanan2012-11-291-0/+4
| | | | | | | | | | versions of UnknownAnyTy for ObjectiveC value types. <unknown type>* makes no sense and can cause the parser to behave very oddly. <rdar://problem/12518999> llvm-svn: 168844
* In cases where the Objective-C ivar symbols are stripped out,Sean Callanan2012-11-153-6/+183
| | | | | | | | | | | | | | | | | expressions that refer to ivars will not work because Clang emits IR that refers to them to get the ivar offsets. However, it is possible to search the runtime for these values. I have added support for reading the relevant tables to the Objective-C runtime, and extended ClangExpressionDeclMap to query that information if and only if it doesn't find the symbols in the binary. Also added a testcase. <rdar://problem/12628122> llvm-svn: 168018
* <rdar://problem/12586350>Enrico Granata2012-11-083-5/+5
| | | | | | | | | | | | | | This commit does three things: (a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress (b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds (c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment: - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself) - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine llvm-svn: 167569
* Logging improvements for the Objective-C runtime.Sean Callanan2012-11-071-2/+14
| | | | | | | | | | | Also fixed a bug where the Objective-C runtime would not properly report that it found a class if (a) it had to build the ObjCInterfaceDecl for the class and (b) logging was enabled. <rdar://problem/12641180> llvm-svn: 167516
* Patch for issue found by Carlo Kok. Fixed a type issue where an ';' was ↵Greg Clayton2012-10-311-3/+1
| | | | | | incorrectly following an if statement. There actually isn't a need for the if statement, so it was removed. llvm-svn: 167160
* This is the first phase of supporting the DW_AT_object_pointer tag. I ↵Jim Ingham2012-10-271-3/+14
| | | | | | | | | | expanded the decl metadata so it could hold this information, and then used it to look up unfound names in the object pointer if it exists. This gets "frame var" to work for unqualified references to ivars captured in blocks. But the expression parser is ignoring this information still. llvm-svn: 166860
* Fixes to the Objective-C V2 runtime:Sean Callanan2012-10-272-28/+43
| | | | | | | | | | | - Only read the statically-defined isa table in the shared cache once. Only the dynamically-constructed isa table can change. - Ignore the statically-defined isa table if its version isn't what we expect. llvm-svn: 166856
* Changed the V1 and V2 runtimes to be able to detect when the ISA hash table ↵Greg Clayton2012-10-254-255/+467
| | | | | | has changed, and auto update as needed. llvm-svn: 166693
* Objective C cleanup. Removed an cache that was no longer needed and changes ↵Greg Clayton2012-10-231-136/+25
| | | | | | the code that gets the dynamic type and class name to use our new Objective C cache. llvm-svn: 166512
* <rdar://problem/12331741>Greg Clayton2012-10-116-276/+295
| | | | | | | | | | | | Dynamic type code must be efficient and fast. Now it is. Added ObjC v1 support for getting the complete list of ISA values. The main flow of the AppleObjCRuntime subclasses is now they must override "virtual bool UpdateISAToDescriptorMap_Impl();". This function will update the complete list of ISA values and create ClassDescriptorSP objects for each one. Now we have the complete list of valid ISA values which we can use for verification when doing dynamic typing. Refactored a bunch of stuff so that the AppleObjCRuntime subclasses don't have to implement as many functions as they used to. llvm-svn: 165730
* Someone was using vi and left a little something in the code.Greg Clayton2012-10-101-1/+1
| | | | llvm-svn: 165580
* Switched AppleObjCRuntimeV2::CreateClassDescriptorSean Callanan2012-10-101-8/+12
| | | | | | | | | | | | | | over to simply update its cache and then look up the descriptor in the cache. This is fine because the cache now builds much faster (since descriptors are minimal). Metaclasses aren't in the cache, so I switched the Describe method for class descriptors from using GetClassDescriptor to manually creating an automatic ClassDescriptorV2. llvm-svn: 165579
OpenPOWER on IntegriCloud