lldb

Writing a Python script to print out an array of recs in lldb

梦想与她 提交于 2019-12-01 12:40:43
I need help with the SBValue class used in the lldb Python module which is used for creating scripts for lldb debugging sessions. I am in the process of porting my kext test and debug system from gdb to lldb so I can start using the latest version of Xcode and Mac OS 10.9.1 . Part of this process is rewriting my gdb debug scripts in python so they can be used with lldb. I have the two mac setup working, can drop into lldb and poke around in the kernel of the victim Mac. I can also my Python script to be called when I am running an lldb session. I'm stuck though in that I am unable to figure

How do you change the display format of floats & doubles in Xcode debug window?

醉酒当歌 提交于 2019-12-01 08:56:18
问题 Im debugging C in Xcode and setting breakpoints in functions to examine the value of various doubles. Xcode insists on displaying them using scientific notation, which is a real pain. I need to see a decimal representation. The right click "View Value" menu option of Decimal , does weird things. Anyone have any idea how to get this to play nice short of printf'n everything I want to see?? 回答1: Check out the LLDB Variable Formatting documentation, specifically the Type Format section near the

I can't get this simple LLDB alias to work

倖福魔咒の 提交于 2019-12-01 07:54:26
I want to create an LLDB alias ps, such that ps foo becomes print [self foo] I've been watching the LLDB talk (WWDC session 321 on iTunes), and based on that, it looks like the alias to do that should be this one: command alias ps print [ self %1 ] but it doesn't work. Here I've given my app delegate a simple "count" method that returns an integer: (lldb) command alias ps print [ self %1 ] (lldb) ps count error: invalid operands to binary expression ('AppDelegate *' and 'int') error: 1 errors parsing expression (lldb) print [ self count ] (int) $6 = 2 (lldb) What am I missing? It seems

I can't get this simple LLDB alias to work

怎甘沉沦 提交于 2019-12-01 05:27:19
问题 I want to create an LLDB alias ps, such that ps foo becomes print [self foo] I've been watching the LLDB talk (WWDC session 321 on iTunes), and based on that, it looks like the alias to do that should be this one: command alias ps print [ self %1 ] but it doesn't work. Here I've given my app delegate a simple "count" method that returns an integer: (lldb) command alias ps print [ self %1 ] (lldb) ps count error: invalid operands to binary expression ('AppDelegate *' and 'int') error: 1 errors

“return” from method while stepping?

你说的曾经没有我的故事 提交于 2019-12-01 02:57:24
I would like to exit out the current method that I'm stepping through. -(void)helloWorld { NSLog(@"Hello"); // I would like to return here, so that "World" isn't printed. NSLog(@"World"); } I have tried the following, but without luck. (lldb) expr return <no result> Is this possible with lldb? When you are debugging using Xcode and when your program is paused at a breakpoint, you can drag the little green arrow to any other line in the function. E.g. in the following code: if I want to skip the NSLog(@"B") , I can simply drag the green arrow from line 20 to line 23, which means the function

Xcode equivalent of Visual Studio's “Find Source”

回眸只為那壹抹淺笑 提交于 2019-12-01 00:53:22
I am developing on a Qt project, and have installed Qt from their installer onto my computer. In Visual Studio it is simple to debug-step into Qt sources: when I enter a function in an unknown file, it will open a file browser to let me locate the original Qt source code. Is there an equivalent function in Xcode or LLDB? Jim Ingham The debug information records the location of the QT source files when they were built. You can find this information by doing: (lldb) image lookup -va main Address: hello[0x0000000100000f40] (hello.__TEXT.__text + 0) Summary: hello`main at hello.c:5 Module: file =

Why sometimes 'self' isn't available while debugging with lldb?

只愿长相守 提交于 2019-11-30 17:33:48
A lot of time (when it's not every time) I got the following error when I try to print objects on lldb. Is there some build/debug configuration to change or is this an error inside lldb? (lldb) po userLevel error: warning: Stopped in an Objective-C method, but 'self' isn't available; pretending we are in a generic context error: use of undeclared identifier 'userLevel' error: 1 errors parsing expression I build with llvm and do not strip debug symbols. Edit: Here is the backtrace: (lldb) bt * thread #1: tid = 0x1c03, 0x001169c5 FanCake-Beta`-[KWUserLevelController addPoints:](, _cmd=0x0029187b

How to view value of Swift “let” constant in Xcode 6 debugger

点点圈 提交于 2019-11-30 14:19:14
When I'm stopped in the debugger in Xcode 6, how can I view the value of a local Swift constant declared with let ? If I create a brand new Swift project in Xcode 6 and add the following two lines to application(_:didFinishLaunchingWithOptions:) in the app delegate: let someConstant = 5 var someVariable = 6 …then run the app and break immediately after these lines, this is what I see in the variables view of the debugger: Why does the variable display its value, while the constant does not? (And why is the constant listed twice?) If, in the LLDB console, I try p , po , or fr v on someConstant

How to match precompiled static library's debugging symbols to source code with Xcode 5?

╄→гoц情女王★ 提交于 2019-11-30 14:09:48
I have to compile FFmpeg for iOS using an external build script , but when I am debugging I see assembler if I delve too deep into libavformat library functions: 0x109a73: cmpl $0, 1192(%ebp) 0x109a7a: jns 0x109a86 ; mov_write_header + 198 at movenc.c:3539 0x109a7c: movl $1, 1192(%ebp) 0x109a86: movl 16(%ebp), %eax 0x109a89: cmpl $0, 84(%eax) 0x109a8d: movl %edx, %ecx 0x109a8f: jne 0x109ad9 ; mov_write_header + 281 at movenc.c:3548 0x109a91: testb $2, 48(%ecx) 0x109a95: jne 0x109ac1 ; mov_write_header + 257 at movenc.c:3541 There are clear debugging symbols left behind which would lead me to

Cannot get lldb to read file input

风格不统一 提交于 2019-11-30 12:26:50
问题 I'm using lldb as a standalone debugger in OSX. I'm trying to debug a C executable, using a text file as input. The lldb documentation specifies the following command for changing stdin to a given file: process launch -i <file> Using this command, lldb seems to ignore the specified file, instead waiting for keyboard input. Is this intended behaviour? If so; what do I need to do to actually get the process to operate on my wanted input file? tl;dr: How do I get lldb to imitate a standard