lldb

Printing/Debugging libc++ STL with Xcode/LLDB

对着背影说爱祢 提交于 2019-11-28 15:20:33
问题 I'm trying to use LLDB within Xcode 8 to debug very basic STL. I used to be able to print a vector like this: p myvector[0] to see whatever was in the first vector index. Now when I do that, I get this error: error: Couldn't lookup symbols: __ZNSt3__16vectorI9my_classNS_9allocatorIS1_EEEixEm Instead, I have to type this: p myvector.__begin_[0] in order to get any output. I tried importing the libcxx.py and unordered_multi.py scripts from the LLDB svn repository but that doesn't seem to change

llvm reports: unsupported inline asm: input with type 'void *' matching output with type 'int'

拜拜、爱过 提交于 2019-11-28 12:56:50
问题 I have the below inline assembly code: int get_year(int a, int *b, char * c) { int ret, t1, t2; asm ( "addl %3, %[a] \n\t" "movl %[a], %[t1] \n\t" "movl $58, %%edx \n\t" "movb %%dl, 0x04(%1) \n\t" : [t1] "=r" (t1), "=&D" (t2) : [a] "r" (a), "rm" (*b), "1" (c) : "edx", "memory" ); ret = t1; return ret; } When I compile this via llvm, error dumps: error: unsupported inline asm: input with type 'char *' matching output with type 'int' : [a] "r" (a), "rm" (*b), "1" (c) ^ However, the memcpy

lldb Xcode: error: 'printf' is not a valid command

独自空忆成欢 提交于 2019-11-28 11:09:47
问题 I am using Xcode 4.3.3 and I want to set symbolic endpoints. I created a symbolic breakpoint for all objc_msgSend symbols and I wanted to combine it with a "Debugger output". I followed the tips of this post in SO. However in my debugger the message error: 'printf' is not a valid command. appears. Any clue? I want for every function call a message [Class method] to be printed in the debugger area. Like this [UIApplication sharedApplication] [UIApplication _isClassic] [NSCFString getCString

iOS App crashing before entering main() with Xcode 4.2 & iOS 5

吃可爱长大的小学妹 提交于 2019-11-28 10:57:06
Background After upgrading xcode4.1 / ios4 to xcode4.2 / ios5 I am experiencing crashes while the App is loading and before it even enters main() . I have set a break point in main() but it is never reached. Compiling the project in Xcode 4.1 with a Base SDK of 4.3 works fine on iOS 4.x and iOS 5. Compiling the same project in Xcode 4.2 with a Base SDK of 5.0 works fine on 4.x but crashes in iOS 5, both on the simulator and on a device. Simulator Crash Crashes with EXC_BAD_ACCESS List of calls, all system calls, not even the main() has not been called yet. My best guess is a problem loading a

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

这一生的挚爱 提交于 2019-11-28 09:57:57
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 myName and print [self myName] but I can't figure out how to do this. I've tried using LLDB but I keep

lldb python basic - print value of a global array while inside a breakpoint in a function

会有一股神秘感。 提交于 2019-11-28 09:57:46
问题 (Some background: I am not experienced with lldb or python and don't work on them frequently, but currently need to make some basic scripts for debugging an iphone program) I am currently stopped at a breakpoint in side a function, and want to check the value of an array that has been accessed inside this function This array is declared as Float32 my_array[128]; and has global scope. I can view the array using print command, but I would like to make a python script so that I have more control

Why can't LLDB evaluate this expression?

丶灬走出姿态 提交于 2019-11-28 09:56:32
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??"] 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 = 17 (lldb) expr foo("bar", 2) error: no matching function for call to 'foo' note: candidate function not

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

江枫思渺然 提交于 2019-11-28 09:56:23
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? 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 alias es expression -l swift -- 来源: https://stackoverflow.com/questions/37390238/how-can-i-set-lldbs-default

lldb objc_msgSend tracing on OS X

折月煮酒 提交于 2019-11-28 06:07:41
问题 I'm tracing a OS X application, I hope can find a way like this way on iOS: lldb Xcode: error: 'printf' is not a valid command Is there a way to do like this? I tried expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) I think OS X is used 64bit registers. So this command cann't work(Indeed, it doesn't work). How should I write this command? Or there is a simple way to do the same? Just tracing the class and method called 回答1: The

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

此生再无相见时 提交于 2019-11-28 05:54:39
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 generation. The quirk also manifests itself on the simulator, but it is significantly less noticeable, due to