lldb

How to print out a property's contents using Xcode debugger?

感情迁移 提交于 2019-11-27 03:24:17
问题 I'm writing an iOS app and I need help using the built-in Xcode debugger. Suppose I have an object called HomeViewController that has three properties @property (nonatomic) BOOL finished; @property (nonatomic, strong) NSArray *myArray; @property (nonatomic, strong) NSString *myName; @synthesize finished = _finished, myArray = _myArray, myName = _myName; Suppose I have a breakpoint in this class. How would I view the contents of these properties? I've tried things such as po myName , print

Why can't LLDB evaluate this expression?

岁酱吖の 提交于 2019-11-27 03:22:38
问题 Neither one of these statements can be processed by LLDB... why is it unable to come up with the NSString result and print it out expr -o -- [NSString stringWithFormat:@"%@", @"Wow this doesnt work??"] po [NSString stringWithFormat:@"%@", @"Wow this doesnt work??"] 回答1: It seems that the expression command in lldb can generally not evaluate functions with variable argument lists. It fails even with a simple C function: int foo(char *msg, ...) { return 17; } (lldb) expr foo("bar") (int) $2 =

Xcode 10, LLDB: Couldn't IRGen expression

霸气de小男生 提交于 2019-11-27 03:22:21
问题 Using Xcode 10, when I stop my app using a breakpoint and try to print the content of an object in the Console, I obtain: "Couldn't IRGen expression, no additional error" However, I can see the value of the object in the Variables View panel. How can I make it evaluate my expression instead? 回答1: Thanks. I solved with rebuild carthage framework like imtx.me/archives/2719.html carthage update --platform iOS --no-use-binaries 回答2: In lldb as a workaround you can use: fr v productVersion fr v

How can I set LLDB's default language to Swift?

牧云@^-^@ 提交于 2019-11-27 03:18:11
问题 I have a large Swift project that's technically a mixed project, as it has a small amount of Objective-C code. But whenever I drop into LLDB, the expression evaluator is expecting Objective-C syntax. I can use Swift with e -l swift -- but this is tedious to type every time. Can I default the LLDB expression evaluator to Swift? 回答1: There is a target level setting to force the language: (lldb) settings set target.language swift Or you can make an alias for swift specific expressions: command

Xcode/LLDB: How to get information about an exception that was just thrown?

与世无争的帅哥 提交于 2019-11-27 02:25:34
OK, so imagine that my breakpoint in objc_exception_throw has just triggered. I'm sitting at the debugger prompt, and I want to get some more information about the exception object. Where do I find it? The exception object is passed in as the first argument to objc_exception_throw . LLDB provides $arg1 .. $argn variables to refer to arguments in the correct calling convention, making it simple to print the exception details: (lldb) po $arg1 (lldb) po [$arg1 name] (lldb) po [$arg1 reason] Make sure to select the objc_exception_throw frame in the call stack before executing these commands. See

Why does the initial call to NSAttributedString with an HTML string take over 100 times longer than subsequent calls?

寵の児 提交于 2019-11-27 01:06:48
问题 I had a need to display HTML text inside my iOS app. I have decided I will use the built-in method on NSAttributedString , initWithData:options:documentAttributes:error:. The actual parsing works excellently, however, I seem to have come across a very odd bug, that only seems to manifest itself if I have the debugger attached. The first time that this method is called, it takes barely under 1 second to run on my iPhone 5S running iOS 7.0.4, and about 1.5 seconds on an iPod Touch 5th

GDB Vs LLDB debuggers

寵の児 提交于 2019-11-26 19:07:50
问题 What is the difference between GDB & LLDB debuggers? I recently upgraded my Xcode version from 4.2 to 4.3 & started getting warning to upgrade my debugger from GDB to LLDB. 回答1: LLDB is part of the LLVM suite of tools that Apple is moving to, including Clang. There are tons of improved features, including improved performance. There's a quick intro for GDB users here: http://lldb.llvm.org/tutorial.html However... You might want to take a trip over to the forums at developer.apple.com. There's

Weird error message in Xcode 4.3 with LLDB

眉间皱痕 提交于 2019-11-26 17:06:07
问题 I am currently writing an iOS app with Xcode 4.3.2. In most parts of my code, debugging with LLDB works just fine. However at some point I am getting a strange message while stepping through my code. When I hover over an iVar, it says Error [IRForTarget]: Couldn't find Objective-C indirect ivar symbol OBJC_IVAR_$_MyFancyClass.iVar instead of showing me the value. However, in the Variables View , I can see it just fine. Until I'm selecting Print Description of ... that is, because then, Xcode

Xcode - Error creating LLDB target

纵饮孤独 提交于 2019-11-26 15:44:40
问题 I'm getting this error whenever I build in XCode 6 beta 4. It seems to be making my app insanely slow. Warning: Error creating LLDB target at path '/***/***/***/***.app'- using an empty LLDB target which can cause slow memory reads from remote devices. What exactly does this mean and how do I fix it? Thanks in advance! 回答1: Did you use Architectures=$(ARCHS_STANDARD_32_BIT) and run your app on a 64 bit device? (iPhone 5S or iPhone 5S simulator) Apple seems to be stricter with apps which don't

View array in LLDB: equivalent of GDB's '@' operator in Xcode 4.1

守給你的承諾、 提交于 2019-11-26 11:47:59
问题 I would like to view an array of elements pointed to by a pointer. In GDB this can be done by treating the pointed memory as an artificial array of a given length using the operator \'@\' as *pointer @ length where length is the number of elements I want to view. The above syntax does not work in LLDB supplied with Xcode 4.1. Is there any way how to accomplish the above in LLDB? 回答1: Actually there is a simple way to do it, by casting the pointer to a pointer-to-array. For example, if you