blob: 2a4b9f564b2d1c0df2e3b9522a747d2840459cc7 [file] [log] [blame]
Jim Ingham47beabb2012-10-16 21:41:58 +00001//===-- SBExpressionOptions.cpp ---------------------------------------------*- 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
10#include "lldb/API/SBExpressionOptions.h"
11#include "lldb/API/SBStream.h"
12
13#include "lldb/Target/Target.h"
14
15using namespace lldb;
16using namespace lldb_private;
17
18
19SBExpressionOptions::SBExpressionOptions ()
20{
21 m_opaque_ap.reset(new EvaluateExpressionOptions());
22}
23
24SBExpressionOptions::SBExpressionOptions (bool coerce_to_id,
25 bool unwind_on_error,
26 bool keep_in_memory,
27 bool run_others,
28 DynamicValueType use_dynamic,
29 uint32_t timeout_usec)
30{
31 m_opaque_ap.reset(new EvaluateExpressionOptions());
32 m_opaque_ap->SetCoerceToId(coerce_to_id);
33 m_opaque_ap->SetUnwindOnError(unwind_on_error);
34 m_opaque_ap->SetKeepInMemory(keep_in_memory);
35 m_opaque_ap->SetRunOthers(run_others);
36 m_opaque_ap->SetUseDynamic (use_dynamic);
37 m_opaque_ap->SetTimeoutUsec (timeout_usec);
38}
39
40SBExpressionOptions::SBExpressionOptions (const SBExpressionOptions &rhs)
41{
42 m_opaque_ap.reset(new EvaluateExpressionOptions());
43 *(m_opaque_ap.get()) = rhs.ref();
44}
45
46const SBExpressionOptions &
47SBExpressionOptions::operator = (const SBExpressionOptions &rhs)
48{
49 if (this != &rhs)
50 {
51 this->ref() = rhs.ref();
52 }
53 return *this;
54}
55
56SBExpressionOptions::~SBExpressionOptions()
57{
58}
59
60bool
61SBExpressionOptions::DoesCoerceToId () const
62{
63 return m_opaque_ap->DoesCoerceToId ();
64}
65
66void
67SBExpressionOptions::SetCoerceToId (bool coerce)
68{
69 m_opaque_ap->SetCoerceToId (coerce);
70}
71
72bool
73SBExpressionOptions::DoesUnwindOnError () const
74{
75 return m_opaque_ap->DoesUnwindOnError ();
76}
77
78void
79SBExpressionOptions::SetUnwindOnError (bool unwind)
80{
81 m_opaque_ap->SetUnwindOnError (unwind);
82}
83
84bool
85SBExpressionOptions::DoesKeepInMemory () const
86{
87 return m_opaque_ap->DoesKeepInMemory ();
88}
89
90void
91SBExpressionOptions::SetKeepInMemory (bool keep)
92{
93 m_opaque_ap->SetKeepInMemory (keep);
94}
95
96lldb::DynamicValueType
97SBExpressionOptions::GetUseDynamic () const
98{
99 return m_opaque_ap->GetUseDynamic ();
100}
101
102void
103SBExpressionOptions::SetUseDynamic (lldb::DynamicValueType dynamic)
104{
105 m_opaque_ap->SetUseDynamic (dynamic);
106}
107
108uint32_t
109SBExpressionOptions::GetTimeoutUsec () const
110{
111 return m_opaque_ap->GetTimeoutUsec ();
112}
113
114void
115SBExpressionOptions::SetTimeoutUsec (uint32_t timeout)
116{
117 m_opaque_ap->SetTimeoutUsec (timeout);
118}
119
120bool
121SBExpressionOptions::GetRunOthers () const
122{
123 return m_opaque_ap->GetRunOthers ();
124}
125
126void
127SBExpressionOptions::SetRunOthers (bool run_others)
128{
129 m_opaque_ap->SetRunOthers (run_others);
130}
131
132EvaluateExpressionOptions *
133SBExpressionOptions::get() const
134{
135 return m_opaque_ap.get();
136}
137
138EvaluateExpressionOptions &
139SBExpressionOptions::ref () const
140{
141 return *(m_opaque_ap.get());
142}