lldb

Cannot get mac os x lldb process to read the STDIN

安稳与你 提交于 2019-12-03 22:23:53
Is it me or lldb for mac os x (replacing gdb) does not allow you to pipe a file into the stdin, to be used by the process being debugged? reading the instructions there is no reference to it. I've gone through and installed gnu gdb, but would like to take advantage of what I suppose is improved lldb capability? (lldb) process launch -i <file> Should do the trick. Note you can't say: (lldb) run -i <file> since run is an alias for process launch -- so all its arguments are passed to the process being launched. There's a general "help" facility that can show you more about all the lldb commands.

Use top of tree lldb with xcode

Deadly 提交于 2019-12-03 21:28:41
I built the top of tree of lldb in /usr/local/bin and I would like to tell xcode to use this binary instead of the default one. But I can't find how/where to set this. Unfortunately this won't work. There have been a couple of API changes made to the svn repository lldb since lldb-179 was branched off (c. early December 2012) for Xcode 4.6.x. If you were to put the LLDB.framework built from current svn in /Applications/Xcode.app/Contents/SharedFrameworks/ it will cause Xcode to crash when you try to debug anything. As background, remember that lldb is really a debugger library . The lldb

LLDB does not appear to be reading my .lldbinit file on startup

烂漫一生 提交于 2019-12-03 19:56:20
问题 I have a file ~/.lldbinit with a single alias: command alias pi print (int) But when I run my app from Xcode, the alias does not work. However, if I manually enter the alias, then the alias does work: (lldb) pi 6 error: 'pi' is not a valid command. (lldb) command alias pi print (int) (lldb) pi 6 (int) $3 = 6 (lldb) This leads me to suspect that my .lldbinit file is not getting read. Or is there a different problem that I am missing? Can anyone help? 回答1: Note that ~/.lldbinit does work in

How to print memory in 0xb0987654 using lldb?

眉间皱痕 提交于 2019-12-03 18:22:30
问题 I am using LLDB, I am wondering how to print the value in the memory 0xb0987654? 回答1: Xcode has a very nice Memory Browser window, which will very nicely display the contents of memory addresses. It also lets you control byte grouping and number of bytes displayed, and move back or forward a memory page: You can access it by pressing ⌘^⌥⇧M (⌘⇧M in Xcode 9 and earlier) or Debug --> Debug Workflow --> View Memory Notice the field on its bottom left corner where you can paste the memory address

LLDB throwing auto import error in Swift Xcode project

和自甴很熟 提交于 2019-12-03 15:20:41
问题 I'm trying to use the debugger in Xcode to poke around in one of my methods. The app is pretty bare bones, just one example class at this point. When I set a breakpoint and run, the LLDB debugger pane opens in Xcode as expected. However, if I try to execute a print command to poke around in my method, I get the following error: Error in auto-import: Failed to load linked library Cocoa of module ExampleAppTests - errors: Looking for "@rpath/Cocoa.framework/Cocoa", error: not a string object

How to make lldb ignore EXC_BAD_ACCESS exception?

狂风中的少年 提交于 2019-12-03 14:41:09
问题 I am writing a program on Mac OSX depending on the sigaction/sa_handler mechanism. Run a code snippet from user and get ready to catch signals/exceptions at any time. The program works fine, but the problem is I can't debug it with lldb. lldb seems not being able to ignore any exceptions even I set proc hand -p true -s false SIGSEGV proc hand -p true -s false SIGBUS The control flow stops at the instruction that triggers the exception and does not jump to the sa_handler I installed earlier

Dump memory in lldb

二次信任 提交于 2019-12-03 14:24:14
As stated on this site. When I want to dump memory in gdb. The start point is 0x1000 and end 0x2000 . For lldb start is 0x1000 and end 0x1200 . Is there a reason for this or is just a mistake ? Main question is: How do I dump a memory area from 0x1000 to 0x2000 in lldb? The following works fine for me: (lldb) memory read --outfile /tmp/mem.txt 0x6080000fe680 0x6080000fe680+1000 Dumps 1000 bytes of memory, from the given start address, in hex format, to /tmp/mem.txt. Use --binary for binary format. You could also use 'count' to state how many bytes you want to dump: (lldb) memory read --outfile

XCode's po command has stopped working

核能气质少年 提交于 2019-12-03 14:23:18
问题 At some point during my work, XCode's po and p commands stopped working. No matter what I enter, it doesn't generate output: (gdb) po self (gdb) po [self name] (gdb) po [UITableView class] (gdb) po @"Hello" (gdb) p indexPath.row (gdb) print indexPath.row (gdb) po fjkldsjflksdjklwjfkljfkldsjflk (gdb) When I enter any of these commands, the command line just goes to the next line, where it prints the blue (gdb) , but no output. I tried the following steps: Restart XCode, restart my Macbook

debug: Obtain a list of all instance variables of an object (unknown type)

不羁的心 提交于 2019-12-03 13:36:28
问题 Is there any method to obtain (via debug) a list of all instance variables of an unknown object in Objective-c? I use lldb for debug, but I admit that I don't know it very well. Obviously I can't look at the header of this unknown object. I need to do it at debug time, but if it's not possible I can use an alternative at runtime. I've found this post: How do I list all fields of an object in Objective-C? but, as I understand, I need to have a known Class (I need the headers of the object) Any

Debugger's “p” and “po” commands in Xcode?

雨燕双飞 提交于 2019-12-03 13:31:38
问题 Example. I write the following string in my old project and a new, clear one: UIInterfaceOrientation k = [UIApplication sharedApplication].statusBarOrientation; Console input-output for a clear project: (lldb) po k UIInterfaceOrientationLandscapeLeft And something awful in my old project if I write "po k" - a list of useless integers. Additionally I can't print most of objects in the new project. 回答1: I don't know what is going on in your case, but just so folks are clear on the difference