2017-07-05 64 views
0

lldb,我得到help breakpoint setGDB/LLDB突破共享庫

 -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. 

 -r <regular-expression> (--func-regex <regular-expression>) 
     Set the breakpoint by function name, evaluating a regular-expression to find the function name(s). 

-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的每個函數處設置斷點。

libobjc.A.dylibMyOwn.dylib爲例。我想下面的命令,但未能:

(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. 

我想在模塊libobjc.A.dylibMyOwn.dylib,或任何其他特定加載的模塊/共享庫的所有功能lldb GET休息。如何在lldb中設置斷點?

回答

1
(lldb) break set -r . -s libobjc.A.dylib 

-s選項接受一個共享庫作爲其值,並且這限制了斷點指定的共享庫。您可以多次指定-s選項以指定包含在斷點搜索中的多個共享庫。

-r選項的值是一個正則表達式;如果符號名稱匹配該表達式,它將包含在斷點中。 .匹配所有內容。

的LLDB教程:

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

開始與LLDB的結構的描述命令,你可能會發現有用的。