lldb

Is there a “TUI” mode for standalone lldb?

折月煮酒 提交于 2019-12-03 04:08:40
问题 Since gdb is getting onerous to work with on a Mac these days (at least I feel like I am fighting uphill against Apple), I've started to play around with lldb. Is there an equivalent mode to gdb -tui that shows a nice, persistent view of the source and where you are in it when running lldb standalone from the command line? Obviously, in Xcode, there is such a display, but I deploy most of my code to Linux boxes eventually and would prefer to use the same development environment on both

Setting disassembly flavour to Intel in LLDB

大兔子大兔子 提交于 2019-12-03 03:47:06
问题 Is there a way to set the disassembly flavour like there is in GDB within LLDB so that it spits out Intel style assembly rather than AT&T style? set disassembly-flavor intel # GDB but for LLDB. 回答1: No, not yet. Intel format disassembly is a feature I'm sure will be implemented eventually, but I don't think anyone is working on it today. UPDATE : the ability to select the assembly style was added to the top of tree sources (v. http://lldb.llvm.org ) March 1st, 2013 with the -F or --flavor

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

偶尔善良 提交于 2019-12-03 03:37:57
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 suggestion? Ramy Al Zuhouri Exploiting the code of the accepted answer of the question that you linked

error: property 'frame' not found on object of type 'UIView *'

半城伤御伤魂 提交于 2019-12-03 02:41:52
问题 I'm debugging my code and trying to figure out the size of the view using this: p view.frame.size.height but I'm getting this error: error: property 'frame' not found on object of type 'UIView *' error: 1 errors parsing expression any of you knows why or how can I debug the size of my view? 回答1: If you hate typecasting every time, you can try this: (lldb) expr @import UIKit (lldb) po self.view.bounds Since Xcode 7.2 is now available, I think we should update the answer. I find the answer here

Does LLDB have convenience variables ($var)?

风格不统一 提交于 2019-12-03 02:12:54
问题 Does LLDB have convenience variables? If so, how do I use them? If no, is there any similar things to use? Reference: http://software.intel.com/sites/products/documentation/hpc/atom/application/debugger/commands143.html 回答1: I finally figured it out myself. Run help expr in LLDB and you will see: User defined variables: You can define your own variables for convenience or to be used in subsequent expressions. You define them the same way you would define variables in C. If the first character

Extending LLDB from NDK (Android Studio 3.1.3)

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've found a nice plugin for lldb that allows watching memory regions as images: https://github.com/carlodalmutto/ImageWatchLLDB As I can see, this plugin was developed for Xcode and not for Android. However, it is written in Python and therefore should be cross-platform. I've found a directory c:\Users\username\.lldb\ on my hard drive. Its size is about 1 Gb. I've created following files: c:\Users\username\.lldbinit , c:\Users\username\lldbinit , c:\Users\username\.lldb\lldbinit , c:\Users\username\.lldb\.lldbinit , c:\Users\username\.lldb

Ionic - app hangs on splash screen

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My ionic app is hanging on the splash screen - it was working fine and then I added some code, and went to test, and it's getting stuck. It gets to this point: ------ Debug phase ------ Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB... [ 0%] Looking up developer disk image [ 90%] Mounting developer disk image [ 95%] Developer disk image already mounted [100%] Connecting to remote debug server ------------------------- (lldb) command

How do you add breakpoint actions via the LLDB command line?

北城以北 提交于 2019-12-02 23:52:56
If you edit a breakpoint from Xcode, there is the super-useful option to add an "Action" to be automatically executed every time the breakpoint is hit. How can you add such actions from the LLDB command line? Easy peasy with the breakpoint command add command. Type help breakpoint command add for details but here's an example. int main () { int i = 0; while (i < 30) { i++; // break here } } Run lldb on this. First, put a breakpoint on the source line with "break" somewhere in it (nice shorthand for examples like this but it basically has to grep over your sources, so not useful for larger

Redirect lldb output to file

橙三吉。 提交于 2019-12-02 22:59:27
I'm using lldb inside Xcode, and one of my variables contains a huge chunk of JSON data. Using po myVar isn't much helpful to analyse this data, as it will output in the tiny Xcode debug console. Is there a way to redirect lldb output to a file ? I saw here that such a feature seems to be available on gdb as : (gdb) set logging on (gdb) set logging file /tmp/mem.txt (gdb) x/512bx 0xbffff3c0 (gdb) set logging off and is "translated" in lldb as : (lldb) memory read --outfile /tmp/mem.txt --count 512 0xbffff3c0 (lldb) me r -o/tmp/mem.txt -c512 0xbffff3c0 (lldb) x/512bx -o/tmp/mem.txt 0xbffff3c0

How do I have a breakpoint get triggered if an instance variable in the class has its value changed?

拟墨画扇 提交于 2019-12-02 22:48:37
Say I have a variable, self.position , how do I get Xcode to break whenever it changes its value (a number of methods could change it). For conditional breaking: Cmd+option click the breakpoint Add a break condition like so: For breaking on every occasion the value has changed: Implement trivial setter (and getter for the sake of clean code). Add breakpoint to setter. If you want to see who invoked the setter - just look at the next line in the stack trace (viewDidLoad in my example): Update: Adding a watchpoint Break anywhere so that the (lldb) prompt shows up in the console Type in