Skip to content

Commit 3ce3929

Browse files
committed
[lldb] Reinstate default constructor for SBCommandInterpreter
The default constructor for SBCommandInterpreter was (unintentionally) made protected in 27b6a4e. The goal of the patch was to make the constructor taking an lldb_private type protected, but due to the presence of a default argument, this ctor also served as the default constructor. The latter should remain public. This commit reinstates the original behavior by removing the default argument and having an explicit, public default constructor. (cherry picked from commit 86f21e9)
1 parent e8e5be8 commit 3ce3929

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lldb/include/lldb/API/SBCommandInterpreter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class SBCommandInterpreter {
3030
eBroadcastBitAsynchronousErrorData = (1 << 4)
3131
};
3232

33+
SBCommandInterpreter();
3334
SBCommandInterpreter(const lldb::SBCommandInterpreter &rhs);
3435

3536
~SBCommandInterpreter();
@@ -317,9 +318,8 @@ class SBCommandInterpreter {
317318
protected:
318319
friend class lldb_private::CommandPluginInterfaceImplementation;
319320

320-
SBCommandInterpreter(
321-
lldb_private::CommandInterpreter *interpreter_ptr =
322-
nullptr); // Access using SBDebugger::GetCommandInterpreter();
321+
/// Access using SBDebugger::GetCommandInterpreter();
322+
SBCommandInterpreter(lldb_private::CommandInterpreter *interpreter_ptr);
323323
lldb_private::CommandInterpreter &ref();
324324

325325
lldb_private::CommandInterpreter *get();

lldb/source/API/SBCommandInterpreter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ class CommandPluginInterfaceImplementation : public CommandObjectParsed {
8282
};
8383
} // namespace lldb_private
8484

85+
SBCommandInterpreter::SBCommandInterpreter() : m_opaque_ptr() {
86+
LLDB_INSTRUMENT_VA(this);
87+
}
88+
8589
SBCommandInterpreter::SBCommandInterpreter(CommandInterpreter *interpreter)
8690
: m_opaque_ptr(interpreter) {
8791
LLDB_INSTRUMENT_VA(this, interpreter);

0 commit comments

Comments
 (0)