lldb

Save breakpoints in LLDB

随声附和 提交于 2019-12-12 10:38:49
问题 How can I save breakpoints in lldb? This is a feature that gdb has and I suspect that lldb has it too but I haven't been able to find it in the help. How this is done in gdb: Getting gdb to save a list of breakpoints? 回答1: As Jim Ingham said above, you currently cannot save breakpoints in lldb. However, there is a work around. You can load lldb commands from a command file as follows: lldb -S <path_to_command_file> You can have this in your command file: file <path_to_binary> breakpoint set -

How can I setup an LLDB breakpoint firing every 10th time?

巧了我就是萌 提交于 2019-12-12 09:40:04
问题 To debug the values of high frequency timers or sensors it would be useful to configure a breakpoint that only fires every x times. What's the best way to accomplish this? I tried the "Ignore x times before stopping" option in Xcode but that only works for the first time. Can I reset this counter using an LLDB command? 回答1: You can reset the ignore counter at any time with: (lldb) break modify -i <NEW_VALUE> <BKPT_SPECIFICATION> Note, a breakpoint which doesn't satisfy its "ignore count" is

Symbolic breakpoint for when dispatch_async is called with a specific queue

岁酱吖の 提交于 2019-12-12 08:57:12
问题 I'm debugging an issue in my project involving grand central dispatch. In debugging this, it would be really helpful to have a way of being notified when work is dispatched to a specific queue. Is there some way of setting a symbolic breakpoint on dispatch_async with a condition that could check whether the dispatch queue argument is the same as some other queue that I have access to? 回答1: Here's how to set a conditional breakpoint. (I haven't done conditions on queues, I'm making the

iOS: lldb EXC_BAD_ACCESS Custom Cell

戏子无情 提交于 2019-12-12 06:31:14
问题 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"LibraryListingCell"; InSeasonCell *cell = (InSeasonCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"InSeasonCellView" owner:self options:nil]; cell = [_cell autorelease]; _cell = nil; } if(_dataController!=NULL){ Product *productAtIndex = [_dataController objectInListAtIndex

LLDB: is it possible to display graphics from lldb session?

匆匆过客 提交于 2019-12-12 02:12:59
问题 I would like to display a plot from LLDB session, is that possible? plt.figure() plt.title('Test') plt.imshow(array, cmap='gray') plt.show() Right now, when i do that through the "command script import ~/script.py"; the session is stuck! 回答1: This works correctly in command-line lldb (or at least it does for me...) That it doesn't work when trying to share the connection to the Window Server with Xcode (since lldb is running in the Xcode app process) is not entirely surprising. Doing plt

lldb on xcode vs lldb on standalone

孤街浪徒 提交于 2019-12-11 18:59:42
问题 I have this C++11 code that uses unique_ptr in vector. #include <vector> #include <iostream> #include <memory> using namespace std; class A { int x; public: A() {} ~A() {} A(A& a) {} A(int x) {this->x = x;} int get() {return x;} }; int main() { vector<unique_ptr<A>> v; auto a = new A(10); unique_ptr<A> pa(a); v.push_back(move(pa)); // move(pa); auto a2 = new A(20); unique_ptr<A> pb(a2); v.push_back(move(pb)); // move(pa); for (auto& i: v) { cout << i->get(); } } I could use Xcode to debug and

Cocoa app tries to launch lldb on crash?

假如想象 提交于 2019-12-11 17:43:44
问题 A couple of users are reporting that sometimes when my app crashes, the receive a message box like this: The lldb command requires the command line developer tools. Would you like to install the tools now? The crash (SIGABRT) looks like a race condition somewhere in my code. But why is it seemingly trying to launch lldb when this happens? I've never seen anything like this, it seems fairly isolated to a couple of users, and I can't reproduce locally - although I do have the developer tools

Why are symbols for classes written in Swift difficult to read in lldb? Is it possible to change this?

末鹿安然 提交于 2019-12-11 17:42:41
问题 Some context, I'm new to swift, going through a book right now When looking at exceptions in lldb, when there's a stack frame from a Swift class, the symbol is very hard to read ex: _TFC10MyApp16TestViewControllersP01CBLDocumentModel5queryfzT4viewCSo7CBLView4 it looks like lldb just doesn't know how to display the signatures properly-- is there a flag or setting I can change? Or is just a thing that everybody has learned to deal with? Really the difficult part, for me, is when it prints

Can't log Swift Singletons from Objective-C in Xcode Console

情到浓时终转凉″ 提交于 2019-12-11 17:05:46
问题 I have come across an issue with the console in my project in Xcode. I am able to debug a Swift Singleton inside Swift but not Objective-C, in Xcode 8 and 9, Swift 3 and 4. The question is, why can't the values in question be printed in the console when debugging an Objective-C class? There is no issue when debugging in a Swift class, and the console even auto completes the swift class for me. Example classes: Objective-C View Controller #import "ViewController.h" #import "SOQuestion-Swift.h"

use lldb for iphone project in mac without using xcode

我是研究僧i 提交于 2019-12-11 16:07:53
问题 I an trying to find out how to debug iphone program without using xcode by reading here but I cannot get it to work I managed to change my Xcode setting (Xcode 10) so that the .app file that gets created after build is now inside a folder within my project folder. This makes it easier to get the path to the .app file for lldb, and I can load the app file in lldb using something like $ lldb /Projects/Sketch/build/Debug/Sketch.app but I am not sure what to do from here onwards. I tried process