aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Target/Process.h2
-rw-r--r--lldb/source/API/SBType.cpp59
-rw-r--r--lldb/source/API/SBTypeFilter.cpp2
-rw-r--r--lldb/source/API/SBTypeNameSpecifier.cpp4
-rw-r--r--lldb/source/API/SBTypeSynthetic.cpp8
-rw-r--r--lldb/source/API/SBValue.cpp10
-rw-r--r--lldb/source/Breakpoint/Breakpoint.cpp3
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverName.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp13
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp5
-rw-r--r--lldb/source/Core/IOHandlerCursesGUI.cpp96
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp5
-rw-r--r--lldb/source/DataFormatters/TypeCategoryMap.cpp2
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp8
-rw-r--r--lldb/source/Host/common/FileSystem.cpp6
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp3
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h6
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp2
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp4
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp4
-rw-r--r--lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp6
-rw-r--r--lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp5
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AbortWithPayloadFrameRecognizer.cpp2
-rw-r--r--lldb/source/Symbol/Type.cpp3
-rw-r--r--lldb/source/Target/InstrumentationRuntime.cpp2
-rw-r--r--lldb/source/Target/StackFrameRecognizer.cpp2
-rw-r--r--lldb/source/Target/ThreadPlanStepRange.cpp4
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp6
28 files changed, 137 insertions, 143 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 637b077..7e66e31 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2619,7 +2619,7 @@ void PruneThreadPlans();
void ResetExtendedCrashInfoDict() {
// StructuredData::Dictionary is add only, so we have to make a new one:
- m_crash_info_dict_sp.reset(new StructuredData::Dictionary());
+ m_crash_info_dict_sp = std::make_shared<StructuredData::Dictionary>();
}
size_t AddImageToken(lldb::addr_t image_ptr);
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index 00f2871..f58902d 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -184,7 +184,7 @@ SBType SBType::GetPointerType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointerType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetPointerType()));
}
SBType SBType::GetPointeeType() {
@@ -192,7 +192,7 @@ SBType SBType::GetPointeeType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetPointeeType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetPointeeType()));
}
SBType SBType::GetReferenceType() {
@@ -200,7 +200,7 @@ SBType SBType::GetReferenceType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetReferenceType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetReferenceType()));
}
SBType SBType::GetTypedefedType() {
@@ -208,7 +208,7 @@ SBType SBType::GetTypedefedType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetTypedefedType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetTypedefedType()));
}
SBType SBType::GetDereferencedType() {
@@ -216,7 +216,7 @@ SBType SBType::GetDereferencedType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetDereferencedType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetDereferencedType()));
}
SBType SBType::GetArrayElementType() {
@@ -224,8 +224,8 @@ SBType SBType::GetArrayElementType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(
- m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr))));
+ return SBType(std::make_shared<TypeImpl>(
+ m_opaque_sp->GetCompilerType(true).GetArrayElementType(nullptr)));
}
SBType SBType::GetArrayType(uint64_t size) {
@@ -233,8 +233,8 @@ SBType SBType::GetArrayType(uint64_t size) {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(
- new TypeImpl(m_opaque_sp->GetCompilerType(true).GetArrayType(size))));
+ return SBType(std::make_shared<TypeImpl>(
+ m_opaque_sp->GetCompilerType(true).GetArrayType(size)));
}
SBType SBType::GetVectorElementType() {
@@ -245,7 +245,7 @@ SBType SBType::GetVectorElementType() {
CompilerType vector_element_type;
if (m_opaque_sp->GetCompilerType(true).IsVectorType(&vector_element_type,
nullptr))
- type_sb.SetSP(TypeImplSP(new TypeImpl(vector_element_type)));
+ type_sb.SetSP(std::make_shared<TypeImpl>(vector_element_type));
}
return type_sb;
}
@@ -421,14 +421,14 @@ lldb::SBType SBType::GetUnqualifiedType() {
if (!IsValid())
return SBType();
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetUnqualifiedType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetUnqualifiedType()));
}
lldb::SBType SBType::GetCanonicalType() {
LLDB_INSTRUMENT_VA(this);
if (IsValid())
- return SBType(TypeImplSP(new TypeImpl(m_opaque_sp->GetCanonicalType())));
+ return SBType(std::make_shared<TypeImpl>(m_opaque_sp->GetCanonicalType()));
return SBType();
}
@@ -508,7 +508,7 @@ SBTypeMember SBType::GetDirectBaseClassAtIndex(uint32_t idx) {
idx, &bit_offset);
if (base_class_type.IsValid())
sb_type_member.reset(new TypeMemberImpl(
- TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
+ std::make_shared<TypeImpl>(base_class_type), bit_offset));
}
return sb_type_member;
}
@@ -524,7 +524,7 @@ SBTypeMember SBType::GetVirtualBaseClassAtIndex(uint32_t idx) {
idx, &bit_offset);
if (base_class_type.IsValid())
sb_type_member.reset(new TypeMemberImpl(
- TypeImplSP(new TypeImpl(base_class_type)), bit_offset));
+ std::make_shared<TypeImpl>(base_class_type), bit_offset));
}
return sb_type_member;
}
@@ -546,16 +546,15 @@ SBTypeEnumMemberList SBType::GetEnumMembers() {
if (IsValid()) {
CompilerType this_type(m_opaque_sp->GetCompilerType(true));
if (this_type.IsValid()) {
- this_type.ForEachEnumerator([&sb_enum_member_list](
- const CompilerType &integer_type,
- ConstString name,
- const llvm::APSInt &value) -> bool {
- SBTypeEnumMember enum_member(
- lldb::TypeEnumMemberImplSP(new TypeEnumMemberImpl(
- lldb::TypeImplSP(new TypeImpl(integer_type)), name, value)));
- sb_enum_member_list.Append(enum_member);
- return true; // Keep iterating
- });
+ this_type.ForEachEnumerator(
+ [&sb_enum_member_list](const CompilerType &integer_type,
+ ConstString name,
+ const llvm::APSInt &value) -> bool {
+ SBTypeEnumMember enum_member(std::make_shared<TypeEnumMemberImpl>(
+ std::make_shared<TypeImpl>(integer_type), name, value));
+ sb_enum_member_list.Append(enum_member);
+ return true; // Keep iterating
+ });
}
}
return sb_enum_member_list;
@@ -578,9 +577,9 @@ SBTypeMember SBType::GetFieldAtIndex(uint32_t idx) {
ConstString name;
if (!name_sstr.empty())
name.SetCString(name_sstr.c_str());
- sb_type_member.reset(
- new TypeMemberImpl(TypeImplSP(new TypeImpl(field_type)), bit_offset,
- name, bitfield_bit_size, is_bitfield));
+ sb_type_member.reset(new TypeMemberImpl(
+ std::make_shared<TypeImpl>(field_type), bit_offset, name,
+ bitfield_bit_size, is_bitfield));
}
}
}
@@ -978,7 +977,7 @@ SBType SBTypeMemberFunction::GetType() {
SBType sb_type;
if (m_opaque_sp) {
- sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetType())));
+ sb_type.SetSP(std::make_shared<TypeImpl>(m_opaque_sp->GetType()));
}
return sb_type;
}
@@ -988,7 +987,7 @@ lldb::SBType SBTypeMemberFunction::GetReturnType() {
SBType sb_type;
if (m_opaque_sp) {
- sb_type.SetSP(lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetReturnType())));
+ sb_type.SetSP(std::make_shared<TypeImpl>(m_opaque_sp->GetReturnType()));
}
return sb_type;
}
@@ -1007,7 +1006,7 @@ lldb::SBType SBTypeMemberFunction::GetArgumentTypeAtIndex(uint32_t i) {
SBType sb_type;
if (m_opaque_sp) {
sb_type.SetSP(
- lldb::TypeImplSP(new TypeImpl(m_opaque_sp->GetArgumentAtIndex(i))));
+ std::make_shared<TypeImpl>(m_opaque_sp->GetArgumentAtIndex(i)));
}
return sb_type;
}
diff --git a/lldb/source/API/SBTypeFilter.cpp b/lldb/source/API/SBTypeFilter.cpp
index f1b5bc9..e10d269 100644
--- a/lldb/source/API/SBTypeFilter.cpp
+++ b/lldb/source/API/SBTypeFilter.cpp
@@ -19,7 +19,7 @@ using namespace lldb_private;
SBTypeFilter::SBTypeFilter() { LLDB_INSTRUMENT_VA(this); }
SBTypeFilter::SBTypeFilter(uint32_t options)
- : m_opaque_sp(TypeFilterImplSP(new TypeFilterImpl(options))) {
+ : m_opaque_sp(std::make_shared<TypeFilterImpl>(options)) {
LLDB_INSTRUMENT_VA(this, options);
}
diff --git a/lldb/source/API/SBTypeNameSpecifier.cpp b/lldb/source/API/SBTypeNameSpecifier.cpp
index 308b1cd..dd81720 100644
--- a/lldb/source/API/SBTypeNameSpecifier.cpp
+++ b/lldb/source/API/SBTypeNameSpecifier.cpp
@@ -38,8 +38,8 @@ SBTypeNameSpecifier::SBTypeNameSpecifier(SBType type) {
LLDB_INSTRUMENT_VA(this, type);
if (type.IsValid())
- m_opaque_sp = TypeNameSpecifierImplSP(
- new TypeNameSpecifierImpl(type.m_opaque_sp->GetCompilerType(true)));
+ m_opaque_sp = std::make_shared<TypeNameSpecifierImpl>(
+ type.m_opaque_sp->GetCompilerType(true));
}
SBTypeNameSpecifier::SBTypeNameSpecifier(const lldb::SBTypeNameSpecifier &rhs)
diff --git a/lldb/source/API/SBTypeSynthetic.cpp b/lldb/source/API/SBTypeSynthetic.cpp
index 19a4c53..5ebc884 100644
--- a/lldb/source/API/SBTypeSynthetic.cpp
+++ b/lldb/source/API/SBTypeSynthetic.cpp
@@ -24,8 +24,8 @@ SBTypeSynthetic SBTypeSynthetic::CreateWithClassName(const char *data,
if (!data || data[0] == 0)
return SBTypeSynthetic();
- return SBTypeSynthetic(ScriptedSyntheticChildrenSP(
- new ScriptedSyntheticChildren(options, data, "")));
+ return SBTypeSynthetic(
+ std::make_shared<ScriptedSyntheticChildren>(options, data, ""));
}
SBTypeSynthetic SBTypeSynthetic::CreateWithScriptCode(const char *data,
@@ -34,8 +34,8 @@ SBTypeSynthetic SBTypeSynthetic::CreateWithScriptCode(const char *data,
if (!data || data[0] == 0)
return SBTypeSynthetic();
- return SBTypeSynthetic(ScriptedSyntheticChildrenSP(
- new ScriptedSyntheticChildren(options, "", data)));
+ return SBTypeSynthetic(
+ std::make_shared<ScriptedSyntheticChildren>(options, "", data));
}
SBTypeSynthetic::SBTypeSynthetic(const lldb::SBTypeSynthetic &rhs)
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index d878eb4..e300ece 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -1120,11 +1120,11 @@ void SBValue::SetSP(const lldb::ValueObjectSP &sp) {
lldb::DynamicValueType use_dynamic = target_sp->GetPreferDynamicValue();
bool use_synthetic =
target_sp->TargetProperties::GetEnableSyntheticValue();
- m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
+ m_opaque_sp = std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic);
} else
- m_opaque_sp = ValueImplSP(new ValueImpl(sp, eNoDynamicValues, true));
+ m_opaque_sp = std::make_shared<ValueImpl>(sp, eNoDynamicValues, true);
} else
- m_opaque_sp = ValueImplSP(new ValueImpl(sp, eNoDynamicValues, false));
+ m_opaque_sp = std::make_shared<ValueImpl>(sp, eNoDynamicValues, false);
}
void SBValue::SetSP(const lldb::ValueObjectSP &sp,
@@ -1155,14 +1155,14 @@ void SBValue::SetSP(const lldb::ValueObjectSP &sp, bool use_synthetic) {
void SBValue::SetSP(const lldb::ValueObjectSP &sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic) {
- m_opaque_sp = ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic));
+ m_opaque_sp = std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic);
}
void SBValue::SetSP(const lldb::ValueObjectSP &sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic,
const char *name) {
m_opaque_sp =
- ValueImplSP(new ValueImpl(sp, use_dynamic, use_synthetic, name));
+ std::make_shared<ValueImpl>(sp, use_dynamic, use_synthetic, name);
}
bool SBValue::GetExpressionPath(SBStream &description) {
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index d757bc4..1544bf8 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -83,8 +83,7 @@ StructuredData::ObjectSP Breakpoint::SerializeToStructuredData() {
if (!m_name_list.empty()) {
StructuredData::ArraySP names_array_sp(new StructuredData::Array());
for (auto name : m_name_list) {
- names_array_sp->AddItem(
- StructuredData::StringSP(new StructuredData::String(name)));
+ names_array_sp->AddItem(std::make_shared<StructuredData::String>(name));
}
breakpoint_contents_sp->AddItem(Breakpoint::GetKey(OptionNames::Names),
names_array_sp);
diff --git a/lldb/source/Breakpoint/BreakpointResolverName.cpp b/lldb/source/Breakpoint/BreakpointResolverName.cpp
index edde1c9..21024a4 100644
--- a/lldb/source/Breakpoint/BreakpointResolverName.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverName.cpp
@@ -195,10 +195,10 @@ StructuredData::ObjectSP BreakpointResolverName::SerializeToStructuredData() {
StructuredData::ArraySP names_sp(new StructuredData::Array());
StructuredData::ArraySP name_masks_sp(new StructuredData::Array());
for (auto lookup : m_lookups) {
- names_sp->AddItem(StructuredData::StringSP(
- new StructuredData::String(lookup.GetName().GetStringRef())));
- name_masks_sp->AddItem(StructuredData::UnsignedIntegerSP(
- new StructuredData::UnsignedInteger(lookup.GetNameTypeMask())));
+ names_sp->AddItem(std::make_shared<StructuredData::String>(
+ lookup.GetName().GetStringRef()));
+ name_masks_sp->AddItem(std::make_shared<StructuredData::UnsignedInteger>(
+ lookup.GetNameTypeMask()));
}
options_dict_sp->AddItem(GetKey(OptionNames::SymbolNameArray), names_sp);
options_dict_sp->AddItem(GetKey(OptionNames::NameMaskArray), name_masks_sp);
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 10dc273..3049eb8 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -25,6 +25,7 @@
#include "lldb/Utility/Args.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/StringRef.h"
+#include <memory>
#include <optional>
using namespace lldb;
@@ -467,7 +468,7 @@ protected:
// Verify & handle any options/arguments passed to the alias command
OptionArgVectorSP option_arg_vector_sp =
- OptionArgVectorSP(new OptionArgVector);
+ std::make_shared<OptionArgVector>();
const bool include_aliases = true;
// Look up the command using command's name first. This is to resolve
@@ -543,7 +544,7 @@ protected:
CommandObject *cmd_obj = command_obj_sp.get();
CommandObject *sub_cmd_obj = nullptr;
OptionArgVectorSP option_arg_vector_sp =
- OptionArgVectorSP(new OptionArgVector);
+ std::make_shared<OptionArgVector>();
while (cmd_obj->IsMultiwordObject() && !args.empty()) {
auto sub_command = args[0].ref();
@@ -2504,9 +2505,9 @@ protected:
CommandObjectSP new_cmd_sp;
if (m_options.m_class_name.empty()) {
- new_cmd_sp.reset(new CommandObjectPythonFunction(
+ new_cmd_sp = std::make_shared<CommandObjectPythonFunction>(
m_interpreter, m_cmd_name, m_options.m_funct_name,
- m_options.m_short_help, m_synchronicity, m_completion_type));
+ m_options.m_short_help, m_synchronicity, m_completion_type);
} else {
ScriptInterpreter *interpreter = GetDebugger().GetScriptInterpreter();
if (!interpreter) {
@@ -2528,9 +2529,9 @@ protected:
if (!result.Succeeded())
return;
} else
- new_cmd_sp.reset(new CommandObjectScriptingObjectRaw(
+ new_cmd_sp = std::make_shared<CommandObjectScriptingObjectRaw>(
m_interpreter, m_cmd_name, cmd_obj_sp, m_synchronicity,
- m_completion_type));
+ m_completion_type);
}
// Assume we're going to succeed...
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 7e42ef2..5692699 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -901,10 +901,9 @@ void CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
StackFrameRecognizerSP(new ScriptedStackFrameRecognizer(
interpreter, m_options.m_class_name.c_str()));
if (m_options.m_regex) {
- auto module =
- RegularExpressionSP(new RegularExpression(m_options.m_module));
+ auto module = std::make_shared<RegularExpression>(m_options.m_module);
auto func =
- RegularExpressionSP(new RegularExpression(m_options.m_symbols.front()));
+ std::make_shared<RegularExpression>(m_options.m_symbols.front());
GetTarget().GetFrameRecognizerManager().AddRecognizer(
recognizer_sp, module, func, Mangled::NamePreference::ePreferDemangled,
m_options.m_first_instruction_only);
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index 7f0e0fc..3976630 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -22,6 +22,7 @@
#if defined(__APPLE__)
#include <deque>
#endif
+#include <memory>
#include <string>
#include "lldb/Core/Debugger.h"
@@ -6536,7 +6537,7 @@ public:
if (process && process->IsAlive() &&
StateIsStoppedState(process->GetState(), true)) {
if (submenus.size() == 7)
- menu.AddSubmenu(MenuSP(new Menu(Menu::Type::Separator)));
+ menu.AddSubmenu(std::make_shared<Menu>(Menu::Type::Separator));
else if (submenus.size() > 8)
submenus.erase(submenus.begin() + 8, submenus.end());
@@ -6558,9 +6559,9 @@ public:
if (queue_name && queue_name[0])
thread_menu_title.Printf(" %s", queue_name);
}
- menu.AddSubmenu(
- MenuSP(new Menu(thread_menu_title.GetString().str().c_str(),
- nullptr, menu_char, thread_sp->GetID())));
+ menu.AddSubmenu(std::make_shared<Menu>(
+ thread_menu_title.GetString().str().c_str(), nullptr, menu_char,
+ thread_sp->GetID()));
}
} else if (submenus.size() > 7) {
// Remove the separator and any other thread submenu items that were
@@ -7573,70 +7574,67 @@ void IOHandlerCursesGUI::Activate() {
MenuSP exit_menuitem_sp(
new Menu("Exit", nullptr, 'x', ApplicationDelegate::eMenuID_LLDBExit));
exit_menuitem_sp->SetCannedResult(MenuActionResult::Quit);
- lldb_menu_sp->AddSubmenu(MenuSP(new Menu(
- "About LLDB", nullptr, 'a', ApplicationDelegate::eMenuID_LLDBAbout)));
- lldb_menu_sp->AddSubmenu(MenuSP(new Menu(Menu::Type::Separator)));
+ lldb_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "About LLDB", nullptr, 'a', ApplicationDelegate::eMenuID_LLDBAbout));
+ lldb_menu_sp->AddSubmenu(std::make_shared<Menu>(Menu::Type::Separator));
lldb_menu_sp->AddSubmenu(exit_menuitem_sp);
MenuSP target_menu_sp(new Menu("Target", "F2", KEY_F(2),
ApplicationDelegate::eMenuID_Target));
- target_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Create", nullptr, 'c', ApplicationDelegate::eMenuID_TargetCreate)));
- target_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Delete", nullptr, 'd', ApplicationDelegate::eMenuID_TargetDelete)));
+ target_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Create", nullptr, 'c', ApplicationDelegate::eMenuID_TargetCreate));
+ target_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Delete", nullptr, 'd', ApplicationDelegate::eMenuID_TargetDelete));
MenuSP process_menu_sp(new Menu("Process", "F3", KEY_F(3),
ApplicationDelegate::eMenuID_Process));
- process_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Attach", nullptr, 'a', ApplicationDelegate::eMenuID_ProcessAttach)));
- process_menu_sp->AddSubmenu(
- MenuSP(new Menu("Detach and resume", nullptr, 'd',
- ApplicationDelegate::eMenuID_ProcessDetachResume)));
- process_menu_sp->AddSubmenu(
- MenuSP(new Menu("Detach suspended", nullptr, 's',
- ApplicationDelegate::eMenuID_ProcessDetachSuspended)));
- process_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Launch", nullptr, 'l', ApplicationDelegate::eMenuID_ProcessLaunch)));
- process_menu_sp->AddSubmenu(MenuSP(new Menu(Menu::Type::Separator)));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Attach", nullptr, 'a', ApplicationDelegate::eMenuID_ProcessAttach));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Detach and resume", nullptr, 'd',
+ ApplicationDelegate::eMenuID_ProcessDetachResume));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Detach suspended", nullptr, 's',
+ ApplicationDelegate::eMenuID_ProcessDetachSuspended));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Launch", nullptr, 'l', ApplicationDelegate::eMenuID_ProcessLaunch));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(Menu::Type::Separator));
process_menu_sp->AddSubmenu(
- MenuSP(new Menu("Continue", nullptr, 'c',
- ApplicationDelegate::eMenuID_ProcessContinue)));
- process_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Halt", nullptr, 'h', ApplicationDelegate::eMenuID_ProcessHalt)));
- process_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Kill", nullptr, 'k', ApplicationDelegate::eMenuID_ProcessKill)));
+ std::make_shared<Menu>("Continue", nullptr, 'c',
+ ApplicationDelegate::eMenuID_ProcessContinue));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Halt", nullptr, 'h', ApplicationDelegate::eMenuID_ProcessHalt));
+ process_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Kill", nullptr, 'k', ApplicationDelegate::eMenuID_ProcessKill));
MenuSP thread_menu_sp(new Menu("Thread", "F4", KEY_F(4),
ApplicationDelegate::eMenuID_Thread));
- thread_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Step In", nullptr, 'i', ApplicationDelegate::eMenuID_ThreadStepIn)));
+ thread_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Step In", nullptr, 'i', ApplicationDelegate::eMenuID_ThreadStepIn));
thread_menu_sp->AddSubmenu(
- MenuSP(new Menu("Step Over", nullptr, 'v',
- ApplicationDelegate::eMenuID_ThreadStepOver)));
- thread_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Step Out", nullptr, 'o', ApplicationDelegate::eMenuID_ThreadStepOut)));
+ std::make_shared<Menu>("Step Over", nullptr, 'v',
+ ApplicationDelegate::eMenuID_ThreadStepOver));
+ thread_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Step Out", nullptr, 'o', ApplicationDelegate::eMenuID_ThreadStepOut));
MenuSP view_menu_sp(
new Menu("View", "F5", KEY_F(5), ApplicationDelegate::eMenuID_View));
+ view_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Backtrace", nullptr, 't', ApplicationDelegate::eMenuID_ViewBacktrace));
+ view_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Registers", nullptr, 'r', ApplicationDelegate::eMenuID_ViewRegisters));
+ view_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Source", nullptr, 's', ApplicationDelegate::eMenuID_ViewSource));
+ view_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "Variables", nullptr, 'v', ApplicationDelegate::eMenuID_ViewVariables));
view_menu_sp->AddSubmenu(
- MenuSP(new Menu("Backtrace", nullptr, 't',
- ApplicationDelegate::eMenuID_ViewBacktrace)));
- view_menu_sp->AddSubmenu(
- MenuSP(new Menu("Registers", nullptr, 'r',
- ApplicationDelegate::eMenuID_ViewRegisters)));
- view_menu_sp->AddSubmenu(MenuSP(new Menu(
- "Source", nullptr, 's', ApplicationDelegate::eMenuID_ViewSource)));
- view_menu_sp->AddSubmenu(
- MenuSP(new Menu("Variables", nullptr, 'v',
- ApplicationDelegate::eMenuID_ViewVariables)));
- view_menu_sp->AddSubmenu(
- MenuSP(new Menu("Breakpoints", nullptr, 'b',
- ApplicationDelegate::eMenuID_ViewBreakpoints)));
+ std::make_shared<Menu>("Breakpoints", nullptr, 'b',
+ ApplicationDelegate::eMenuID_ViewBreakpoints));
MenuSP help_menu_sp(
new Menu("Help", "F6", KEY_F(6), ApplicationDelegate::eMenuID_Help));
- help_menu_sp->AddSubmenu(MenuSP(new Menu(
- "GUI Help", nullptr, 'g', ApplicationDelegate::eMenuID_HelpGUIHelp)));
+ help_menu_sp->AddSubmenu(std::make_shared<Menu>(
+ "GUI Help", nullptr, 'g', ApplicationDelegate::eMenuID_HelpGUIHelp));
m_app_up->Initialize();
WindowSP &main_window_sp = m_app_up->GetMainWindow();
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 122f230..7862fb8 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -422,9 +422,8 @@ FormatManager::GetCategory(ConstString category_name, bool can_create) {
if (!can_create)
return lldb::TypeCategoryImplSP();
- m_categories_map.Add(
- category_name,
- lldb::TypeCategoryImplSP(new TypeCategoryImpl(this, category_name)));
+ m_categories_map.Add(category_name,
+ std::make_shared<TypeCategoryImpl>(this, category_name));
return GetCategory(category_name);
}
diff --git a/lldb/source/DataFormatters/TypeCategoryMap.cpp b/lldb/source/DataFormatters/TypeCategoryMap.cpp
index 719264b..9412dd3 100644
--- a/lldb/source/DataFormatters/TypeCategoryMap.cpp
+++ b/lldb/source/DataFormatters/TypeCategoryMap.cpp
@@ -19,7 +19,7 @@ TypeCategoryMap::TypeCategoryMap(IFormatChangeListener *lst)
: m_map_mutex(), listener(lst), m_map(), m_active_categories() {
ConstString default_cs("default");
lldb::TypeCategoryImplSP default_sp =
- lldb::TypeCategoryImplSP(new TypeCategoryImpl(listener, default_cs));
+ std::make_shared<TypeCategoryImpl>(listener, default_cs);
Add(default_cs, default_sp);
Enable(default_cs, First);
}
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 05fcc4d..c2f8bb3 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -16,6 +16,7 @@
#include "lldb/ValueObject/ValueObject.h"
#include "llvm/Support/MathExtras.h"
#include <cstdint>
+#include <memory>
using namespace lldb;
using namespace lldb_private;
@@ -62,10 +63,9 @@ void ValueObjectPrinter::Init(
m_summary.assign("");
m_error.assign("");
m_val_summary_ok = false;
- m_printed_instance_pointers =
- printed_instance_pointers
- ? printed_instance_pointers
- : InstancePointersSetSP(new InstancePointersSet());
+ m_printed_instance_pointers = printed_instance_pointers
+ ? printed_instance_pointers
+ : std::make_shared<InstancePointersSet>();
SetupMostSpecializedValue();
}
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp
index 5153a0a9..00919fe 100644
--- a/lldb/source/Host/common/FileSystem.cpp
+++ b/lldb/source/Host/common/FileSystem.cpp
@@ -35,6 +35,7 @@
#include <algorithm>
#include <fstream>
+#include <memory>
#include <optional>
#include <vector>
@@ -288,8 +289,7 @@ FileSystem::CreateWritableDataBuffer(const llvm::Twine &path, uint64_t size,
is_volatile);
if (!buffer)
return {};
- return std::shared_ptr<WritableDataBufferLLVM>(
- new WritableDataBufferLLVM(std::move(buffer)));
+ return std::make_shared<WritableDataBufferLLVM>(std::move(buffer));
}
std::shared_ptr<DataBuffer>
@@ -300,7 +300,7 @@ FileSystem::CreateDataBuffer(const llvm::Twine &path, uint64_t size,
GetMemoryBuffer<llvm::MemoryBuffer>(path, size, offset, is_volatile);
if (!buffer)
return {};
- return std::shared_ptr<DataBufferLLVM>(new DataBufferLLVM(std::move(buffer)));
+ return std::make_shared<DataBufferLLVM>(std::move(buffer));
}
std::shared_ptr<WritableDataBuffer>
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index da545f1..a0080cf 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -135,8 +135,7 @@ CommandInterpreter::CommandInterpreter(Debugger &debugger,
bool synchronous_execution)
: Broadcaster(debugger.GetBroadcasterManager(),
CommandInterpreter::GetStaticBroadcasterClass().str()),
- Properties(
- OptionValuePropertiesSP(new OptionValueProperties("interpreter"))),
+ Properties(std::make_shared<OptionValueProperties>("interpreter")),
IOHandlerDelegate(IOHandlerDelegate::Completion::LLDBCommand),
m_debugger(debugger), m_synchronous_execution(true),
m_skip_lldbinit_files(false), m_skip_app_init_files(false),
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h
index 6231f0f..47b137a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h
@@ -225,7 +225,7 @@ public:
ContextMetadataMap::iterator context_md_iter = m_metadata_map.find(dst_ctx);
if (context_md_iter == m_metadata_map.end()) {
- context_md = ASTContextMetadataSP(new ASTContextMetadata(dst_ctx));
+ context_md = std::make_shared<ASTContextMetadata>(dst_ctx);
m_metadata_map[dst_ctx] = context_md;
} else {
context_md = context_md_iter->second;
@@ -438,7 +438,7 @@ public:
if (context_md_iter == m_metadata_map.end()) {
ASTContextMetadataSP context_md =
- ASTContextMetadataSP(new ASTContextMetadata(dst_ctx));
+ std::make_shared<ASTContextMetadata>(dst_ctx);
m_metadata_map[dst_ctx] = context_md;
return context_md;
}
@@ -462,7 +462,7 @@ public:
if (delegate_iter == delegates.end()) {
ImporterDelegateSP delegate =
- ImporterDelegateSP(new ASTImporterDelegate(*this, dst_ctx, src_ctx));
+ std::make_shared<ASTImporterDelegate>(*this, dst_ctx, src_ctx);
delegates[src_ctx] = delegate;
return delegate;
}
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 4fcdebe..cca721e 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -3462,7 +3462,7 @@ public:
*exception, eValueTypeVariableArgument);
exception = exception->GetDynamicValue(eDynamicDontRunTarget);
- m_arguments = ValueObjectListSP(new ValueObjectList());
+ m_arguments = std::make_shared<ValueObjectList>();
m_arguments->Append(exception);
m_stop_desc = "hit Objective-C exception";
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index 54869001..07c5a52 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -805,7 +805,7 @@ Status PlatformDarwinKernel::GetSharedModuleKernel(
if (FileSystem::Instance().Exists(possible_kernel)) {
ModuleSpec kern_spec(possible_kernel);
kern_spec.GetUUID() = module_spec.GetUUID();
- module_sp.reset(new Module(kern_spec));
+ module_sp = std::make_shared<Module>(kern_spec);
if (module_sp && module_sp->GetObjectFile() &&
module_sp->MatchesModuleSpec(kern_spec)) {
// The dSYM is next to the binary (that's the only
@@ -835,7 +835,7 @@ Status PlatformDarwinKernel::GetSharedModuleKernel(
kern_spec.GetUUID() = module_spec.GetUUID();
kern_spec.GetSymbolFileSpec() = possible_kernel_dsym;
- module_sp.reset(new Module(kern_spec));
+ module_sp = std::make_shared<Module>(kern_spec);
if (module_sp && module_sp->GetObjectFile() &&
module_sp->MatchesModuleSpec(kern_spec)) {
if (did_create_ptr)
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 0c864dc..457182a 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1496,7 +1496,7 @@ lldb::ValueObjectListSP ScriptInterpreterPythonImpl::GetRecognizedArguments(
}
if (py_return.get()) {
PythonList result_list(PyRefType::Borrowed, py_return.get());
- ValueObjectListSP result = ValueObjectListSP(new ValueObjectList());
+ ValueObjectListSP result = std::make_shared<ValueObjectList>();
for (size_t i = 0; i < result_list.GetSize(); i++) {
PyObject *item = result_list.GetItemAtIndex(i).get();
lldb::SBValue *sb_value_ptr =
@@ -3047,7 +3047,7 @@ bool ScriptInterpreterPythonImpl::SetOptionValueForCommandObject(
lldb::ExecutionContextRefSP exe_ctx_ref_sp;
if (exe_ctx)
- exe_ctx_ref_sp.reset(new ExecutionContextRef(exe_ctx));
+ exe_ctx_ref_sp = std::make_shared<ExecutionContextRef>(exe_ctx);
PythonObject ctx_ref_obj = SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp);
bool py_return = unwrapOrSetPythonException(As<bool>(
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
index 82f18c5..867f6a6 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -574,8 +574,7 @@ public:
return config_sp;
// Handle source stream flags.
- auto source_flags_sp =
- StructuredData::DictionarySP(new StructuredData::Dictionary());
+ auto source_flags_sp = std::make_shared<StructuredData::Dictionary>();
config_sp->AddItem("source-flags", source_flags_sp);
source_flags_sp->AddBooleanItem("any-process", m_include_any_process);
@@ -591,8 +590,7 @@ public:
// Handle filter rules
if (!m_filter_rules.empty()) {
- auto json_filter_rules_sp =
- StructuredData::ArraySP(new StructuredData::Array);
+ auto json_filter_rules_sp = std::make_shared<StructuredData::Array>();
config_sp->AddItem("filter-rules", json_filter_rules_sp);
for (auto &rule_sp : m_filter_rules) {
if (!rule_sp)
diff --git a/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp b/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp
index e5ba029..1e51dda 100644
--- a/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp
+++ b/lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp
@@ -46,6 +46,7 @@
#include <cstring>
#include <dirent.h>
#include <dlfcn.h>
+#include <memory>
#include <optional>
#include <pwd.h>
@@ -188,7 +189,7 @@ std::optional<ModuleSpec> SymbolLocatorDebugSymbols::LocateExecutableObjectFile(
exe_spec.GetFileSpec() = module_spec.GetFileSpec();
exe_spec.GetUUID() = module_spec.GetUUID();
ModuleSP module_sp;
- module_sp.reset(new Module(exe_spec));
+ module_sp = std::make_shared<Module>(exe_spec);
if (module_sp && module_sp->GetObjectFile() &&
module_sp->MatchesModuleSpec(exe_spec)) {
success = true;
@@ -630,7 +631,7 @@ static int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
exe_spec.GetFileSpec() = module_spec.GetFileSpec();
exe_spec.GetUUID() = module_spec.GetUUID();
ModuleSP module_sp;
- module_sp.reset(new Module(exe_spec));
+ module_sp = std::make_shared<Module>(exe_spec);
if (module_sp && module_sp->GetObjectFile() &&
module_sp->MatchesModuleSpec(exe_spec)) {
success = true;
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AbortWithPayloadFrameRecognizer.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AbortWithPayloadFrameRecognizer.cpp
index 7cf8750..aaa4ccd 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AbortWithPayloadFrameRecognizer.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AbortWithPayloadFrameRecognizer.cpp
@@ -128,7 +128,7 @@ AbortWithPayloadFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame_sp) {
Value *cur_value;
StackFrame *frame = frame_sp.get();
- ValueObjectListSP arguments_sp = ValueObjectListSP(new ValueObjectList());
+ ValueObjectListSP arguments_sp = std::make_shared<ValueObjectList>();
auto add_to_arguments = [&](llvm::StringRef name, Value *value,
bool dynamic) {
diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp
index 0a886e5..b7adae4 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <cstdio>
#include <iterator>
+#include <memory>
#include <optional>
#include "lldb/Core/Module.h"
@@ -246,7 +247,7 @@ public:
TypeAppendVisitor(TypeListImpl &type_list) : m_type_list(type_list) {}
bool operator()(const lldb::TypeSP &type) {
- m_type_list.Append(TypeImplSP(new TypeImpl(type)));
+ m_type_list.Append(std::make_shared<TypeImpl>(type));
return true;
}
diff --git a/lldb/source/Target/InstrumentationRuntime.cpp b/lldb/source/Target/InstrumentationRuntime.cpp
index 9da06e8..d5a2e2e 100644
--- a/lldb/source/Target/InstrumentationRuntime.cpp
+++ b/lldb/source/Target/InstrumentationRuntime.cpp
@@ -73,5 +73,5 @@ void InstrumentationRuntime::ModulesDidLoad(
lldb::ThreadCollectionSP
InstrumentationRuntime::GetBacktracesFromExtendedStopInfo(
StructuredData::ObjectSP info) {
- return ThreadCollectionSP(new ThreadCollection());
+ return std::make_shared<ThreadCollection>();
}
diff --git a/lldb/source/Target/StackFrameRecognizer.cpp b/lldb/source/Target/StackFrameRecognizer.cpp
index d23c1fa..9d5116c 100644
--- a/lldb/source/Target/StackFrameRecognizer.cpp
+++ b/lldb/source/Target/StackFrameRecognizer.cpp
@@ -41,7 +41,7 @@ ScriptedStackFrameRecognizer::RecognizeFrame(lldb::StackFrameSP frame) {
ValueObjectListSP args =
m_interpreter->GetRecognizedArguments(m_python_object_sp, frame);
- auto args_synthesized = ValueObjectListSP(new ValueObjectList());
+ auto args_synthesized = std::make_shared<ValueObjectList>();
if (args) {
for (const auto &o : args->GetObjects())
args_synthesized->Append(ValueObjectRecognizerSynthesizedValue::Create(
diff --git a/lldb/source/Target/ThreadPlanStepRange.cpp b/lldb/source/Target/ThreadPlanStepRange.cpp
index 78e1270..dca96cc 100644
--- a/lldb/source/Target/ThreadPlanStepRange.cpp
+++ b/lldb/source/Target/ThreadPlanStepRange.cpp
@@ -428,8 +428,8 @@ bool ThreadPlanStepRange::SetNextBranchBreakpoint() {
top_most_line_entry.line = call_site.GetLine();
top_most_line_entry.column = call_site.GetColumn();
FileSpec call_site_file_spec = call_site.GetFile();
- top_most_line_entry.original_file_sp.reset(
- new SupportFile(call_site_file_spec));
+ top_most_line_entry.original_file_sp =
+ std::make_shared<SupportFile>(call_site_file_spec);
top_most_line_entry.range = range;
top_most_line_entry.file_sp.reset();
top_most_line_entry.ApplyFileMappings(
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 8be384c..102b2ab 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -21,6 +21,7 @@
#include <mach/exception_types.h>
#include <mach/mach_vm.h>
#include <mach/task_info.h>
+#include <memory>
#include <pwd.h>
#include <string>
#include <sys/stat.h>
@@ -5410,9 +5411,8 @@ RNBRemote::GetJSONThreadsInfo(bool threads_with_valid_stop_info_only) {
JSONGenerator::ArraySP medata_array_sp(new JSONGenerator::Array());
for (nub_size_t i = 0;
i < tid_stop_info.details.exception.data_count; ++i) {
- medata_array_sp->AddItem(
- JSONGenerator::IntegerSP(new JSONGenerator::Integer(
- tid_stop_info.details.exception.data[i])));
+ medata_array_sp->AddItem(std::make_shared<JSONGenerator::Integer>(
+ tid_stop_info.details.exception.data[i]));
}
thread_dict_sp->AddItem("medata", medata_array_sp);
}