[Lldb-commits] [lldb] r136230 - in /lldb/trunk/scripts/Python/interface: SBCompileUnit.i SBLineEntry.i
Johnny Chen
johnny.chen at apple.com
Wed Jul 27 11:28:07 PDT 2011
Author: johnny
Date: Wed Jul 27 13:28:07 2011
New Revision: 136230
URL: http://llvm.org/viewvc/llvm-project?rev=136230&view=rev
Log:
Add docstrings and cross refs to SBCompileUnit and SBLineEntry.
Modified:
lldb/trunk/scripts/Python/interface/SBCompileUnit.i
lldb/trunk/scripts/Python/interface/SBLineEntry.i
Modified: lldb/trunk/scripts/Python/interface/SBCompileUnit.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBCompileUnit.i?rev=136230&r1=136229&r2=136230&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBCompileUnit.i (original)
+++ lldb/trunk/scripts/Python/interface/SBCompileUnit.i Wed Jul 27 13:28:07 2011
@@ -14,6 +14,12 @@
SBCompileUnit supports line entry iteration. For example,
+ # Now get the SBSymbolContext from this frame. We want everything. :-)
+ context = frame0.GetSymbolContext(lldb.eSymbolContextEverything)
+ ...
+
+ compileUnit = context.GetCompileUnit()
+
for lineEntry in compileUnit:
print 'line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
lineEntry.GetLine())
@@ -35,7 +41,9 @@
start addr: a.out[0x100000db6]
end addr: a.out[0x100000dbc]
...
-") SBCompileUnit;
+
+See also SBSymbolContext and SBLineEntry"
+) SBCompileUnit;
class SBCompileUnit
{
public:
Modified: lldb/trunk/scripts/Python/interface/SBLineEntry.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBLineEntry.i?rev=136230&r1=136229&r2=136230&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBLineEntry.i (original)
+++ lldb/trunk/scripts/Python/interface/SBLineEntry.i Wed Jul 27 13:28:07 2011
@@ -11,9 +11,31 @@
%feature("docstring",
"Specifies an association with a contiguous range of instructions and
-a source file location. SBCompileUnit contains SBLineEntry(s).
+a source file location. SBCompileUnit contains SBLineEntry(s). For example,
-See also SBCompileUnit for example usage of SBLineEntry API."
+ for lineEntry in compileUnit:
+ print 'line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
+ lineEntry.GetLine())
+ print 'start addr: %s' % str(lineEntry.GetStartAddress())
+ print 'end addr: %s' % str(lineEntry.GetEndAddress())
+
+produces:
+
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20
+start addr: a.out[0x100000d98]
+end addr: a.out[0x100000da3]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21
+start addr: a.out[0x100000da3]
+end addr: a.out[0x100000da9]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22
+start addr: a.out[0x100000da9]
+end addr: a.out[0x100000db6]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23
+start addr: a.out[0x100000db6]
+end addr: a.out[0x100000dbc]
+...
+
+See also SBCompileUnit."
) SBLineEntry;
class SBLineEntry
{
More information about the lldb-commits
mailing list