首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GDB/LLDB在指定模块/共享库的所有函数处中断

GDB/LLDB在指定模块/共享库的所有函数处中断
EN

Stack Overflow用户
提问于 2017-07-05 22:05:47
回答 1查看 3K关注 0票数 5

lldb中,我得到了help breakpoint set

代码语言:javascript
复制
       -a <address-expression> ( --address <address-expression> )
        Set the breakpoint at the specified address.  If the address maps uniquely to a particular binary, then the address will be converted to a "file" address, so that the
        breakpoint will track that binary+offset no matter where the binary eventually loads.  Alternately, if you also specify the module - with the -s option - then the
        address will be treated as a file address in that module, and resolved accordingly.  Again, this will allow lldb to track that offset on subsequent reloads.  The
        module need not have been loaded at the time you specify this breakpoint, and will get resolved when the module is loaded.

代码语言:javascript
复制
       -r <regular-expression> ( --func-regex <regular-expression> )
        Set the breakpoint by function name, evaluating a regular-expression to find the function name(s).

代码语言:javascript
复制
   -s <shlib-name> ( --shlib <shlib-name> )
        Set the breakpoint only in this shared library.  Can repeat this option multiple times to specify multiple shared libraries.

现在,我想在指定模块/dylib的每个函数上设置断点,您可以在命令image list -f的结果中找到这些断点。

libobjc.A.dylibMyOwn.dylib为例。我尝试了以下命令,但失败了:

代码语言:javascript
复制
(lldb) breakpoint set -r libobjc.A.dylib
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.

(lldb) b +[ThunderManager load]
Breakpoint 2: where = MyOwn.dylib`+[ThunderManager load] +16 at ThunderManager.m:20, address = 0x000000010489f274

(lldb) breakpoint set -r MyOwn.dylib`*
Breakpoint 3: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.

我希望lldb在模块libobjc.A.dylibMyOwn.dylib的所有函数,或任何其他指定的已加载模块/共享库中获得中断。如何在lldb中设置断点

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-05 23:56:33

代码语言:javascript
复制
(lldb) break set -r . -s libobjc.A.dylib

-s选项接受共享库作为其值,这将断点限制为指定的共享库。可以多次指定-s选项,以指定要包括在断点搜索中的多个共享库。

-r选项的值是一个正则表达式;如果符号名称与该表达式匹配,则它将包含在断点中。.匹配所有内容。

lldb教程:

http://lldb.llvm.org/tutorial.html

从描述lldb命令的结构开始,您可能会发现这些命令对您很有帮助。

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44928511

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档