lldb

Watch points on memory address

混江龙づ霸主 提交于 2019-12-02 20:56:20
With the new change from gdb to lldb , I can't find a way how to set watch points on some memory addresses . In gdb I used this watch -location *0x123456 Doing the same in lldb w s e *0x123456 Isn't working for me . So what can I use to run the same command in lldb ? Omit the "dereferencing operator" * when setting the watch point in lldb, just pass the address: watchpoint set expression -- 0x123456 # short form: w s e -- 0x123456 sets a watchpoint at the memory location 0x123456 . Optionally you can set the number of bytes to watch with --size . Example in short form: w s e -s 2 -- 0x123456

error: Couldn't IRGen expression, no additional error [duplicate]

那年仲夏 提交于 2019-12-02 20:23:02
This question already has an answer here: Xcode 10, LLDB: Couldn't IRGen expression 3 answers I can not print debug information in my UI TESTS. Configuration: Xcode 10 and SWIFT 4.2. When I try to print something in console I can only see an error: "error: Couldn't IRGen expression, no additional error" I didn't have any problem in earlier versions of Xcode (8,9 etc), only in Xcode 10. I can not print anything, when I put breakpoint and try to print for example app po XCUIApplication() or something like that. In the earlier version of Xcode when I write in console: "po XCUIApplication

lldb: Breakpoint on exceptions (equivalent of gdb's catch throw)

南楼画角 提交于 2019-12-02 20:01:27
I am trying to use lldb for c++ debugging and I want to halt if an exception is thrown, like gdb's catch throw , and I cannot find an equivalent in the lldb documentation. Jason Molenda In Xcode, you can set an Exception breakpoint (View > Navigators > Show Breakpoint Navigator, hit the + button in the bottom of the breakpoint list window to add a new breakpoint). If you're using command line lldb, put a breakpoint on __cxa_throw for C++ exception throws, objc_exception_throw for Objective-C exception throws. For all c++ exceptions: break set -E C++ . Use break set -E c++ to break on all

Cannot debug Swift module/framework embedded in Objective-C app

☆樱花仙子☆ 提交于 2019-12-02 18:00:13
Alternative titles (to aid searching) Cannot debug Swift 2.3 framework linked to an Objective-C app in Xcode 8 error in auto-import: failed to get module 'XYZ' from AST context Xcode 8 Xcode 8 cannot debug Swift framework warning: Swift error in module <XYZ> Workaround for; Xcode Debugger cannot debug apps written in Objective-C only but that link against frameworks written in Swift only. (28312362) I have an app written in Objective-C that links against some modules (frameworks) written in Swift 2.x. Question Everything (debugging etc.) works fine in xcode7 , however when moving to xcode8 and

Is there a “TUI” mode for standalone lldb?

无人久伴 提交于 2019-12-02 17:27:16
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 platforms (i.e., vim, Makefiles, autotools, etc.). In top of tree svn source lldb there's a very new command

Setting disassembly flavour to Intel in LLDB

旧巷老猫 提交于 2019-12-02 17:12:55
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. 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 option to disassemble or the target.x86-disassembly-flavor setting in your ~/.lldbinit file. This will be

Getting info about bad memory address in LLDB

。_饼干妹妹 提交于 2019-12-02 16:23:59
I am trying to debug an EXC_BAD_ACCESS in my iPhone app. It is crashing on a method call and on the line of the method is EXC_BAD_ACCESS (code=1, address = xxx) . Before, I would have just used gdb info malloc-history <xxx> to start debugging, but I am having trouble finding a parallel command in LLDB . I saw this thread that said to use Instruments, but when I do I still get the crash but I can't figure out how to tell exactly where the app is crashing from in Instruments. I just need to figure out where this piece of memory that is crashing was pointing to. What is the best way to do this

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

和自甴很熟 提交于 2019-12-02 16:14:42
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? Chris Yim 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, Why can't LLDB print view.bounds? Try this p (CGRect)[view frame] Alternative to get the frame

Does LLDB have convenience variables ($var)?

蹲街弑〆低调 提交于 2019-12-02 15:45:51
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 an0 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 of your user defined variable is a $, then the variable's value will be available in future

A way to view memory allocation in Xcode / lldb

人走茶凉 提交于 2019-12-02 15:31:46
问题 I have a simple program and set a breakpoint to see how to monitor memory allocation within a debugging interface (instead of, for example, with valgrind): The above program should allocate a lot of memory. It seems like the "Memory" icon on the left is unrelated to dynamic memory allocation (perhaps it's related to the amount of memory Xcode itself is using). Is there a command to see how much memory has been allocated within lldb , for example, similar to (gdb) call malloc_stats() ? I know