Skip to content

Commit 67ae7bd

Browse files
author
Johnny Chen
committed
Add two new interface files SBValue.i and SBValueList.i, instead of directly swigging the header files.
llvm-svn: 135416
1 parent 2729263 commit 67ae7bd

File tree

5 files changed

+366
-119
lines changed

5 files changed

+366
-119
lines changed

lldb/include/lldb/API/SBValue.h

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -16,56 +16,8 @@
1616

1717
namespace lldb {
1818

19-
#ifdef SWIG
20-
%feature("docstring",
21-
"Represents the value of a variable, a register, or an expression.
22-
23-
SBValue supports iteration through its child, which in turn is represented
24-
as an SBValue. For example, we can get the general purpose registers of a
25-
frame as an SBValue, and iterate through all the registers,
26-
27-
registerSet = frame.GetRegisters() # Returns an SBValueList.
28-
for regs in registerSet:
29-
if 'general purpose registers' in regs.getName().lower():
30-
GPRs = regs
31-
break
32-
33-
print '%s (number of children = %d):' % (GPRs.GetName(), GPRs.GetNumChildren())
34-
for reg in GPRs:
35-
print 'Name: ', reg.GetName(), ' Value: ', reg.GetValue()
36-
37-
produces the output:
38-
39-
General Purpose Registers (number of children = 21):
40-
Name: rax Value: 0x0000000100000c5c
41-
Name: rbx Value: 0x0000000000000000
42-
Name: rcx Value: 0x00007fff5fbffec0
43-
Name: rdx Value: 0x00007fff5fbffeb8
44-
Name: rdi Value: 0x0000000000000001
45-
Name: rsi Value: 0x00007fff5fbffea8
46-
Name: rbp Value: 0x00007fff5fbffe80
47-
Name: rsp Value: 0x00007fff5fbffe60
48-
Name: r8 Value: 0x0000000008668682
49-
Name: r9 Value: 0x0000000000000000
50-
Name: r10 Value: 0x0000000000001200
51-
Name: r11 Value: 0x0000000000000206
52-
Name: r12 Value: 0x0000000000000000
53-
Name: r13 Value: 0x0000000000000000
54-
Name: r14 Value: 0x0000000000000000
55-
Name: r15 Value: 0x0000000000000000
56-
Name: rip Value: 0x0000000100000dae
57-
Name: rflags Value: 0x0000000000000206
58-
Name: cs Value: 0x0000000000000027
59-
Name: fs Value: 0x0000000000000010
60-
Name: gs Value: 0x0000000000000048
61-
"
62-
) SBValue;
63-
#endif
6419
class SBValue
6520
{
66-
#ifdef SWIG
67-
%feature("autodoc", "1");
68-
#endif
6921
public:
7022
SBValue ();
7123

@@ -150,9 +102,6 @@ class SBValue
150102
lldb::SBValue
151103
GetChildAtIndex (uint32_t idx);
152104

153-
#ifdef SWIG
154-
%feature("docstring", "
155-
#endif
156105
//------------------------------------------------------------------
157106
/// Get a child value by index from a value.
158107
///
@@ -203,9 +152,6 @@ class SBValue
203152
/// @return
204153
/// A new SBValue object that represents the child member value.
205154
//------------------------------------------------------------------
206-
#ifdef SWIG
207-
") GetChildAtIndex;
208-
#endif
209155
lldb::SBValue
210156
GetChildAtIndex (uint32_t idx,
211157
lldb::DynamicValueType use_dynamic,

lldb/include/lldb/API/SBValueList.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,8 @@
1414

1515
namespace lldb {
1616

17-
#ifdef SWIG
18-
%feature("docstring",
19-
"Represents a collection of SBValues. Both SBFrame's GetVariables() and
20-
GetRegisters() return a SBValueList.
21-
22-
SBValueList supports SBValue iteration. For example (from test/lldbutil.py),
23-
24-
def get_registers(frame, kind):
25-
'''Returns the registers given the frame and the kind of registers desired.
26-
27-
Returns None if there's no such kind.
28-
'''
29-
registerSet = frame.GetRegisters() # Return type of SBValueList.
30-
for value in registerSet:
31-
if kind.lower() in value.GetName().lower():
32-
return value
33-
34-
return None
35-
36-
def get_GPRs(frame):
37-
'''Returns the general purpose registers of the frame as an SBValue.
38-
39-
The returned SBValue object is iterable. An example:
40-
...
41-
from lldbutil import get_GPRs
42-
regs = get_GPRs(frame)
43-
for reg in regs:
44-
print '%s => %s' % (reg.GetName(), reg.GetValue())
45-
...
46-
'''
47-
return get_registers(frame, 'general purpose')
48-
49-
def get_FPRs(frame):
50-
'''Returns the floating point registers of the frame as an SBValue.
51-
52-
The returned SBValue object is iterable. An example:
53-
...
54-
from lldbutil import get_FPRs
55-
regs = get_FPRs(frame)
56-
for reg in regs:
57-
print '%s => %s' % (reg.GetName(), reg.GetValue())
58-
...
59-
'''
60-
return get_registers(frame, 'floating point')
61-
62-
def get_ESRs(frame):
63-
'''Returns the exception state registers of the frame as an SBValue.
64-
65-
The returned SBValue object is iterable. An example:
66-
...
67-
from lldbutil import get_ESRs
68-
regs = get_ESRs(frame)
69-
for reg in regs:
70-
print '%s => %s' % (reg.GetName(), reg.GetValue())
71-
...
72-
'''
73-
return get_registers(frame, 'exception state')
74-
"
75-
) SBValueList;
76-
#endif
7717
class SBValueList
7818
{
79-
#ifdef SWIG
80-
%feature("autodoc", "1");
81-
#endif
8219
public:
8320

8421
SBValueList ();

0 commit comments

Comments
 (0)