LLDB  mainline
SBValue.cpp
Go to the documentation of this file.
1 //===-- SBValue.cpp -------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "lldb/API/SBValue.h"
10 #include "SBReproducerPrivate.h"
11 
12 #include "lldb/API/SBDeclaration.h"
13 #include "lldb/API/SBStream.h"
14 #include "lldb/API/SBTypeFilter.h"
15 #include "lldb/API/SBTypeFormat.h"
16 #include "lldb/API/SBTypeSummary.h"
18 
20 #include "lldb/Core/Declaration.h"
21 #include "lldb/Core/Module.h"
22 #include "lldb/Core/Section.h"
23 #include "lldb/Core/StreamFile.h"
24 #include "lldb/Core/Value.h"
25 #include "lldb/Core/ValueObject.h"
28 #include "lldb/Symbol/Block.h"
29 #include "lldb/Symbol/ObjectFile.h"
30 #include "lldb/Symbol/Type.h"
31 #include "lldb/Symbol/Variable.h"
34 #include "lldb/Target/Process.h"
35 #include "lldb/Target/StackFrame.h"
36 #include "lldb/Target/Target.h"
37 #include "lldb/Target/Thread.h"
39 #include "lldb/Utility/Scalar.h"
40 #include "lldb/Utility/Stream.h"
41 
42 #include "lldb/API/SBDebugger.h"
44 #include "lldb/API/SBFrame.h"
45 #include "lldb/API/SBProcess.h"
46 #include "lldb/API/SBTarget.h"
47 #include "lldb/API/SBThread.h"
48 
49 #include <memory>
50 
51 using namespace lldb;
52 using namespace lldb_private;
53 
54 class ValueImpl {
55 public:
56  ValueImpl() = default;
57 
58  ValueImpl(lldb::ValueObjectSP in_valobj_sp,
59  lldb::DynamicValueType use_dynamic, bool use_synthetic,
60  const char *name = nullptr)
61  : m_valobj_sp(), m_use_dynamic(use_dynamic),
62  m_use_synthetic(use_synthetic), m_name(name) {
63  if (in_valobj_sp) {
64  if ((m_valobj_sp = in_valobj_sp->GetQualifiedRepresentationIfAvailable(
65  lldb::eNoDynamicValues, false))) {
66  if (!m_name.IsEmpty())
67  m_valobj_sp->SetName(m_name);
68  }
69  }
70  }
71 
72  ValueImpl(const ValueImpl &rhs)
73  : m_valobj_sp(rhs.m_valobj_sp), m_use_dynamic(rhs.m_use_dynamic),
74  m_use_synthetic(rhs.m_use_synthetic), m_name(rhs.m_name) {}
75 
76  ValueImpl &operator=(const ValueImpl &rhs) {
77  if (this != &rhs) {
78  m_valobj_sp = rhs.m_valobj_sp;
79  m_use_dynamic = rhs.m_use_dynamic;
80  m_use_synthetic = rhs.m_use_synthetic;
81  m_name = rhs.m_name;
82  }
83  return *this;
84  }
85 
86  bool IsValid() {
87  if (m_valobj_sp.get() == nullptr)
88  return false;
89  else {
90  // FIXME: This check is necessary but not sufficient. We for sure don't
91  // want to touch SBValues whose owning
92  // targets have gone away. This check is a little weak in that it
93  // enforces that restriction when you call IsValid, but since IsValid
94  // doesn't lock the target, you have no guarantee that the SBValue won't
95  // go invalid after you call this... Also, an SBValue could depend on
96  // data from one of the modules in the target, and those could go away
97  // independently of the target, for instance if a module is unloaded.
98  // But right now, neither SBValues nor ValueObjects know which modules
99  // they depend on. So I have no good way to make that check without
100  // tracking that in all the ValueObject subclasses.
101  TargetSP target_sp = m_valobj_sp->GetTargetSP();
102  return target_sp && target_sp->IsValid();
103  }
104  }
105 
106  lldb::ValueObjectSP GetRootSP() { return m_valobj_sp; }
107 
108  lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker,
109  std::unique_lock<std::recursive_mutex> &lock,
110  Status &error) {
111  if (!m_valobj_sp) {
112  error.SetErrorString("invalid value object");
113  return m_valobj_sp;
114  }
115 
116  lldb::ValueObjectSP value_sp = m_valobj_sp;
117 
118  Target *target = value_sp->GetTargetSP().get();
119  if (!target)
120  return ValueObjectSP();
121 
122  lock = std::unique_lock<std::recursive_mutex>(target->GetAPIMutex());
123 
124  ProcessSP process_sp(value_sp->GetProcessSP());
125  if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) {
126  // We don't allow people to play around with ValueObject if the process
127  // is running. If you want to look at values, pause the process, then
128  // look.
129  error.SetErrorString("process must be stopped.");
130  return ValueObjectSP();
131  }
132 
133  if (m_use_dynamic != eNoDynamicValues) {
134  ValueObjectSP dynamic_sp = value_sp->GetDynamicValue(m_use_dynamic);
135  if (dynamic_sp)
136  value_sp = dynamic_sp;
137  }
138 
139  if (m_use_synthetic) {
140  ValueObjectSP synthetic_sp = value_sp->GetSyntheticValue();
141  if (synthetic_sp)
142  value_sp = synthetic_sp;
143  }
144 
145  if (!value_sp)
146  error.SetErrorString("invalid value object");
147  if (!m_name.IsEmpty())
148  value_sp->SetName(m_name);
149 
150  return value_sp;
151  }
152 
154  m_use_dynamic = use_dynamic;
155  }
156 
157  void SetUseSynthetic(bool use_synthetic) { m_use_synthetic = use_synthetic; }
158 
159  lldb::DynamicValueType GetUseDynamic() { return m_use_dynamic; }
160 
161  bool GetUseSynthetic() { return m_use_synthetic; }
162 
163  // All the derived values that we would make from the m_valobj_sp will share
164  // the ExecutionContext with m_valobj_sp, so we don't need to do the
165  // calculations in GetSP to return the Target, Process, Thread or Frame. It
166  // is convenient to provide simple accessors for these, which I do here.
167  TargetSP GetTargetSP() {
168  if (m_valobj_sp)
169  return m_valobj_sp->GetTargetSP();
170  else
171  return TargetSP();
172  }
173 
174  ProcessSP GetProcessSP() {
175  if (m_valobj_sp)
176  return m_valobj_sp->GetProcessSP();
177  else
178  return ProcessSP();
179  }
180 
181  ThreadSP GetThreadSP() {
182  if (m_valobj_sp)
183  return m_valobj_sp->GetThreadSP();
184  else
185  return ThreadSP();
186  }
187 
188  StackFrameSP GetFrameSP() {
189  if (m_valobj_sp)
190  return m_valobj_sp->GetFrameSP();
191  else
192  return StackFrameSP();
193  }
194 
195 private:
196  lldb::ValueObjectSP m_valobj_sp;
200 };
201 
202 class ValueLocker {
203 public:
204  ValueLocker() = default;
205 
206  ValueObjectSP GetLockedSP(ValueImpl &in_value) {
207  return in_value.GetSP(m_stop_locker, m_lock, m_lock_error);
208  }
209 
210  Status &GetError() { return m_lock_error; }
211 
212 private:
214  std::unique_lock<std::recursive_mutex> m_lock;
216 };
217 
219 
220 SBValue::SBValue(const lldb::ValueObjectSP &value_sp) {
221  LLDB_RECORD_CONSTRUCTOR(SBValue, (const lldb::ValueObjectSP &), value_sp);
222 
223  SetSP(value_sp);
224 }
225 
228 
229  SetSP(rhs.m_opaque_sp);
230 }
231 
234  SBValue, operator=,(const lldb::SBValue &), rhs);
235 
236  if (this != &rhs) {
237  SetSP(rhs.m_opaque_sp);
238  }
239  return LLDB_RECORD_RESULT(*this);
240 }
241 
242 SBValue::~SBValue() = default;
243 
246  return this->operator bool();
247 }
248 SBValue::operator bool() const {
249  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBValue, operator bool);
250 
251  // If this function ever changes to anything that does more than just check
252  // if the opaque shared pointer is non NULL, then we need to update all "if
253  // (m_opaque_sp)" code in this file.
254  return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid() &&
255  m_opaque_sp->GetRootSP().get() != nullptr;
256 }
257 
260 
261  m_opaque_sp.reset();
262 }
263 
266 
267  SBError sb_error;
268 
269  ValueLocker locker;
270  lldb::ValueObjectSP value_sp(GetSP(locker));
271  if (value_sp)
272  sb_error.SetError(value_sp->GetError());
273  else
274  sb_error.SetErrorStringWithFormat("error: %s",
275  locker.GetError().AsCString());
276 
277  return LLDB_RECORD_RESULT(sb_error);
278 }
279 
282 
283  ValueLocker locker;
284  lldb::ValueObjectSP value_sp(GetSP(locker));
285  if (value_sp)
286  return value_sp->GetID();
287  return LLDB_INVALID_UID;
288 }
289 
290 const char *SBValue::GetName() {
292 
293  const char *name = nullptr;
294  ValueLocker locker;
295  lldb::ValueObjectSP value_sp(GetSP(locker));
296  if (value_sp)
297  name = value_sp->GetName().GetCString();
298 
299  return name;
300 }
301 
302 const char *SBValue::GetTypeName() {
304 
305  const char *name = nullptr;
306  ValueLocker locker;
307  lldb::ValueObjectSP value_sp(GetSP(locker));
308  if (value_sp) {
309  name = value_sp->GetQualifiedTypeName().GetCString();
310  }
311 
312  return name;
313 }
314 
317 
318  const char *name = nullptr;
319  ValueLocker locker;
320  lldb::ValueObjectSP value_sp(GetSP(locker));
321  if (value_sp) {
322  name = value_sp->GetDisplayTypeName().GetCString();
323  }
324 
325  return name;
326 }
327 
330 
331  size_t result = 0;
332 
333  ValueLocker locker;
334  lldb::ValueObjectSP value_sp(GetSP(locker));
335  if (value_sp) {
336  result = value_sp->GetByteSize().getValueOr(0);
337  }
338 
339  return result;
340 }
341 
344 
345  bool result = false;
346 
347  ValueLocker locker;
348  lldb::ValueObjectSP value_sp(GetSP(locker));
349  if (value_sp) {
350  result = value_sp->IsInScope();
351  }
352 
353  return result;
354 }
355 
356 const char *SBValue::GetValue() {
358 
359  const char *cstr = nullptr;
360  ValueLocker locker;
361  lldb::ValueObjectSP value_sp(GetSP(locker));
362  if (value_sp) {
363  cstr = value_sp->GetValueAsCString();
364  }
365 
366  return cstr;
367 }
368 
371 
372  ValueType result = eValueTypeInvalid;
373  ValueLocker locker;
374  lldb::ValueObjectSP value_sp(GetSP(locker));
375  if (value_sp)
376  result = value_sp->GetValueType();
377 
378  return result;
379 }
380 
383 
384  const char *cstr = nullptr;
385  ValueLocker locker;
386  lldb::ValueObjectSP value_sp(GetSP(locker));
387  if (value_sp) {
388  cstr = value_sp->GetObjectDescription();
389  }
390 
391  return cstr;
392 }
393 
396 
397  SBType sb_type;
398  ValueLocker locker;
399  lldb::ValueObjectSP value_sp(GetSP(locker));
400  TypeImplSP type_sp;
401  if (value_sp) {
402  type_sp = std::make_shared<TypeImpl>(value_sp->GetTypeImpl());
403  sb_type.SetSP(type_sp);
404  }
405 
406  return LLDB_RECORD_RESULT(sb_type);
407 }
408 
411 
412  bool result = false;
413  ValueLocker locker;
414  lldb::ValueObjectSP value_sp(GetSP(locker));
415  if (value_sp) {
416  if (value_sp->UpdateValueIfNeeded(false))
417  result = value_sp->GetValueDidChange();
418  }
419 
420  return result;
421 }
422 
423 const char *SBValue::GetSummary() {
425 
426  const char *cstr = nullptr;
427  ValueLocker locker;
428  lldb::ValueObjectSP value_sp(GetSP(locker));
429  if (value_sp) {
430  cstr = value_sp->GetSummaryAsCString();
431  }
432 
433  return cstr;
434 }
435 
437  lldb::SBTypeSummaryOptions &options) {
438  LLDB_RECORD_METHOD(const char *, SBValue, GetSummary,
440  options);
441 
442  ValueLocker locker;
443  lldb::ValueObjectSP value_sp(GetSP(locker));
444  if (value_sp) {
445  std::string buffer;
446  if (value_sp->GetSummaryAsCString(buffer, options.ref()) && !buffer.empty())
447  stream.Printf("%s", buffer.c_str());
448  }
449  const char *cstr = stream.GetData();
450  return cstr;
451 }
452 
453 const char *SBValue::GetLocation() {
455 
456  const char *cstr = nullptr;
457  ValueLocker locker;
458  lldb::ValueObjectSP value_sp(GetSP(locker));
459  if (value_sp) {
460  cstr = value_sp->GetLocationAsCString();
461  }
462  return cstr;
463 }
464 
465 // Deprecated - use the one that takes an lldb::SBError
466 bool SBValue::SetValueFromCString(const char *value_str) {
467  LLDB_RECORD_METHOD(bool, SBValue, SetValueFromCString, (const char *),
468  value_str);
469 
470  lldb::SBError dummy;
471  return SetValueFromCString(value_str, dummy);
472 }
473 
474 bool SBValue::SetValueFromCString(const char *value_str, lldb::SBError &error) {
476  (const char *, lldb::SBError &), value_str, error);
477 
478  bool success = false;
479  ValueLocker locker;
480  lldb::ValueObjectSP value_sp(GetSP(locker));
481  if (value_sp) {
482  success = value_sp->SetValueFromCString(value_str, error.ref());
483  } else
484  error.SetErrorStringWithFormat("Could not get value: %s",
485  locker.GetError().AsCString());
486 
487  return success;
488 }
489 
492 
493  lldb::SBTypeFormat format;
494  ValueLocker locker;
495  lldb::ValueObjectSP value_sp(GetSP(locker));
496  if (value_sp) {
497  if (value_sp->UpdateValueIfNeeded(true)) {
498  lldb::TypeFormatImplSP format_sp = value_sp->GetValueFormat();
499  if (format_sp)
500  format.SetSP(format_sp);
501  }
502  }
503  return LLDB_RECORD_RESULT(format);
504 }
505 
508 
509  lldb::SBTypeSummary summary;
510  ValueLocker locker;
511  lldb::ValueObjectSP value_sp(GetSP(locker));
512  if (value_sp) {
513  if (value_sp->UpdateValueIfNeeded(true)) {
514  lldb::TypeSummaryImplSP summary_sp = value_sp->GetSummaryFormat();
515  if (summary_sp)
516  summary.SetSP(summary_sp);
517  }
518  }
519  return LLDB_RECORD_RESULT(summary);
520 }
521 
524 
525  lldb::SBTypeFilter filter;
526  ValueLocker locker;
527  lldb::ValueObjectSP value_sp(GetSP(locker));
528  if (value_sp) {
529  if (value_sp->UpdateValueIfNeeded(true)) {
530  lldb::SyntheticChildrenSP synthetic_sp = value_sp->GetSyntheticChildren();
531 
532  if (synthetic_sp && !synthetic_sp->IsScripted()) {
533  TypeFilterImplSP filter_sp =
534  std::static_pointer_cast<TypeFilterImpl>(synthetic_sp);
535  filter.SetSP(filter_sp);
536  }
537  }
538  }
539  return LLDB_RECORD_RESULT(filter);
540 }
541 
544 
545  lldb::SBTypeSynthetic synthetic;
546  ValueLocker locker;
547  lldb::ValueObjectSP value_sp(GetSP(locker));
548  if (value_sp) {
549  if (value_sp->UpdateValueIfNeeded(true)) {
550  lldb::SyntheticChildrenSP children_sp = value_sp->GetSyntheticChildren();
551 
552  if (children_sp && children_sp->IsScripted()) {
553  ScriptedSyntheticChildrenSP synth_sp =
554  std::static_pointer_cast<ScriptedSyntheticChildren>(children_sp);
555  synthetic.SetSP(synth_sp);
556  }
557  }
558  }
559  return LLDB_RECORD_RESULT(synthetic);
560 }
561 
563  SBType type) {
565  (const char *, uint32_t, lldb::SBType), name, offset,
566  type);
567 
568  lldb::SBValue sb_value;
569  ValueLocker locker;
570  lldb::ValueObjectSP value_sp(GetSP(locker));
571  lldb::ValueObjectSP new_value_sp;
572  if (value_sp) {
573  TypeImplSP type_sp(type.GetSP());
574  if (type.IsValid()) {
575  sb_value.SetSP(value_sp->GetSyntheticChildAtOffset(
576  offset, type_sp->GetCompilerType(false), true),
578  }
579  }
580  return LLDB_RECORD_RESULT(sb_value);
581 }
582 
585 
586  lldb::SBValue sb_value;
587  ValueLocker locker;
588  lldb::ValueObjectSP value_sp(GetSP(locker));
589  TypeImplSP type_sp(type.GetSP());
590  if (value_sp && type_sp)
591  sb_value.SetSP(value_sp->Cast(type_sp->GetCompilerType(false)),
593  return LLDB_RECORD_RESULT(sb_value);
594 }
595 
597  const char *expression) {
599  (const char *, const char *), name, expression);
600 
601  SBExpressionOptions options;
602  options.ref().SetKeepInMemory(true);
603  return LLDB_RECORD_RESULT(
604  CreateValueFromExpression(name, expression, options));
605 }
606 
608  const char *expression,
609  SBExpressionOptions &options) {
611  (const char *, const char *, lldb::SBExpressionOptions &),
612  name, expression, options);
613 
614  lldb::SBValue sb_value;
615  ValueLocker locker;
616  lldb::ValueObjectSP value_sp(GetSP(locker));
617  lldb::ValueObjectSP new_value_sp;
618  if (value_sp) {
619  ExecutionContext exe_ctx(value_sp->GetExecutionContextRef());
620  new_value_sp = ValueObject::CreateValueObjectFromExpression(
621  name, expression, exe_ctx, options.ref());
622  if (new_value_sp)
623  new_value_sp->SetName(ConstString(name));
624  }
625  sb_value.SetSP(new_value_sp);
626  return LLDB_RECORD_RESULT(sb_value);
627 }
628 
630  lldb::addr_t address,
631  SBType sb_type) {
633  (const char *, lldb::addr_t, lldb::SBType), name, address,
634  sb_type);
635 
636  lldb::SBValue sb_value;
637  ValueLocker locker;
638  lldb::ValueObjectSP value_sp(GetSP(locker));
639  lldb::ValueObjectSP new_value_sp;
640  lldb::TypeImplSP type_impl_sp(sb_type.GetSP());
641  if (value_sp && type_impl_sp) {
642  CompilerType ast_type(type_impl_sp->GetCompilerType(true));
643  ExecutionContext exe_ctx(value_sp->GetExecutionContextRef());
644  new_value_sp = ValueObject::CreateValueObjectFromAddress(name, address,
645  exe_ctx, ast_type);
646  }
647  sb_value.SetSP(new_value_sp);
648  return LLDB_RECORD_RESULT(sb_value);
649 }
650 
652  SBType sb_type) {
654  (const char *, lldb::SBData, lldb::SBType), name, data,
655  sb_type);
656 
657  lldb::SBValue sb_value;
658  lldb::ValueObjectSP new_value_sp;
659  ValueLocker locker;
660  lldb::ValueObjectSP value_sp(GetSP(locker));
661  lldb::TypeImplSP type_impl_sp(sb_type.GetSP());
662  if (value_sp && type_impl_sp) {
663  ExecutionContext exe_ctx(value_sp->GetExecutionContextRef());
664  new_value_sp = ValueObject::CreateValueObjectFromData(
665  name, **data, exe_ctx, type_impl_sp->GetCompilerType(true));
666  new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad);
667  }
668  sb_value.SetSP(new_value_sp);
669  return LLDB_RECORD_RESULT(sb_value);
670 }
671 
674 
675  const bool can_create_synthetic = false;
677  TargetSP target_sp;
678  if (m_opaque_sp)
679  target_sp = m_opaque_sp->GetTargetSP();
680 
681  if (target_sp)
682  use_dynamic = target_sp->GetPreferDynamicValue();
683 
684  return LLDB_RECORD_RESULT(
685  GetChildAtIndex(idx, use_dynamic, can_create_synthetic));
686 }
687 
689  lldb::DynamicValueType use_dynamic,
690  bool can_create_synthetic) {
692  (uint32_t, lldb::DynamicValueType, bool), idx, use_dynamic,
693  can_create_synthetic);
694 
695  lldb::ValueObjectSP child_sp;
696 
697  ValueLocker locker;
698  lldb::ValueObjectSP value_sp(GetSP(locker));
699  if (value_sp) {
700  const bool can_create = true;
701  child_sp = value_sp->GetChildAtIndex(idx, can_create);
702  if (can_create_synthetic && !child_sp) {
703  child_sp = value_sp->GetSyntheticArrayMember(idx, can_create);
704  }
705  }
706 
707  SBValue sb_value;
708  sb_value.SetSP(child_sp, use_dynamic, GetPreferSyntheticValue());
709 
710  return LLDB_RECORD_RESULT(sb_value);
711 }
712 
715  name);
716 
717  uint32_t idx = UINT32_MAX;
718  ValueLocker locker;
719  lldb::ValueObjectSP value_sp(GetSP(locker));
720  if (value_sp) {
721  idx = value_sp->GetIndexOfChildWithName(ConstString(name));
722  }
723  return idx;
724 }
725 
728  (const char *), name);
729 
730  lldb::DynamicValueType use_dynamic_value = eNoDynamicValues;
731  TargetSP target_sp;
732  if (m_opaque_sp)
733  target_sp = m_opaque_sp->GetTargetSP();
734 
735  if (target_sp)
736  use_dynamic_value = target_sp->GetPreferDynamicValue();
737  return LLDB_RECORD_RESULT(GetChildMemberWithName(name, use_dynamic_value));
738 }
739 
740 SBValue
742  lldb::DynamicValueType use_dynamic_value) {
744  (const char *, lldb::DynamicValueType), name,
745  use_dynamic_value);
746 
747  lldb::ValueObjectSP child_sp;
748  const ConstString str_name(name);
749 
750  ValueLocker locker;
751  lldb::ValueObjectSP value_sp(GetSP(locker));
752  if (value_sp) {
753  child_sp = value_sp->GetChildMemberWithName(str_name, true);
754  }
755 
756  SBValue sb_value;
757  sb_value.SetSP(child_sp, use_dynamic_value, GetPreferSyntheticValue());
758 
759  return LLDB_RECORD_RESULT(sb_value);
760 }
761 
764  (lldb::DynamicValueType), use_dynamic);
765 
766  SBValue value_sb;
767  if (IsValid()) {
768  ValueImplSP proxy_sp(new ValueImpl(m_opaque_sp->GetRootSP(), use_dynamic,
769  m_opaque_sp->GetUseSynthetic()));
770  value_sb.SetSP(proxy_sp);
771  }
772  return LLDB_RECORD_RESULT(value_sb);
773 }
774 
777 
778  SBValue value_sb;
779  if (IsValid()) {
780  ValueImplSP proxy_sp(new ValueImpl(m_opaque_sp->GetRootSP(),
782  m_opaque_sp->GetUseSynthetic()));
783  value_sb.SetSP(proxy_sp);
784  }
785  return LLDB_RECORD_RESULT(value_sb);
786 }
787 
790 
791  SBValue value_sb;
792  if (IsValid()) {
793  ValueImplSP proxy_sp(new ValueImpl(m_opaque_sp->GetRootSP(),
794  m_opaque_sp->GetUseDynamic(), false));
795  value_sb.SetSP(proxy_sp);
796  }
797  return LLDB_RECORD_RESULT(value_sb);
798 }
799 
803 
804  if (!IsValid())
805  return eNoDynamicValues;
806  return m_opaque_sp->GetUseDynamic();
807 }
808 
811  (lldb::DynamicValueType), use_dynamic);
812 
813  if (IsValid())
814  return m_opaque_sp->SetUseDynamic(use_dynamic);
815 }
816 
819 
820  if (!IsValid())
821  return false;
822  return m_opaque_sp->GetUseSynthetic();
823 }
824 
825 void SBValue::SetPreferSyntheticValue(bool use_synthetic) {
827  use_synthetic);
828 
829  if (IsValid())
830  return m_opaque_sp->SetUseSynthetic(use_synthetic);
831 }
832 
835 
836  ValueLocker locker;
837  lldb::ValueObjectSP value_sp(GetSP(locker));
838  if (value_sp)
839  return value_sp->IsDynamic();
840  return false;
841 }
842 
845 
846  ValueLocker locker;
847  lldb::ValueObjectSP value_sp(GetSP(locker));
848  if (value_sp)
849  return value_sp->IsSynthetic();
850  return false;
851 }
852 
855 
856  ValueLocker locker;
857  lldb::ValueObjectSP value_sp(GetSP(locker));
858  if (value_sp)
859  return value_sp->IsSyntheticChildrenGenerated();
860  return false;
861 }
862 
865 
866  ValueLocker locker;
867  lldb::ValueObjectSP value_sp(GetSP(locker));
868  if (value_sp)
869  return value_sp->SetSyntheticChildrenGenerated(is);
870 }
871 
874  (const char *), expr_path);
875 
876  lldb::ValueObjectSP child_sp;
877  ValueLocker locker;
878  lldb::ValueObjectSP value_sp(GetSP(locker));
879  if (value_sp) {
880  // using default values for all the fancy options, just do it if you can
881  child_sp = value_sp->GetValueForExpressionPath(expr_path);
882  }
883 
884  SBValue sb_value;
885  sb_value.SetSP(child_sp, GetPreferDynamicValue(), GetPreferSyntheticValue());
886 
887  return LLDB_RECORD_RESULT(sb_value);
888 }
889 
890 int64_t SBValue::GetValueAsSigned(SBError &error, int64_t fail_value) {
892  (lldb::SBError &, int64_t), error, fail_value);
893 
894  error.Clear();
895  ValueLocker locker;
896  lldb::ValueObjectSP value_sp(GetSP(locker));
897  if (value_sp) {
898  bool success = true;
899  uint64_t ret_val = fail_value;
900  ret_val = value_sp->GetValueAsSigned(fail_value, &success);
901  if (!success)
902  error.SetErrorString("could not resolve value");
903  return ret_val;
904  } else
905  error.SetErrorStringWithFormat("could not get SBValue: %s",
906  locker.GetError().AsCString());
907 
908  return fail_value;
909 }
910 
911 uint64_t SBValue::GetValueAsUnsigned(SBError &error, uint64_t fail_value) {
913  (lldb::SBError &, uint64_t), error, fail_value);
914 
915  error.Clear();
916  ValueLocker locker;
917  lldb::ValueObjectSP value_sp(GetSP(locker));
918  if (value_sp) {
919  bool success = true;
920  uint64_t ret_val = fail_value;
921  ret_val = value_sp->GetValueAsUnsigned(fail_value, &success);
922  if (!success)
923  error.SetErrorString("could not resolve value");
924  return ret_val;
925  } else
926  error.SetErrorStringWithFormat("could not get SBValue: %s",
927  locker.GetError().AsCString());
928 
929  return fail_value;
930 }
931 
932 int64_t SBValue::GetValueAsSigned(int64_t fail_value) {
933  LLDB_RECORD_METHOD(int64_t, SBValue, GetValueAsSigned, (int64_t), fail_value);
934 
935  ValueLocker locker;
936  lldb::ValueObjectSP value_sp(GetSP(locker));
937  if (value_sp) {
938  return value_sp->GetValueAsSigned(fail_value);
939  }
940  return fail_value;
941 }
942 
943 uint64_t SBValue::GetValueAsUnsigned(uint64_t fail_value) {
944  LLDB_RECORD_METHOD(uint64_t, SBValue, GetValueAsUnsigned, (uint64_t),
945  fail_value);
946 
947  ValueLocker locker;
948  lldb::ValueObjectSP value_sp(GetSP(locker));
949  if (value_sp) {
950  return value_sp->GetValueAsUnsigned(fail_value);
951  }
952  return fail_value;
953 }
954 
957 
958  bool has_children = false;
959  ValueLocker locker;
960  lldb::ValueObjectSP value_sp(GetSP(locker));
961  if (value_sp)
962  has_children = value_sp->MightHaveChildren();
963 
964  return has_children;
965 }
966 
969 
970  bool is_support = false;
971  ValueLocker locker;
972  lldb::ValueObjectSP value_sp(GetSP(locker));
973  if (value_sp)
974  is_support = value_sp->IsRuntimeSupportValue();
975 
976  return is_support;
977 }
978 
981 
982  return GetNumChildren(UINT32_MAX);
983 }
984 
987 
988  uint32_t num_children = 0;
989 
990  ValueLocker locker;
991  lldb::ValueObjectSP value_sp(GetSP(locker));
992  if (value_sp)
993  num_children = value_sp->GetNumChildren(max);
994 
995  return num_children;
996 }
997 
1000 
1001  SBValue sb_value;
1002  ValueLocker locker;
1003  lldb::ValueObjectSP value_sp(GetSP(locker));
1004  if (value_sp) {
1005  Status error;
1006  sb_value = value_sp->Dereference(error);
1007  }
1008 
1009  return LLDB_RECORD_RESULT(sb_value);
1010 }
1011 
1012 // Deprecated - please use GetType().IsPointerType() instead.
1015 
1016  return GetType().IsPointerType();
1017 }
1018 
1021 
1022  ValueLocker locker;
1023  lldb::ValueObjectSP value_sp(GetSP(locker));
1024  if (value_sp)
1025  return value_sp->GetCompilerType().GetOpaqueQualType();
1026  return nullptr;
1027 }
1028 
1031 
1032  SBTarget sb_target;
1033  TargetSP target_sp;
1034  if (m_opaque_sp) {
1035  target_sp = m_opaque_sp->GetTargetSP();
1036  sb_target.SetSP(target_sp);
1037  }
1038 
1039  return LLDB_RECORD_RESULT(sb_target);
1040 }
1041 
1044 
1045  SBProcess sb_process;
1046  ProcessSP process_sp;
1047  if (m_opaque_sp) {
1048  process_sp = m_opaque_sp->GetProcessSP();
1049  sb_process.SetSP(process_sp);
1050  }
1051 
1052  return LLDB_RECORD_RESULT(sb_process);
1053 }
1054 
1057 
1058  SBThread sb_thread;
1059  ThreadSP thread_sp;
1060  if (m_opaque_sp) {
1061  thread_sp = m_opaque_sp->GetThreadSP();
1062  sb_thread.SetThread(thread_sp);
1063  }
1064 
1065  return LLDB_RECORD_RESULT(sb_thread);
1066 }
1067 
1070 
1071  SBFrame sb_frame;
1072  StackFrameSP frame_sp;
1073  if (m_opaque_sp) {
1074  frame_sp = m_opaque_sp->GetFrameSP();
1075  sb_frame.SetFrameSP(frame_sp);
1076  }
1077 
1078  return LLDB_RECORD_RESULT(sb_frame);
1079 }
1080 
1081 lldb::ValueObjectSP SBValue::GetSP(ValueLocker &locker) const {
1082  if (!m_opaque_sp || !m_opaque_sp->IsValid()) {
1083  locker.GetError().SetErrorString("No value");
1084  return ValueObjectSP();
1085  }
1086  return locker.GetLockedSP(*m_opaque_sp.get());
1087 }
1088 
1089 lldb::ValueObjectSP SBValue::GetSP() const {
1090  LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::ValueObjectSP, SBValue, GetSP);
1091 
1092  ValueLocker locker;
1093  return LLDB_RECORD_RESULT(GetSP(locker));
1094 }
1095 
1096 void SBValue::SetSP(ValueImplSP impl_sp) { m_opaque_sp = impl_sp; }
1097 
1098 void SBValue::SetSP(const lldb::ValueObjectSP &sp) {
1099  if (sp) {
1100  lldb::TargetSP target_sp(sp->GetTargetSP());
1101  if (target_sp) {
1102  lldb::DynamicValueType use_dynamic = target_sp->GetPreferDynamicValue();
1103  bool use_synthetic =
1104  target_sp->TargetProperties::GetEnableSyntheticValue();
1105  m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
1106  } else
1108  } else
1110 }
1111 
1112 void SBValue::SetSP(const lldb::ValueObjectSP &sp,
1113  lldb::DynamicValueType use_dynamic) {
1114  if (sp) {
1115  lldb::TargetSP target_sp(sp->GetTargetSP());
1116  if (target_sp) {
1117  bool use_synthetic =
1118  target_sp->TargetProperties::GetEnableSyntheticValue();
1119  SetSP(sp, use_dynamic, use_synthetic);
1120  } else
1121  SetSP(sp, use_dynamic, true);
1122  } else
1123  SetSP(sp, use_dynamic, false);
1124 }
1125 
1126 void SBValue::SetSP(const lldb::ValueObjectSP &sp, bool use_synthetic) {
1127  if (sp) {
1128  lldb::TargetSP target_sp(sp->GetTargetSP());
1129  if (target_sp) {
1130  lldb::DynamicValueType use_dynamic = target_sp->GetPreferDynamicValue();
1131  SetSP(sp, use_dynamic, use_synthetic);
1132  } else
1133  SetSP(sp, eNoDynamicValues, use_synthetic);
1134  } else
1135  SetSP(sp, eNoDynamicValues, use_synthetic);
1136 }
1137 
1138 void SBValue::SetSP(const lldb::ValueObjectSP &sp,
1139  lldb::DynamicValueType use_dynamic, bool use_synthetic) {
1140  m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
1141 }
1142 
1143 void SBValue::SetSP(const lldb::ValueObjectSP &sp,
1144  lldb::DynamicValueType use_dynamic, bool use_synthetic,
1145  const char *name) {
1146  m_opaque_sp =
1147  ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic, name));
1148 }
1149 
1152  description);
1153 
1154  ValueLocker locker;
1155  lldb::ValueObjectSP value_sp(GetSP(locker));
1156  if (value_sp) {
1157  value_sp->GetExpressionPath(description.ref());
1158  return true;
1159  }
1160  return false;
1161 }
1162 
1164  bool qualify_cxx_base_classes) {
1166  description, qualify_cxx_base_classes);
1167 
1168  ValueLocker locker;
1169  lldb::ValueObjectSP value_sp(GetSP(locker));
1170  if (value_sp) {
1171  value_sp->GetExpressionPath(description.ref());
1172  return true;
1173  }
1174  return false;
1175 }
1176 
1179  (const char *), expr);
1180 
1181  ValueLocker locker;
1182  lldb::ValueObjectSP value_sp(GetSP(locker));
1183  if (!value_sp)
1184  return LLDB_RECORD_RESULT(SBValue());
1185 
1186  lldb::TargetSP target_sp = value_sp->GetTargetSP();
1187  if (!target_sp)
1188  return LLDB_RECORD_RESULT(SBValue());
1189 
1190  lldb::SBExpressionOptions options;
1191  options.SetFetchDynamicValue(target_sp->GetPreferDynamicValue());
1192  options.SetUnwindOnError(true);
1193  options.SetIgnoreBreakpoints(true);
1194 
1195  return LLDB_RECORD_RESULT(EvaluateExpression(expr, options, nullptr));
1196 }
1197 
1200  const SBExpressionOptions &options) const {
1202  (const char *, const lldb::SBExpressionOptions &),
1203  expr, options);
1204 
1205  return LLDB_RECORD_RESULT(EvaluateExpression(expr, options, nullptr));
1206 }
1207 
1209  const SBExpressionOptions &options,
1210  const char *name) const {
1213  (const char *, const lldb::SBExpressionOptions &, const char *), expr,
1214  options, name);
1215 
1216 
1217  if (!expr || expr[0] == '\0') {
1218  return LLDB_RECORD_RESULT(SBValue());
1219  }
1220 
1221 
1222  ValueLocker locker;
1223  lldb::ValueObjectSP value_sp(GetSP(locker));
1224  if (!value_sp) {
1225  return LLDB_RECORD_RESULT(SBValue());
1226  }
1227 
1228  lldb::TargetSP target_sp = value_sp->GetTargetSP();
1229  if (!target_sp) {
1230  return LLDB_RECORD_RESULT(SBValue());
1231  }
1232 
1233  std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
1234  ExecutionContext exe_ctx(target_sp.get());
1235 
1236  StackFrame *frame = exe_ctx.GetFramePtr();
1237  if (!frame) {
1238  return LLDB_RECORD_RESULT(SBValue());
1239  }
1240 
1241  ValueObjectSP res_val_sp;
1242  target_sp->EvaluateExpression(expr, frame, res_val_sp, options.ref(), nullptr,
1243  value_sp.get());
1244 
1245  if (name)
1246  res_val_sp->SetName(ConstString(name));
1247 
1248  SBValue result;
1249  result.SetSP(res_val_sp, options.GetFetchDynamicValue());
1250  return LLDB_RECORD_RESULT(result);
1251 }
1252 
1253 bool SBValue::GetDescription(SBStream &description) {
1255  description);
1256 
1257  Stream &strm = description.ref();
1258 
1259  ValueLocker locker;
1260  lldb::ValueObjectSP value_sp(GetSP(locker));
1261  if (value_sp)
1262  value_sp->Dump(strm);
1263  else
1264  strm.PutCString("No value");
1265 
1266  return true;
1267 }
1268 
1271 
1272  ValueLocker locker;
1273  lldb::ValueObjectSP value_sp(GetSP(locker));
1274  if (value_sp)
1275  return value_sp->GetFormat();
1276  return eFormatDefault;
1277 }
1278 
1280  LLDB_RECORD_METHOD(void, SBValue, SetFormat, (lldb::Format), format);
1281 
1282  ValueLocker locker;
1283  lldb::ValueObjectSP value_sp(GetSP(locker));
1284  if (value_sp)
1285  value_sp->SetFormat(format);
1286 }
1287 
1290 
1291  SBValue sb_value;
1292  ValueLocker locker;
1293  lldb::ValueObjectSP value_sp(GetSP(locker));
1294  if (value_sp) {
1295  Status error;
1296  sb_value.SetSP(value_sp->AddressOf(error), GetPreferDynamicValue(),
1298  }
1299 
1300  return LLDB_RECORD_RESULT(sb_value);
1301 }
1302 
1305 
1307  ValueLocker locker;
1308  lldb::ValueObjectSP value_sp(GetSP(locker));
1309  if (value_sp) {
1310  TargetSP target_sp(value_sp->GetTargetSP());
1311  if (target_sp) {
1312  const bool scalar_is_load_address = true;
1313  AddressType addr_type;
1314  value = value_sp->GetAddressOf(scalar_is_load_address, &addr_type);
1315  if (addr_type == eAddressTypeFile) {
1316  ModuleSP module_sp(value_sp->GetModule());
1317  if (!module_sp)
1318  value = LLDB_INVALID_ADDRESS;
1319  else {
1320  Address addr;
1321  module_sp->ResolveFileAddress(value, addr);
1322  value = addr.GetLoadAddress(target_sp.get());
1323  }
1324  } else if (addr_type == eAddressTypeHost ||
1325  addr_type == eAddressTypeInvalid)
1326  value = LLDB_INVALID_ADDRESS;
1327  }
1328  }
1329 
1330  return value;
1331 }
1332 
1335 
1336  Address addr;
1337  ValueLocker locker;
1338  lldb::ValueObjectSP value_sp(GetSP(locker));
1339  if (value_sp) {
1340  TargetSP target_sp(value_sp->GetTargetSP());
1341  if (target_sp) {
1343  const bool scalar_is_load_address = true;
1344  AddressType addr_type;
1345  value = value_sp->GetAddressOf(scalar_is_load_address, &addr_type);
1346  if (addr_type == eAddressTypeFile) {
1347  ModuleSP module_sp(value_sp->GetModule());
1348  if (module_sp)
1349  module_sp->ResolveFileAddress(value, addr);
1350  } else if (addr_type == eAddressTypeLoad) {
1351  // no need to check the return value on this.. if it can actually do
1352  // the resolve addr will be in the form (section,offset), otherwise it
1353  // will simply be returned as (NULL, value)
1354  addr.SetLoadAddress(value, target_sp.get());
1355  }
1356  }
1357  }
1358 
1359  return LLDB_RECORD_RESULT(SBAddress(addr));
1360 }
1361 
1364  (uint32_t, uint32_t), item_idx, item_count);
1365 
1366  lldb::SBData sb_data;
1367  ValueLocker locker;
1368  lldb::ValueObjectSP value_sp(GetSP(locker));
1369  if (value_sp) {
1370  TargetSP target_sp(value_sp->GetTargetSP());
1371  if (target_sp) {
1372  DataExtractorSP data_sp(new DataExtractor());
1373  value_sp->GetPointeeData(*data_sp, item_idx, item_count);
1374  if (data_sp->GetByteSize() > 0)
1375  *sb_data = data_sp;
1376  }
1377  }
1378 
1379  return LLDB_RECORD_RESULT(sb_data);
1380 }
1381 
1384 
1385  lldb::SBData sb_data;
1386  ValueLocker locker;
1387  lldb::ValueObjectSP value_sp(GetSP(locker));
1388  if (value_sp) {
1389  DataExtractorSP data_sp(new DataExtractor());
1390  Status error;
1391  value_sp->GetData(*data_sp, error);
1392  if (error.Success())
1393  *sb_data = data_sp;
1394  }
1395 
1396  return LLDB_RECORD_RESULT(sb_data);
1397 }
1398 
1401  data, error);
1402 
1403  ValueLocker locker;
1404  lldb::ValueObjectSP value_sp(GetSP(locker));
1405  bool ret = true;
1406 
1407  if (value_sp) {
1408  DataExtractor *data_extractor = data.get();
1409 
1410  if (!data_extractor) {
1411  error.SetErrorString("No data to set");
1412  ret = false;
1413  } else {
1414  Status set_error;
1415 
1416  value_sp->SetData(*data_extractor, set_error);
1417 
1418  if (!set_error.Success()) {
1419  error.SetErrorStringWithFormat("Couldn't set data: %s",
1420  set_error.AsCString());
1421  ret = false;
1422  }
1423  }
1424  } else {
1425  error.SetErrorStringWithFormat(
1426  "Couldn't set data: could not get SBValue: %s",
1427  locker.GetError().AsCString());
1428  ret = false;
1429  }
1430 
1431  return ret;
1432 }
1433 
1436 
1437  ValueLocker locker;
1438  lldb::ValueObjectSP value_sp(GetSP(locker));
1439  SBDeclaration decl_sb;
1440  if (value_sp) {
1441  Declaration decl;
1442  if (value_sp->GetDeclaration(decl))
1443  decl_sb.SetDeclaration(decl);
1444  }
1445  return LLDB_RECORD_RESULT(decl_sb);
1446 }
1447 
1448 lldb::SBWatchpoint SBValue::Watch(bool resolve_location, bool read, bool write,
1449  SBError &error) {
1451  (bool, bool, bool, lldb::SBError &), resolve_location,
1452  read, write, error);
1453 
1454  SBWatchpoint sb_watchpoint;
1455 
1456  // If the SBValue is not valid, there's no point in even trying to watch it.
1457  ValueLocker locker;
1458  lldb::ValueObjectSP value_sp(GetSP(locker));
1459  TargetSP target_sp(GetTarget().GetSP());
1460  if (value_sp && target_sp) {
1461  // Read and Write cannot both be false.
1462  if (!read && !write)
1463  return LLDB_RECORD_RESULT(sb_watchpoint);
1464 
1465  // If the value is not in scope, don't try and watch and invalid value
1466  if (!IsInScope())
1467  return LLDB_RECORD_RESULT(sb_watchpoint);
1468 
1469  addr_t addr = GetLoadAddress();
1470  if (addr == LLDB_INVALID_ADDRESS)
1471  return LLDB_RECORD_RESULT(sb_watchpoint);
1472  size_t byte_size = GetByteSize();
1473  if (byte_size == 0)
1474  return LLDB_RECORD_RESULT(sb_watchpoint);
1475 
1476  uint32_t watch_type = 0;
1477  if (read)
1478  watch_type |= LLDB_WATCH_TYPE_READ;
1479  if (write)
1480  watch_type |= LLDB_WATCH_TYPE_WRITE;
1481 
1482  Status rc;
1483  CompilerType type(value_sp->GetCompilerType());
1484  WatchpointSP watchpoint_sp =
1485  target_sp->CreateWatchpoint(addr, byte_size, &type, watch_type, rc);
1486  error.SetError(rc);
1487 
1488  if (watchpoint_sp) {
1489  sb_watchpoint.SetSP(watchpoint_sp);
1490  Declaration decl;
1491  if (value_sp->GetDeclaration(decl)) {
1492  if (decl.GetFile()) {
1493  StreamString ss;
1494  // True to show fullpath for declaration file.
1495  decl.DumpStopContext(&ss, true);
1496  watchpoint_sp->SetDeclInfo(std::string(ss.GetString()));
1497  }
1498  }
1499  }
1500  } else if (target_sp) {
1501  error.SetErrorStringWithFormat("could not get SBValue: %s",
1502  locker.GetError().AsCString());
1503  } else {
1504  error.SetErrorString("could not set watchpoint, a target is required");
1505  }
1506 
1507  return LLDB_RECORD_RESULT(sb_watchpoint);
1508 }
1509 
1510 // FIXME: Remove this method impl (as well as the decl in .h) once it is no
1511 // longer needed.
1512 // Backward compatibility fix in the interim.
1513 lldb::SBWatchpoint SBValue::Watch(bool resolve_location, bool read,
1514  bool write) {
1515  LLDB_RECORD_METHOD(lldb::SBWatchpoint, SBValue, Watch, (bool, bool, bool),
1516  resolve_location, read, write);
1517 
1518  SBError error;
1519  return LLDB_RECORD_RESULT(Watch(resolve_location, read, write, error));
1520 }
1521 
1522 lldb::SBWatchpoint SBValue::WatchPointee(bool resolve_location, bool read,
1523  bool write, SBError &error) {
1525  (bool, bool, bool, lldb::SBError &), resolve_location,
1526  read, write, error);
1527 
1528  SBWatchpoint sb_watchpoint;
1529  if (IsInScope() && GetType().IsPointerType())
1530  sb_watchpoint = Dereference().Watch(resolve_location, read, write, error);
1531  return LLDB_RECORD_RESULT(sb_watchpoint);
1532 }
1533 
1536 
1537  ValueLocker locker;
1538  lldb::ValueObjectSP value_sp(GetSP(locker));
1539  SBValue persisted_sb;
1540  if (value_sp) {
1541  persisted_sb.SetSP(value_sp->Persist());
1542  }
1543  return LLDB_RECORD_RESULT(persisted_sb);
1544 }
1545 
1546 namespace lldb_private {
1547 namespace repro {
1548 
1549 template <>
1552  LLDB_REGISTER_CONSTRUCTOR(SBValue, (const lldb::ValueObjectSP &));
1555  SBValue, operator=,(const lldb::SBValue &));
1556  LLDB_REGISTER_METHOD(bool, SBValue, IsValid, ());
1557  LLDB_REGISTER_METHOD_CONST(bool, SBValue, operator bool, ());
1558  LLDB_REGISTER_METHOD(void, SBValue, Clear, ());
1559  LLDB_REGISTER_METHOD(lldb::SBError, SBValue, GetError, ());
1561  LLDB_REGISTER_METHOD(const char *, SBValue, GetName, ());
1562  LLDB_REGISTER_METHOD(const char *, SBValue, GetTypeName, ());
1563  LLDB_REGISTER_METHOD(const char *, SBValue, GetDisplayTypeName, ());
1564  LLDB_REGISTER_METHOD(size_t, SBValue, GetByteSize, ());
1565  LLDB_REGISTER_METHOD(bool, SBValue, IsInScope, ());
1566  LLDB_REGISTER_METHOD(const char *, SBValue, GetValue, ());
1567  LLDB_REGISTER_METHOD(lldb::ValueType, SBValue, GetValueType, ());
1568  LLDB_REGISTER_METHOD(const char *, SBValue, GetObjectDescription, ());
1569  LLDB_REGISTER_METHOD(lldb::SBType, SBValue, GetType, ());
1570  LLDB_REGISTER_METHOD(bool, SBValue, GetValueDidChange, ());
1571  LLDB_REGISTER_METHOD(const char *, SBValue, GetSummary, ());
1572  LLDB_REGISTER_METHOD(const char *, SBValue, GetSummary,
1574  LLDB_REGISTER_METHOD(const char *, SBValue, GetLocation, ());
1575  LLDB_REGISTER_METHOD(bool, SBValue, SetValueFromCString, (const char *));
1576  LLDB_REGISTER_METHOD(bool, SBValue, SetValueFromCString,
1577  (const char *, lldb::SBError &));
1578  LLDB_REGISTER_METHOD(lldb::SBTypeFormat, SBValue, GetTypeFormat, ());
1579  LLDB_REGISTER_METHOD(lldb::SBTypeSummary, SBValue, GetTypeSummary, ());
1580  LLDB_REGISTER_METHOD(lldb::SBTypeFilter, SBValue, GetTypeFilter, ());
1581  LLDB_REGISTER_METHOD(lldb::SBTypeSynthetic, SBValue, GetTypeSynthetic, ());
1582  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, CreateChildAtOffset,
1583  (const char *, uint32_t, lldb::SBType));
1585  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, CreateValueFromExpression,
1586  (const char *, const char *));
1588  lldb::SBValue, SBValue, CreateValueFromExpression,
1589  (const char *, const char *, lldb::SBExpressionOptions &));
1590  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, CreateValueFromAddress,
1591  (const char *, lldb::addr_t, lldb::SBType));
1592  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, CreateValueFromData,
1593  (const char *, lldb::SBData, lldb::SBType));
1594  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetChildAtIndex, (uint32_t));
1595  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetChildAtIndex,
1596  (uint32_t, lldb::DynamicValueType, bool));
1597  LLDB_REGISTER_METHOD(uint32_t, SBValue, GetIndexOfChildWithName,
1598  (const char *));
1599  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetChildMemberWithName,
1600  (const char *));
1601  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetChildMemberWithName,
1602  (const char *, lldb::DynamicValueType));
1603  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetDynamicValue,
1605  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetStaticValue, ());
1606  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetNonSyntheticValue, ());
1607  LLDB_REGISTER_METHOD(lldb::DynamicValueType, SBValue, GetPreferDynamicValue,
1608  ());
1609  LLDB_REGISTER_METHOD(void, SBValue, SetPreferDynamicValue,
1611  LLDB_REGISTER_METHOD(bool, SBValue, GetPreferSyntheticValue, ());
1612  LLDB_REGISTER_METHOD(void, SBValue, SetPreferSyntheticValue, (bool));
1613  LLDB_REGISTER_METHOD(bool, SBValue, IsDynamic, ());
1614  LLDB_REGISTER_METHOD(bool, SBValue, IsSynthetic, ());
1615  LLDB_REGISTER_METHOD(bool, SBValue, IsSyntheticChildrenGenerated, ());
1616  LLDB_REGISTER_METHOD(void, SBValue, SetSyntheticChildrenGenerated, (bool));
1617  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, GetValueForExpressionPath,
1618  (const char *));
1619  LLDB_REGISTER_METHOD(int64_t, SBValue, GetValueAsSigned,
1620  (lldb::SBError &, int64_t));
1621  LLDB_REGISTER_METHOD(uint64_t, SBValue, GetValueAsUnsigned,
1622  (lldb::SBError &, uint64_t));
1623  LLDB_REGISTER_METHOD(int64_t, SBValue, GetValueAsSigned, (int64_t));
1624  LLDB_REGISTER_METHOD(uint64_t, SBValue, GetValueAsUnsigned, (uint64_t));
1625  LLDB_REGISTER_METHOD(bool, SBValue, MightHaveChildren, ());
1626  LLDB_REGISTER_METHOD(bool, SBValue, IsRuntimeSupportValue, ());
1627  LLDB_REGISTER_METHOD(uint32_t, SBValue, GetNumChildren, ());
1628  LLDB_REGISTER_METHOD(uint32_t, SBValue, GetNumChildren, (uint32_t));
1629  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, Dereference, ());
1630  LLDB_REGISTER_METHOD(bool, SBValue, TypeIsPointerType, ());
1631  LLDB_REGISTER_METHOD(void *, SBValue, GetOpaqueType, ());
1632  LLDB_REGISTER_METHOD(lldb::SBTarget, SBValue, GetTarget, ());
1633  LLDB_REGISTER_METHOD(lldb::SBProcess, SBValue, GetProcess, ());
1634  LLDB_REGISTER_METHOD(lldb::SBThread, SBValue, GetThread, ());
1635  LLDB_REGISTER_METHOD(lldb::SBFrame, SBValue, GetFrame, ());
1636  LLDB_REGISTER_METHOD_CONST(lldb::ValueObjectSP, SBValue, GetSP, ());
1637  LLDB_REGISTER_METHOD(bool, SBValue, GetExpressionPath, (lldb::SBStream &));
1638  LLDB_REGISTER_METHOD(bool, SBValue, GetExpressionPath,
1639  (lldb::SBStream &, bool));
1640  LLDB_REGISTER_METHOD_CONST(lldb::SBValue, SBValue, EvaluateExpression,
1641  (const char *));
1643  lldb::SBValue, SBValue, EvaluateExpression,
1644  (const char *, const lldb::SBExpressionOptions &));
1646  lldb::SBValue, SBValue, EvaluateExpression,
1647  (const char *, const lldb::SBExpressionOptions &, const char *));
1648  LLDB_REGISTER_METHOD(bool, SBValue, GetDescription, (lldb::SBStream &));
1649  LLDB_REGISTER_METHOD(lldb::Format, SBValue, GetFormat, ());
1650  LLDB_REGISTER_METHOD(void, SBValue, SetFormat, (lldb::Format));
1651  LLDB_REGISTER_METHOD(lldb::SBValue, SBValue, AddressOf, ());
1652  LLDB_REGISTER_METHOD(lldb::addr_t, SBValue, GetLoadAddress, ());
1653  LLDB_REGISTER_METHOD(lldb::SBAddress, SBValue, GetAddress, ());
1654  LLDB_REGISTER_METHOD(lldb::SBData, SBValue, GetPointeeData,
1655  (uint32_t, uint32_t));
1656  LLDB_REGISTER_METHOD(lldb::SBData, SBValue, GetData, ());
1657  LLDB_REGISTER_METHOD(bool, SBValue, SetData,
1658  (lldb::SBData &, lldb::SBError &));
1659  LLDB_REGISTER_METHOD(lldb::SBDeclaration, SBValue, GetDeclaration, ());
1661  (bool, bool, bool, lldb::SBError &));
1663  (bool, bool, bool));
1665  (bool, bool, bool, lldb::SBError &));
1667 }
1668 
1669 }
1670 }
lldb::SBValue::SetPreferSyntheticValue
void SetPreferSyntheticValue(bool use_synthetic)
Definition: SBValue.cpp:825
lldb::SBValue::GetDeclaration
lldb::SBDeclaration GetDeclaration()
Definition: SBValue.cpp:1434
lldb_private::Address::SetLoadAddress
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
Definition: Address.cpp:1023
SBTypeSynthetic.h
Block.h
lldb::SBValue::GetDescription
bool GetDescription(lldb::SBStream &description)
Definition: SBValue.cpp:1253
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
LLDB_WATCH_TYPE_WRITE
#define LLDB_WATCH_TYPE_WRITE
Definition: lldb-defines.h:58
Scalar.h
lldb::SBStream::ref
lldb_private::Stream & ref()
Definition: SBStream.cpp:178
lldb::SBThread
Definition: SBThread.h:20
lldb::SBValue::CreateChildAtOffset
lldb::SBValue CreateChildAtOffset(const char *name, uint32_t offset, lldb::SBType type)
Definition: SBValue.cpp:562
lldb::SBValue::GetNonSyntheticValue
lldb::SBValue GetNonSyntheticValue()
Definition: SBValue.cpp:788
lldb::SBThread::SetThread
void SetThread(const lldb::ThreadSP &lldb_object_sp)
Definition: SBThread.cpp:379
lldb::SBTypeFilter
Definition: SBTypeFilter.h:17
lldb::SBTypeSummary::SetSP
void SetSP(const lldb::TypeSummaryImplSP &typefilter_impl_sp)
Definition: SBTypeSummary.cpp:411
lldb::SBStream::Printf
void Printf(const char *format,...) __attribute__((format(printf
Definition: SBStream.cpp:69
SBTypeSummary.h
lldb::Format
Format
Display format definitions.
Definition: lldb-enumerations.h:155
LLDB_WATCH_TYPE_READ
#define LLDB_WATCH_TYPE_READ
Definition: lldb-defines.h:57
lldb::SBValue::GetValue
const char * GetValue()
Definition: SBValue.cpp:356
lldb::eNoDynamicValues
@ eNoDynamicValues
Definition: lldb-enumerations.h:495
lldb::SBValue::SetPreferDynamicValue
void SetPreferDynamicValue(lldb::DynamicValueType use_dynamic)
Definition: SBValue.cpp:809
LLDB_RECORD_RESULT
#define LLDB_RECORD_RESULT(Result)
Definition: ReproducerInstrumentation.h:211
lldb::SBWatchpoint::SetSP
void SetSP(const lldb::WatchpointSP &sp)
Definition: SBWatchpoint.cpp:268
ValueImpl::m_name
ConstString m_name
Definition: SBValue.cpp:199
lldb::SBExpressionOptions::GetFetchDynamicValue
lldb::DynamicValueType GetFetchDynamicValue() const
Definition: SBExpressionOptions.cpp:85
LLDB_RECORD_METHOD_CONST_NO_ARGS
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:168
lldb::SBError
Definition: SBError.h:20
lldb::SBValue::MightHaveChildren
bool MightHaveChildren()
Find out if a SBValue might have children.
Definition: SBValue.cpp:955
lldb::SBValue::IsSyntheticChildrenGenerated
bool IsSyntheticChildrenGenerated()
Definition: SBValue.cpp:853
lldb_private::AddressType
AddressType
Definition: lldb-private-enumerations.h:30
LLDB_INVALID_UID
#define LLDB_INVALID_UID
Definition: lldb-defines.h:92
lldb::SBProcess::SetSP
void SetSP(const lldb::ProcessSP &process_sp)
Definition: SBProcess.cpp:108
LLDB_RECORD_METHOD_NO_ARGS
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:165
lldb::SBValue::GetLocation
const char * GetLocation()
Definition: SBValue.cpp:453
lldb::SBValue
Definition: SBValue.h:21
ValueImpl::m_use_synthetic
bool m_use_synthetic
Definition: SBValue.cpp:198
ValueImpl
Definition: SBValue.cpp:54
lldb::SBValue::GetAddress
lldb::SBAddress GetAddress()
Definition: SBValue.cpp:1333
Module.h
lldb_private::eAddressTypeHost
@ eAddressTypeHost
Address is an address in the process that is running this code.
Definition: lldb-private-enumerations.h:36
lldb::SBValue::GetTypeFormat
lldb::SBTypeFormat GetTypeFormat()
Definition: SBValue.cpp:490
ValueImpl::GetFrameSP
StackFrameSP GetFrameSP()
Definition: SBValue.cpp:188
ValueImpl::SetUseDynamic
void SetUseDynamic(lldb::DynamicValueType use_dynamic)
Definition: SBValue.cpp:153
ValueImpl::GetUseSynthetic
bool GetUseSynthetic()
Definition: SBValue.cpp:161
lldb_private::ProcessRunLock::ProcessRunLocker
Definition: ProcessRunLock.h:36
lldb::SBDeclaration
Definition: SBDeclaration.h:18
LLDB_RECORD_CONSTRUCTOR_NO_ARGS
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
Definition: ReproducerInstrumentation.h:136
lldb::SBExpressionOptions::SetUnwindOnError
void SetUnwindOnError(bool unwind=true)
Definition: SBExpressionOptions.cpp:64
lldb_private::ExecutionContext::GetFramePtr
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Definition: ExecutionContext.h:408
ValueImpl::GetProcessSP
ProcessSP GetProcessSP()
Definition: SBValue.cpp:174
lldb_private::Declaration::GetFile
FileSpec & GetFile()
Get accessor for file specification.
Definition: Declaration.h:107
LLDB_REGISTER_METHOD_CONST
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:98
lldb::SBValue::CreateValueFromExpression
lldb::SBValue CreateValueFromExpression(const char *name, const char *expression)
Definition: SBValue.cpp:596
StackFrame.h
lldb::SBProcess
Definition: SBProcess.h:23
ValueLocker
Definition: SBValue.cpp:202
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
SBReproducerPrivate.h
lldb::SBValue::GetValueDidChange
bool GetValueDidChange()
Definition: SBValue.cpp:409
lldb::SBExpressionOptions::ref
lldb_private::EvaluateExpressionOptions & ref() const
Definition: SBExpressionOptions.cpp:284
lldb::SBValue::GetStaticValue
lldb::SBValue GetStaticValue()
Definition: SBValue.cpp:775
ValueLocker::m_stop_locker
Process::StopLocker m_stop_locker
Definition: SBValue.cpp:213
LLDB_REGISTER_CONSTRUCTOR
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
Definition: ReproducerInstrumentation.h:89
lldb::SBValue::IsValid
bool IsValid()
Definition: SBValue.cpp:244
lldb::SBValue::GetThread
lldb::SBThread GetThread()
Definition: SBValue.cpp:1055
lldb::SBValue::GetByteSize
size_t GetByteSize()
Definition: SBValue.cpp:328
lldb::SBValue::GetFrame
lldb::SBFrame GetFrame()
Definition: SBValue.cpp:1068
lldb_private::Target
Definition: Target.h:451
Section.h
lldb::SBTypeSummary
Definition: SBTypeSummary.h:57
lldb::SBValue::GetFormat
lldb::Format GetFormat()
Definition: SBValue.cpp:1269
lldb::SBValue::GetValueAsUnsigned
uint64_t GetValueAsUnsigned(lldb::SBError &error, uint64_t fail_value=0)
Definition: SBValue.cpp:911
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
ValueImpl::ValueImpl
ValueImpl(const ValueImpl &rhs)
Definition: SBValue.cpp:72
lldb::SBValue::GetTypeName
const char * GetTypeName()
Definition: SBValue.cpp:302
Process.h
ValueImpl::m_use_dynamic
lldb::DynamicValueType m_use_dynamic
Definition: SBValue.cpp:197
lldb::SBValue::SBValue
SBValue()
Definition: SBValue.cpp:218
SBExpressionOptions.h
lldb::SBValue::SetValueFromCString
bool SetValueFromCString(const char *value_str)
Definition: SBValue.cpp:466
ValueImpl::GetTargetSP
TargetSP GetTargetSP()
Definition: SBValue.cpp:167
Target.h
ValueLocker::GetLockedSP
ValueObjectSP GetLockedSP(ValueImpl &in_value)
Definition: SBValue.cpp:206
lldb::SBTarget
Definition: SBTarget.h:29
ValueImpl::IsValid
bool IsValid()
Definition: SBValue.cpp:86
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Status::Success
bool Success() const
Test for success condition.
Definition: Status.cpp:288
SBStream.h
lldb::SBFrame
Definition: SBFrame.h:17
lldb::SBValue::GetError
SBError GetError()
Definition: SBValue.cpp:264
lldb::SBValue::EvaluateExpression
lldb::SBValue EvaluateExpression(const char *expr) const
Definition: SBValue.cpp:1177
lldb::SBError::SetErrorStringWithFormat
int SetErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition: SBError.cpp:131
LLDB_RECORD_METHOD
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:158
Watchpoint.h
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::eAddressTypeInvalid
@ eAddressTypeInvalid
Definition: lldb-private-enumerations.h:31
SBThread.h
lldb_private::Target::GetAPIMutex
std::recursive_mutex & GetAPIMutex()
Definition: Target.cpp:4449
lldb::SBValue::Cast
lldb::SBValue Cast(lldb::SBType type)
Definition: SBValue.cpp:583
lldb::SBValue::IsRuntimeSupportValue
bool IsRuntimeSupportValue()
Definition: SBValue.cpp:967
lldb::SBValue::SetSyntheticChildrenGenerated
void SetSyntheticChildrenGenerated(bool)
Definition: SBValue.cpp:863
lldb_private::ProcessRunLock::ProcessRunLocker::TryLock
bool TryLock(ProcessRunLock *lock)
Definition: ProcessRunLock.h:43
lldb_private::Declaration::DumpStopContext
bool DumpStopContext(Stream *s, bool show_fullpaths) const
Definition: Declaration.cpp:35
lldb::SBValue::GetValueAsSigned
int64_t GetValueAsSigned(lldb::SBError &error, int64_t fail_value=0)
Definition: SBValue.cpp:890
lldb::SBValue::GetProcess
lldb::SBProcess GetProcess()
Definition: SBValue.cpp:1042
SBFrame.h
Declaration.h
lldb::SBValue::GetTypeFilter
lldb::SBTypeFilter GetTypeFilter()
Definition: SBValue.cpp:522
lldb::SBValue::~SBValue
~SBValue()
GetName
static llvm::StringRef GetName(XcodeSDK::Type type)
Definition: XcodeSDK.cpp:21
lldb::SBValue::m_opaque_sp
ValueImplSP m_opaque_sp
Definition: SBValue.h:426
Type.h
ValueLocker::m_lock
std::unique_lock< std::recursive_mutex > m_lock
Definition: SBValue.cpp:214
lldb::SBValue::GetChildMemberWithName
lldb::SBValue GetChildMemberWithName(const char *name)
Definition: SBValue.cpp:726
lldb::SBTypeFormat
Definition: SBTypeFormat.h:17
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::StreamString
Definition: StreamString.h:23
lldb::SBValue::GetValueForExpressionPath
lldb::SBValue GetValueForExpressionPath(const char *expr_path)
Definition: SBValue.cpp:872
lldb::SBValue::GetIndexOfChildWithName
uint32_t GetIndexOfChildWithName(const char *name)
Definition: SBValue.cpp:713
SBDeclaration.h
lldb::SBValue::IsInScope
bool IsInScope()
Definition: SBValue.cpp:342
lldb::SBValue::GetValueType
ValueType GetValueType()
Definition: SBValue.cpp:369
lldb::SBValue::GetID
lldb::user_id_t GetID()
Definition: SBValue.cpp:280
SBDebugger.h
lldb::DynamicValueType
DynamicValueType
Definition: lldb-enumerations.h:494
lldb::SBTypeFormat::SetSP
void SetSP(const lldb::TypeFormatImplSP &typeformat_impl_sp)
Definition: SBTypeFormat.cpp:159
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
lldb::SBValue::IsDynamic
bool IsDynamic()
Definition: SBValue.cpp:833
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::SBValue::GetDisplayTypeName
const char * GetDisplayTypeName()
Definition: SBValue.cpp:315
lldb_private::eAddressTypeLoad
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
Definition: lldb-private-enumerations.h:34
lldb_private::EvaluateExpressionOptions::SetKeepInMemory
void SetKeepInMemory(bool keep=true)
Definition: Target.h:316
Thread.h
lldb::SBError::SetError
void SetError(uint32_t err, lldb::ErrorType type)
Definition: SBError.cpp:97
VariableList.h
ValueObject.h
lldb::SBValue::GetExpressionPath
bool GetExpressionPath(lldb::SBStream &description)
Definition: SBValue.cpp:1150
ObjectFile.h
lldb::SBValue::IsSynthetic
bool IsSynthetic()
Definition: SBValue.cpp:843
lldb::SBType
Definition: SBType.h:104
lldb::SBValue::Persist
lldb::SBValue Persist()
Definition: SBValue.cpp:1534
lldb::SBValue::TypeIsPointerType
bool TypeIsPointerType()
Definition: SBValue.cpp:1013
lldb::SBValue::GetName
const char * GetName()
Definition: SBValue.cpp:290
ValueImpl::GetThreadSP
ThreadSP GetThreadSP()
Definition: SBValue.cpp:181
ValueObjectConstResult.h
lldb::SBExpressionOptions::SetFetchDynamicValue
void SetFetchDynamicValue(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
Definition: SBExpressionOptions.cpp:92
lldb::SBWatchpoint
Definition: SBWatchpoint.h:16
LLDB_RECORD_CONSTRUCTOR
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
Definition: ReproducerInstrumentation.h:133
lldb::SBValue::CreateValueFromData
lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data, lldb::SBType type)
Definition: SBValue.cpp:651
StreamFile.h
lldb::SBValue::CreateValueFromAddress
lldb::SBValue CreateValueFromAddress(const char *name, lldb::addr_t address, lldb::SBType type)
Definition: SBValue.cpp:629
lldb::SBValue::GetPointeeData
lldb::SBData GetPointeeData(uint32_t item_idx=0, uint32_t item_count=1)
Get an SBData wrapping what this SBValue points to.
Definition: SBValue.cpp:1362
lldb_private::repro::Registry
The registry contains a unique mapping between functions and their ID.
Definition: ReproducerInstrumentation.h:517
lldb::SBType::IsPointerType
bool IsPointerType()
Definition: SBType.cpp:132
lldb::SBExpressionOptions
Definition: SBExpressionOptions.h:18
lldb::SBValue::GetChildAtIndex
lldb::SBValue GetChildAtIndex(uint32_t idx)
Definition: SBValue.cpp:672
lldb::SBValue::GetTypeSummary
lldb::SBTypeSummary GetTypeSummary()
Definition: SBValue.cpp:506
lldb::SBValue::GetOpaqueType
void * GetOpaqueType()
Definition: SBValue.cpp:1019
lldb_private::Status
Definition: Status.h:44
DataVisualization.h
lldb::ValueType
ValueType
Definition: lldb-enumerations.h:315
lldb::SBValue::Clear
void Clear()
Definition: SBValue.cpp:258
ValueImpl::GetSP
lldb::ValueObjectSP GetSP(Process::StopLocker &stop_locker, std::unique_lock< std::recursive_mutex > &lock, Status &error)
Definition: SBValue.cpp:108
lldb::SBValue::GetTypeSynthetic
lldb::SBTypeSynthetic GetTypeSynthetic()
Definition: SBValue.cpp:542
lldb::SBValue::GetType
lldb::SBType GetType()
Definition: SBValue.cpp:394
uint32_t
ValueImpl::SetUseSynthetic
void SetUseSynthetic(bool use_synthetic)
Definition: SBValue.cpp:157
ValueImpl::GetRootSP
lldb::ValueObjectSP GetRootSP()
Definition: SBValue.cpp:106
lldb::SBValue::GetDynamicValue
lldb::SBValue GetDynamicValue(lldb::DynamicValueType use_dynamic)
Definition: SBValue.cpp:762
lldb_private::Address
Definition: Address.h:59
lldb::SBValue::GetSummary
const char * GetSummary()
Definition: SBValue.cpp:423
ValueImpl::m_valobj_sp
lldb::ValueObjectSP m_valobj_sp
Definition: SBValue.cpp:196
lldb::SBValue::WatchPointee
lldb::SBWatchpoint WatchPointee(bool resolve_location, bool read, bool write, SBError &error)
Watch this value that this value points to in memory.
Definition: SBValue.cpp:1522
lldb_private::eAddressTypeFile
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
Definition: lldb-private-enumerations.h:32
lldb::SBValue::GetLoadAddress
lldb::addr_t GetLoadAddress()
Definition: SBValue.cpp:1303
lldb_private::Status::SetErrorString
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
Definition: Status.cpp:242
lldb::SBData
Definition: SBData.h:20
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:310
lldb::SBType::GetSP
lldb::TypeImplSP GetSP()
Definition: SBType.cpp:77
lldb::SBValue::SetSP
void SetSP(const lldb::ValueObjectSP &sp)
Definition: SBValue.cpp:1098
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb::SBValue::SetFormat
void SetFormat(lldb::Format format)
Definition: SBValue.cpp:1279
lldb::SBDeclaration::SetDeclaration
void SetDeclaration(const lldb_private::Declaration &lldb_object_ref)
Definition: SBDeclaration.cpp:48
SBValue.h
lldb::SBValue::Watch
lldb::SBWatchpoint Watch(bool resolve_location, bool read, bool write, SBError &error)
Watch this value if it resides in memory.
Definition: SBValue.cpp:1448
lldb::SBTypeSummaryOptions
Definition: SBTypeSummary.h:16
lldb::SBValue::ValueImplSP
std::shared_ptr< ValueImpl > ValueImplSP
Definition: SBValue.h:425
lldb::SBTypeSynthetic
Definition: SBTypeSynthetic.h:17
SBTypeFilter.h
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
lldb::SBValue::GetPreferSyntheticValue
bool GetPreferSyntheticValue()
Definition: SBValue.cpp:817
DataExtractor.h
lldb::SBValue::GetPreferDynamicValue
lldb::DynamicValueType GetPreferDynamicValue()
Definition: SBValue.cpp:800
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
lldb::SBAddress
Definition: SBAddress.h:17
lldb::SBTarget::SetSP
void SetSP(const lldb::TargetSP &target_sp)
Definition: SBTarget.cpp:607
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
ValueLocker::m_lock_error
Status m_lock_error
Definition: SBValue.cpp:215
lldb::SBValue::GetSP
lldb::ValueObjectSP GetSP() const
Same as the protected version of GetSP that takes a locker, except that we make the locker locally in...
Definition: SBValue.cpp:1089
ValueLocker::GetError
Status & GetError()
Definition: SBValue.cpp:210
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
SBTypeFormat.h
lldb::SBValue::GetData
lldb::SBData GetData()
Get an SBData wrapping the contents of this SBValue.
Definition: SBValue.cpp:1382
lldb::eValueTypeInvalid
@ eValueTypeInvalid
Definition: lldb-enumerations.h:316
lldb::SBData::get
lldb_private::DataExtractor * get() const
Definition: SBData.cpp:50
SBProcess.h
ValueImpl::ValueImpl
ValueImpl(lldb::ValueObjectSP in_valobj_sp, lldb::DynamicValueType use_dynamic, bool use_synthetic, const char *name=nullptr)
Definition: SBValue.cpp:58
lldb::SBValue::SetData
bool SetData(lldb::SBData &data, lldb::SBError &error)
Definition: SBValue.cpp:1399
lldb::SBValue::GetObjectDescription
const char * GetObjectDescription()
Definition: SBValue.cpp:381
Stream.h
lldb::SBTypeSynthetic::SetSP
void SetSP(const lldb::ScriptedSyntheticChildrenSP &typefilter_impl_sp)
Definition: SBTypeSynthetic.cpp:189
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb::SBFrame::SetFrameSP
void SetFrameSP(const lldb::StackFrameSP &lldb_object_sp)
Definition: SBFrame.cpp:88
lldb::SBType::IsValid
bool IsValid() const
Definition: SBType.cpp:109
lldb::SBTypeSummaryOptions::ref
lldb_private::TypeSummaryOptions & ref()
Definition: SBTypeSummary.cpp:94
lldb::SBValue::GetNumChildren
uint32_t GetNumChildren()
Definition: SBValue.cpp:979
lldb::SBStream
Definition: SBStream.h:18
LLDB_RECORD_METHOD_CONST
#define LLDB_RECORD_METHOD_CONST(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:161
ValueImpl::operator=
ValueImpl & operator=(const ValueImpl &rhs)
Definition: SBValue.cpp:76
Variable.h
lldb::SBAddress
class LLDB_API SBAddress
Definition: SBDefines.h:21
SBTarget.h
lldb_private::Declaration
Definition: Declaration.h:24
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb::SBValue::GetTarget
lldb::SBTarget GetTarget()
Definition: SBValue.cpp:1029
lldb::SBValue::operator=
lldb::SBValue & operator=(const lldb::SBValue &rhs)
Definition: SBValue.cpp:232
lldb
Definition: SBAddress.h:15
lldb::SBValue::Dereference
lldb::SBValue Dereference()
Definition: SBValue.cpp:998
lldb::SBType::SetSP
void SetSP(const lldb::TypeImplSP &type_impl_sp)
Definition: SBType.cpp:79
Value.h
lldb_private::repro::RegisterMethods< SBValue >
void RegisterMethods< SBValue >(Registry &R)
Definition: SBValue.cpp:1550
lldb::SBValue::AddressOf
lldb::SBValue AddressOf()
Definition: SBValue.cpp:1288
lldb::eFormatDefault
@ eFormatDefault
Definition: lldb-enumerations.h:156
ExecutionContext.h
ValueImpl::GetUseDynamic
lldb::DynamicValueType GetUseDynamic()
Definition: SBValue.cpp:159
lldb::SBStream::GetData
const char * GetData()
Definition: SBStream.cpp:43
lldb::SBExpressionOptions::SetIgnoreBreakpoints
void SetIgnoreBreakpoints(bool ignore=true)
Definition: SBExpressionOptions.cpp:78
lldb_private::Status::AsCString
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
Definition: Status.cpp:131
lldb::SBTypeFilter::SetSP
void SetSP(const lldb::TypeFilterImplSP &typefilter_impl_sp)
Definition: SBTypeFilter.cpp:171
LLDB_REGISTER_METHOD
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:93