blob: e94f2c93b3c5aacebb4d5b1bafe4867482530b17 [file] [log] [blame]
Johnny Chen67ae7bd2011-07-18 19:08:30 +00001//===-- SWIG Interface for SBTarget -----------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10namespace lldb {
11
12%feature("docstring",
13"Represents a collection of SBValues. Both SBFrame's GetVariables() and
14GetRegisters() return a SBValueList.
15
16SBValueList supports SBValue iteration. For example (from test/lldbutil.py),
17
18def get_registers(frame, kind):
19 '''Returns the registers given the frame and the kind of registers desired.
20
21 Returns None if there's no such kind.
22 '''
23 registerSet = frame.GetRegisters() # Return type of SBValueList.
24 for value in registerSet:
25 if kind.lower() in value.GetName().lower():
26 return value
27
28 return None
29
30def get_GPRs(frame):
31 '''Returns the general purpose registers of the frame as an SBValue.
32
33 The returned SBValue object is iterable. An example:
34 ...
35 from lldbutil import get_GPRs
36 regs = get_GPRs(frame)
37 for reg in regs:
38 print '%s => %s' % (reg.GetName(), reg.GetValue())
39 ...
40 '''
41 return get_registers(frame, 'general purpose')
42
43def get_FPRs(frame):
44 '''Returns the floating point registers of the frame as an SBValue.
45
46 The returned SBValue object is iterable. An example:
47 ...
48 from lldbutil import get_FPRs
49 regs = get_FPRs(frame)
50 for reg in regs:
51 print '%s => %s' % (reg.GetName(), reg.GetValue())
52 ...
53 '''
54 return get_registers(frame, 'floating point')
55
56def get_ESRs(frame):
57 '''Returns the exception state registers of the frame as an SBValue.
58
59 The returned SBValue object is iterable. An example:
60 ...
61 from lldbutil import get_ESRs
62 regs = get_ESRs(frame)
63 for reg in regs:
64 print '%s => %s' % (reg.GetName(), reg.GetValue())
65 ...
66 '''
67 return get_registers(frame, 'exception state')
68"
69 ) SBValueList;
70class SBValueList
71{
72public:
73
74 SBValueList ();
75
76 SBValueList (const lldb::SBValueList &rhs);
77
78 ~SBValueList();
79
80 bool
81 IsValid() const;
82
83 void
84 Append (const lldb::SBValue &val_obj);
85
86 void
87 Append (const lldb::SBValueList& value_list);
88
89 uint32_t
90 GetSize() const;
91
92 lldb::SBValue
93 GetValueAtIndex (uint32_t idx) const;
94
95 lldb::SBValue
96 FindValueObjectByUID (lldb::user_id_t uid);
97};
98
99} // namespace lldb