lldb

Can lldb execute a command with argument contain a unescaped return char?

旧巷老猫 提交于 2019-12-11 00:54:54
问题 I define a new lldb command named jspatch like this: command regex jspatch 's/(.+)/p (id)[JPEngine evaluateScript:@"%1"]/' This command accept a string as argument. But I can't execute a command like this? jspatch 'var a = 10 var b = 20 a = a + b' I just get 'var a = 10 in evaluateScript: . But I cant pass it a string contain unescaped return char, anyone has a solution for this? 回答1: That won't work given the way the lldb command interpreter is set up. An unescaped return currently always

SBData is wrong when SBValue comes from a Swift Dictionary

送分小仙女□ 提交于 2019-12-10 20:13:09
问题 I'm trying to write a Python function to format a Foundation.Decimal , for use as a type summarizer. I posted it in this answer. I'll also include it at the bottom of this answer, with extra debug prints. I've now discovered a bug, but I don't know if the bug is in my function, or in lldb, or possibly in the Swift compiler. Here's a transcript that demonstrates the bug. I load my type summarizer in ~/.lldbinit , so the Swift REPL uses it. :; xcrun swift registering Decimal type summaries

Print string with newlines with lldb

拈花ヽ惹草 提交于 2019-12-10 16:43:02
问题 I'd like to print a string, either const char* or std::string , using lldb so that it is human readable. Most importantly, \n 's would be printed as a newline. Does anyone know how to do this? I tried the advice given for gdb in this post, however it doesn't seem to work with lldb. Edit: I'm aware that you can issue the print myString command to print the string, however it doesn't format newline characters (at least not by default): 回答1: Most of the time you want to see the literal contents

Mac OS 下的 gcc gdb

柔情痞子 提交于 2019-12-10 16:03:21
好久没有写c了,今天和老婆大人一起做了一下微软的网上编程题。发现忘了好多。 由于有运行时错误,所以想用gdb调试一下,发现没有gdb,遂使用homebrew安装,结果安装出错。后来发现错误的原因应该是找不到gcc!可是我一直用gcc编译程序的啊,好奇怪! 这两天vpn不稳定,只能百度,好不容易才发现了原因: 从Mac OS 10.9开始,安装Xcode5时不会再安装gcc了,而系统中的gcc实际上只是一个别名。 $ gcc -v Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1 Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64-apple-darwin14.5.0 Thread model: posix $ clang -v Apple LLVM version 7.0.0 (clang-700.0.72) Target: x86_64

How can I get sensible variable displays when using libc++ in Xcode 4.3.1?

狂风中的少年 提交于 2019-12-10 14:07:06
问题 I'm using Xcode 4.3.1's C++11 language dialect along with libc++ as the standard library. The language support in this combination is amazing, but debugging is torture. Neither Xcode's "Summary Format" nor lldb's summary format features display any of the standard types (std::string, std::vector, etc.) with pretty printing. Writing a pretty printer for these types is highly non-trivial due to their complexity. (E.g., std::string is remarkably complex in libc++.) How in the world are other

Extending LLDB from NDK (Android Studio 3.1.3)

别来无恙 提交于 2019-12-10 11:25:58
问题 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

Debug another selector while single stepping in Xcode using lldb

倾然丶 夕夏残阳落幕 提交于 2019-12-10 09:41:59
问题 I am in my code stopped at a breakpoint at the (lldb) prompt. I can message objects and get their value printed on the console. (lldb) p [self computePI] (float) $1 = 3.0 Whoa! Something is wrong at this point. I would like to be able to step into computePI as a shortcut to figuring out which variables are messed up. However, if I put a breakpoint on that selector and try again I get: (lldb) p [self computePI] error: Execution was interrupted, reason: breakpoint 5.1. The process has been

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

末鹿安然 提交于 2019-12-10 06:03:23
问题 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

Function can only be called in the main thread, why?

隐身守侯 提交于 2019-12-10 03:36:50
问题 In this code below I am calling the function displayMyAlertMessage() twice. the first I am calling works perfect, but the second one gives me an error saying that the function may only be called from the main thread. How can I do this in my situation? I am using this code: @IBAction func loginButtonTapped(sender: AnyObject) { result2Value = "" let userEmail = userEmailTextField.text let userPassword = userPasswordTextField.text if userPassword.isEmpty || userPassword.isEmpty {

Disable signals at LLDB initialization

廉价感情. 提交于 2019-12-10 03:10:55
问题 My software uses the SIGUSR2 signal and I am using LLDB (under Xcode 4.6.2) as my debugger. I would like to disable LLDB from stoping at SIGUSR2 and have been doing so using the command: process handle --pass true --stop false --notify true SIGUSR2 I am looking for a way to have LLDB always execute this command at startup. I have looked into adding something along the lines of settings append target.process.extra-startup-command process in my .lldbinit, but while this changes the value of the