LLDB  mainline
SBSymbolContextList.cpp
Go to the documentation of this file.
1 //===-- SBSymbolContextList.cpp ---------------------------------*- 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 
10 #include "SBReproducerPrivate.h"
11 #include "Utils.h"
12 #include "lldb/API/SBStream.h"
14 
15 using namespace lldb;
16 using namespace lldb_private;
17 
19  : m_opaque_up(new SymbolContextList()) {
21 }
22 
24  : m_opaque_up() {
26  (const lldb::SBSymbolContextList &), rhs);
27 
28  m_opaque_up = clone(rhs.m_opaque_up);
29 }
30 
32 
37  SBSymbolContextList, operator=,(const lldb::SBSymbolContextList &), rhs);
38 
39  if (this != &rhs)
40  m_opaque_up = clone(rhs.m_opaque_up);
41  return LLDB_RECORD_RESULT(*this);
42 }
43 
46 
47  if (m_opaque_up)
48  return m_opaque_up->GetSize();
49  return 0;
50 }
51 
54  GetContextAtIndex, (uint32_t), idx);
55 
56  SBSymbolContext sb_sc;
57  if (m_opaque_up) {
58  SymbolContext sc;
59  if (m_opaque_up->GetContextAtIndex(idx, sc)) {
60  sb_sc.SetSymbolContext(&sc);
61  }
62  }
63  return LLDB_RECORD_RESULT(sb_sc);
64 }
65 
68 
69  if (m_opaque_up)
70  m_opaque_up->Clear();
71 }
72 
75  (lldb::SBSymbolContext &), sc);
76 
77  if (sc.IsValid() && m_opaque_up.get())
78  m_opaque_up->Append(*sc);
79 }
80 
83  (lldb::SBSymbolContextList &), sc_list);
84 
85  if (sc_list.IsValid() && m_opaque_up.get())
86  m_opaque_up->Append(*sc_list);
87 }
88 
91  return this->operator bool();
92 }
93 SBSymbolContextList::operator bool() const {
95 
96  return m_opaque_up != NULL;
97 }
98 
100  return m_opaque_up.get();
101 }
102 
104  assert(m_opaque_up.get());
105  return *m_opaque_up;
106 }
107 
110  (lldb::SBStream &), description);
111 
112  Stream &strm = description.ref();
113  if (m_opaque_up)
114  m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
115  return true;
116 }
117 
118 namespace lldb_private {
119 namespace repro {
120 
121 template <>
125  (const lldb::SBSymbolContextList &));
128  SBSymbolContextList, operator=,(const lldb::SBSymbolContextList &));
138  LLDB_REGISTER_METHOD_CONST(bool, SBSymbolContextList, operator bool, ());
140  (lldb::SBStream &));
141 }
142 
143 }
144 }
The registry contains a unique mapping between functions and their ID.
lldb_private::SymbolContextList * operator->() const
Defines a list of symbol context objects.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
const lldb::SBSymbolContextList & operator=(const lldb::SBSymbolContextList &rhs)
lldb::SBSymbolContext GetContextAtIndex(uint32_t idx)
lldb_private::SymbolContextList & operator*() const
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
void SetSymbolContext(const lldb_private::SymbolContext *sc_ptr)
std::unique_ptr< T > clone(const std::unique_ptr< T > &src)
Definition: Utils.h:17
void Append(lldb::SBSymbolContext &sc)
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
lldb_private::Stream & ref()
Definition: SBStream.cpp:162
void RegisterMethods< SBSymbolContextList >(Registry &R)
bool GetDescription(lldb::SBStream &description)
Definition: SBAddress.h:15
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
#define LLDB_RECORD_RESULT(Result)
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)