lldb

LLDB equivalent of gdb “directory” command for specifying source search path?

匆匆过客 提交于 2019-11-26 10:56:12
问题 Looking for the lldb equivalent of the gdb \" directory \" command to add search paths for finding missing source code (or possibly similar functionality within xcode)? Thanks in advance! 回答1: The target.source-map setting allows you define a series of a => b path remappings in the debug session. It's not identical to the gdb dir command, which is a list of directories to search for source files by base name, but you can solve the same problems with source-map . Here's an example where I move

Permanently configuring LLDB (in Xcode 4.3.2) not to stop on signals

百般思念 提交于 2019-11-26 09:19:01
问题 I\'m trying to get LLDB (running in Xcode 4.3.2 with an OS X application) to not stop on certain signals. If I enter process handle SIGUSR2 -n true -p true -s false on the debugging console it works fine and LLDB no longer stops on SIGUSR2. However, if I put command process handle SIGUSR2 -n true -p true -s false into ~/.lldbinit it seems to be ignored. Other commands in this file (e.g. alias) work fine. How can I make LLDB never stop on certain signals? 回答1: In case anyone else ever has this

LLDB (Swift): Casting Raw Address into Usable Type

时光怂恿深爱的人放手 提交于 2019-11-26 06:55:21
问题 Is there an LLDB command that can cast a raw address into a usable Swift class? For example: (lldb) po 0x7df67c50 as MKPinAnnotationView I know that this address points to a MKPinAnnotationView, but it is not in a frame that I can select. But, I want to cast the raw address into a MKPinAnnotationView so that I can examine its properties. Is this possible? 回答1: Under Xcode 8.2.1 and Swift 3, the lldb command po or p won't work with the typed variable. You will need to use the swift command

使用Python扩展lldb

时间秒杀一切 提交于 2019-11-26 02:28:37
Xcode集成了LLDB,进一步简化了程序调试流程。虽然LLDB很强大,但是它的命令很有限。所幸的是,lldb包含了对python的支持,使得lldb的拓展成为可能。本人在开发过程中很喜欢使用image lookup 命令,但是苦于每次只能执行一条,相当耗时,因此一直想要找到一种批量执行的方法。于是将目光放到了lldb python上...... 问题:批量执行image lookup -a (1)编写python脚本(layne_command.py),代码如下: #coding=utf-8 #自定义lldb命令 import lldb import commands import optparse import shlex def layne_imagelookup(debugger, command, result, internal_dict): target = debugger.GetSelectedTarget() process = target.GetProcess() thread = process.GetSelectedThread() command_args = shlex.split(command) parser = create_custom_parser() try: (options, args) = parser.parse_args