lldb

printing struct array in lldb python

爱⌒轻易说出口 提交于 2019-12-23 03:45:08
问题 Following the question here: Writing a Python script to print out an array of recs in lldb I would like to be able to create a type summary for an array of a given struct in lldb. Problem is that I am not able to access array correctly through python-lldb. Some data is incorrect. I have the following test code in C: #include <stdio.h> #include <stdlib.h> struct Buffer { struct Buffer* next; struct Buffer* prev; }; struct Base { struct Buffer* buffers; int count; }; void fill(struct Buffer*

Invoking function with string argument with lldb: how?

血红的双手。 提交于 2019-12-22 10:34:40
问题 I am unable to use lldb to invoke simple, non-templated functions that take string arguments. Is there any way to get lldb to understand the C++ datatype "string", which is a commonly used datatype in C++ programs? The sample source code here just creates a simple class with a few constructors, and then calls them (includes of "iostream" and "string" omitted): using namespace std; struct lldbtest{ int bar=5; lldbtest(){bar=6;} lldbtest(int foo){bar=foo;} lldbtest(string fum){bar=7;} }; int

lldb: how to call a function from a specific library/framework

柔情痞子 提交于 2019-12-22 08:43:18
问题 Problem: In project we have localization functions which are specific to a framework/dynamic library. That is they have identical name but fetch resources from different bundles/folders I'd want to call a function from a specific library, something similar to: lldb> p my_audio_engine.framework::GetL10nString( stringId ); lldb> expr --shlib my_audio_engine.framework -- GetL10nString(); lldb> p my_audio_engine`L10N_Utils::GetString(40000) but all these variants don't work. Adding gdb in tags

Swift, error EXC_BREAKPOINT (code=1, subcode=0x100695474)

这一生的挚爱 提交于 2019-12-22 04:35:20
问题 I'm trying to create a game in Swift (Xcode 6.4) and I'm getting this error: EXC_BREAKPOINT (code=1, subcode=0x100695474) In console: false 2015-08-02 11:14:35.248 Taxi Smash[3996:1485308] G 1019 fatal error: unexpectedly found nil while unwrapping an Optional value (lldb) Screen: Continue of the log: libswiftCore.dylib`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString,

How do I switch from lldb to gdb debugger types?

与世无争的帅哥 提交于 2019-12-21 21:09:04
问题 I have been looking around for quite a while trying to figure out how to switch from lldb to gdb and could not find anything on how to switch between the 2 in Xcode 6.1. I am trying to debug my app and I might be able to figure it out if I use gdb instead of lldb but I don't know if it will help me. Any suggestions on which type of debugging is better and how to switch between the 2. Any input would be greatly appreciated. Thanks in advance. 回答1: The debugger for Xcode 6 is lldb, there is no

When is __lldb_init_module called?

冷暖自知 提交于 2019-12-21 05:12:17
问题 I'm following WWDC session 412 - Debugging in Xcode. There is a demo there about creating custom LLDB summaries for your own classes. I simply can't get the summaries to show up. By inserting print calls in the Python script I have been able to determine that: The script file is getting imported __lldb_init_module is never called Any idea about what could prevent __lldb_init_module from being called? Is there a specific time when you need to import the script? 回答1: For me this worked by

LLDB: Setting a breakpoint for malloc_error_break through the console

末鹿安然 提交于 2019-12-21 04:11:31
问题 I'm running into some malloc-related issues in my code: malloc: *** error for object 0x103401e28: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug I've tried things like: (lldb) breakpoint set malloc_error_break error: invalid combination of options for the given command How do I set this breakpoint using the terminal? I've searched online and only found results involving Xcode. 回答1: If you are familiar

lldb error: process launch failed: unable to locate lldb-server

♀尐吖头ヾ 提交于 2019-12-21 03:55:32
问题 I'm running Xubuntu 16.04. After installing lldb from the repositories, I get the following output when I try to use it: lldb foo (lldb) target create "foo" Current executable set to 'foo' (x86_64). (lldb) r error: process launch failed: unable to locate lldb-server Any ideas what I'm missing? 回答1: After an hour or so of fiddling around, I found the solution. I copied /usr/bin/lldb-server-3.8 and named it /usr/bin/lldb-server . This is probably a problem with the ubuntu package. 回答2: I

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

纵然是瞬间 提交于 2019-12-20 10:29:43
问题 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). 回答1: 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):

Terminal command-line debug of iOS Simulator apps?

给你一囗甜甜゛ 提交于 2019-12-20 10:12:46
问题 Is it possible to use GDB or LLDB from the Terminal command-line under Mac OS X to debug apps running on the iOS Simulator? (e.g. not from within Xcode's GUI or console, but using an external command-line or process). If so, how? 回答1: You'll need to have the app already in the simulator's Springboard; you can't launch the app in the simulator from Xcode and then expect to be able to have a command line instance of gdb attach to it. So: Run the iOS Simulator, having already gotten your app