LLDB  mainline
SBValueList.h
Go to the documentation of this file.
1 //===-- SBValueList.h -------------------------------------------*- C++ -*-===//
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 #ifndef LLDB_API_SBVALUELIST_H
10 #define LLDB_API_SBVALUELIST_H
11 
12 #include "lldb/API/SBDefines.h"
13 
14 class ValueListImpl;
15 
16 namespace lldb {
17 
19 public:
20  SBValueList();
21 
22  SBValueList(const lldb::SBValueList &rhs);
23 
24  ~SBValueList();
25 
26  explicit operator bool() const;
27 
28  bool IsValid() const;
29 
30  void Clear();
31 
32  void Append(const lldb::SBValue &val_obj);
33 
34  void Append(const lldb::SBValueList &value_list);
35 
36  uint32_t GetSize() const;
37 
38  lldb::SBValue GetValueAtIndex(uint32_t idx) const;
39 
40  lldb::SBValue GetFirstValueByName(const char *name) const;
41 
42  lldb::SBValue FindValueObjectByUID(lldb::user_id_t uid);
43 
44  const lldb::SBValueList &operator=(const lldb::SBValueList &rhs);
45 
46  // Get an error for why this list is empty.
47  //
48  // If this list is empty, check for an underlying error in the debug
49  // information that prevented this list from being populated. This is not
50  // meant to return an error if there is no debug information as it is ok for a
51  // value list to be empty and no error should be returned in that case. If the
52  // debug info is for an assembly file or language that doesn't have any
53  // variables, no error should be returned.
54  //
55  // This is designed as a way to let users know when they enable certain
56  // compiler options that enable debug information but provide a degraded
57  // debug information content, like -gline-tables-only, which is a compiler
58  // option that allows users to set file and line breakpoints, but users get
59  // confused when no variables show up during debugging.
60  //
61  // It is also designed to inform a user that debug information might be
62  // available if an external file, like a .dwo file, but that file doesn't
63  // exist or wasn't able to be loaded due to a mismatched ID. When debugging
64  // with fission enabled, the line tables are linked into the main executable,
65  // but if the .dwo or .dwp files are not available or have been modified,
66  // users can get confused if they can stop at a file and line breakpoint but
67  // can't see variables in this case.
68  //
69  // This error can give vital clues to the user about the cause is and allow
70  // the user to fix the issue.
71  lldb::SBError GetError();
72 
73 protected:
74  // only useful for visualizing the pointer or comparing two SBValueLists to
75  // see if they are backed by the same underlying Impl.
76  void *opaque_ptr();
77 
78 private:
79  friend class SBFrame;
80 
81  SBValueList(const ValueListImpl *lldb_object_ptr);
82 
83  void Append(lldb::ValueObjectSP &val_obj_sp);
84 
85  void CreateIfNeeded();
86 
87  ValueListImpl *operator->();
88 
90 
91  const ValueListImpl *operator->() const;
92 
93  const ValueListImpl &operator*() const;
94 
95  ValueListImpl &ref();
96 
97  std::unique_ptr<ValueListImpl> m_opaque_up;
98 
99  void SetError(const lldb_private::Status &status);
100 };
101 
102 } // namespace lldb
103 
104 #endif // LLDB_API_SBVALUELIST_H
lldb::SBValueList
Definition: SBValueList.h:18
lldb::SBValueList::m_opaque_up
std::unique_ptr< ValueListImpl > m_opaque_up
Definition: SBValueList.h:97
SBDefines.h
lldb::SBError
Definition: SBError.h:20
lldb::SBValue
Definition: SBValue.h:21
lldb::SBFrame
Definition: SBFrame.h:17
ValueListImpl
Definition: SBValueList.cpp:21
lldb_private::Status
Definition: Status.h:44
uint32_t
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::operator*
const Scalar operator*(Scalar lhs, Scalar rhs)
Definition: Scalar.cpp:556
lldb
Definition: SBAddress.h:15
lldb::SBValueList
class LLDB_API SBValueList
Definition: SBDefines.h:105
LLDB_API
#define LLDB_API
Definition: SBDefines.h:26