[Lldb-commits] [lldb] 58e9cc1 - Revert "[lldb] Remove redundant .c_str() and .get() calls"
Muhammad Omair Javaid via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 19 00:52:19 PST 2022
Author: Muhammad Omair Javaid
Date: 2022-12-19T13:52:10+05:00
New Revision: 58e9cc13e24f668a33abdae201d59a02e10c22c0
URL: https://github.com/llvm/llvm-project/commit/58e9cc13e24f668a33abdae201d59a02e10c22c0
DIFF: https://github.com/llvm/llvm-project/commit/58e9cc13e24f668a33abdae201d59a02e10c22c0.diff
LOG: Revert "[lldb] Remove redundant .c_str() and .get() calls"
This reverts commit fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd.
This has broken all LLDB buildbots:
https://lab.llvm.org/buildbot/#/builders/68/builds/44990
https://lab.llvm.org/buildbot/#/builders/96/builds/33160
Added:
Modified:
lldb/include/lldb/Target/Process.h
lldb/source/API/SBCommandReturnObject.cpp
lldb/source/API/SBExpressionOptions.cpp
lldb/source/API/SBSourceManager.cpp
lldb/source/Breakpoint/BreakpointResolverScripted.cpp
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/source/Commands/CommandObjectExpression.cpp
lldb/source/Commands/CommandObjectHelp.cpp
lldb/source/Commands/CommandObjectMultiword.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Core/Disassembler.cpp
lldb/source/Core/FormatEntity.cpp
lldb/source/Core/IOHandlerCursesGUI.cpp
lldb/source/Expression/REPL.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Interpreter/OptionArgParser.cpp
lldb/source/Interpreter/OptionValueArch.cpp
lldb/source/Interpreter/ScriptInterpreter.cpp
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp
lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
lldb/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
lldb/source/Plugins/Platform/Android/AdbClient.cpp
lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
lldb/source/Target/LanguageRuntime.cpp
lldb/source/Target/TargetList.cpp
lldb/source/Target/Thread.cpp
lldb/source/Target/ThreadPlanStack.cpp
lldb/tools/debugserver/source/DNBTimer.h
lldb/tools/lldb-vscode/BreakpointBase.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 8bb8b85e22fbc..47040137078f6 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2704,7 +2704,7 @@ void PruneThreadPlans();
};
void SetNextEventAction(Process::NextEventAction *next_event_action) {
- if (m_next_event_action_up)
+ if (m_next_event_action_up.get())
m_next_event_action_up->HandleBeingUnshipped();
m_next_event_action_up.reset(next_event_action);
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index bf9c66453c90b..7d2c102b3d8c1 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -292,7 +292,7 @@ void SBCommandReturnObject::PutCString(const char *string, int len) {
return;
} else if (len > 0) {
std::string buffer(string, len);
- ref().AppendMessage(buffer);
+ ref().AppendMessage(buffer.c_str());
} else
ref().AppendMessage(string);
}
diff --git a/lldb/source/API/SBExpressionOptions.cpp b/lldb/source/API/SBExpressionOptions.cpp
index 6ae57f24606af..d07acbc0aa2db 100644
--- a/lldb/source/API/SBExpressionOptions.cpp
+++ b/lldb/source/API/SBExpressionOptions.cpp
@@ -254,5 +254,5 @@ EvaluateExpressionOptions *SBExpressionOptions::get() const {
}
EvaluateExpressionOptions &SBExpressionOptions::ref() const {
- return *m_opaque_up;
+ return *(m_opaque_up.get());
}
diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp
index 68815026c464d..7729f5d9d69f8 100644
--- a/lldb/source/API/SBSourceManager.cpp
+++ b/lldb/source/API/SBSourceManager.cpp
@@ -88,14 +88,14 @@ SBSourceManager::SBSourceManager(const SBSourceManager &rhs) {
if (&rhs == this)
return;
- m_opaque_up = std::make_unique<SourceManagerImpl>(*rhs.m_opaque_up);
+ m_opaque_up = std::make_unique<SourceManagerImpl>(*(rhs.m_opaque_up.get()));
}
const lldb::SBSourceManager &SBSourceManager::
operator=(const lldb::SBSourceManager &rhs) {
LLDB_INSTRUMENT_VA(this, rhs);
- m_opaque_up = std::make_unique<SourceManagerImpl>(*rhs.m_opaque_up);
+ m_opaque_up = std::make_unique<SourceManagerImpl>(*(rhs.m_opaque_up.get()));
return *this;
}
diff --git a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
index 44a5fb16a5a50..308c3b987f581 100644
--- a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
@@ -139,7 +139,7 @@ void BreakpointResolverScripted::GetDescription(Stream *s) {
short_help);
}
if (!short_help.empty())
- s->PutCString(short_help);
+ s->PutCString(short_help.c_str());
else
s->Printf("python class = %s", m_class_name.c_str());
}
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 72da81f76884c..62e46c59e169f 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -130,10 +130,10 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup {
m_bp_opts.SetThreadID(thread_id);
} break;
case 'T':
- m_bp_opts.GetThreadSpec()->SetName(option_arg.str());
+ m_bp_opts.GetThreadSpec()->SetName(option_arg.str().c_str());
break;
case 'q':
- m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str());
+ m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str().c_str());
break;
case 'x': {
uint32_t thread_index = UINT32_MAX;
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index ca455501f3aee..b01e39f4ce3c8 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -477,7 +477,7 @@ void CommandObjectExpression::IOHandlerInputComplete(IOHandler &io_handler,
CommandReturnObject return_obj(
GetCommandInterpreter().GetDebugger().GetUseColor());
- EvaluateExpression(line, *output_sp, *error_sp, return_obj);
+ EvaluateExpression(line.c_str(), *output_sp, *error_sp, return_obj);
if (output_sp)
output_sp->Flush();
if (error_sp)
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index da5dae7d7221f..c7a3bce1408b2 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -145,15 +145,15 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
return false;
} else if (!sub_cmd_obj) {
StreamString error_msg_stream;
- GenerateAdditionalHelpAvenuesMessage(&error_msg_stream, cmd_string,
- m_interpreter.GetCommandPrefix(),
- sub_command);
+ GenerateAdditionalHelpAvenuesMessage(
+ &error_msg_stream, cmd_string.c_str(),
+ m_interpreter.GetCommandPrefix(), sub_command.c_str());
result.AppendError(error_msg_stream.GetString());
return false;
} else {
GenerateAdditionalHelpAvenuesMessage(
- &result.GetOutputStream(), cmd_string,
- m_interpreter.GetCommandPrefix(), sub_command);
+ &result.GetOutputStream(), cmd_string.c_str(),
+ m_interpreter.GetCommandPrefix(), sub_command.c_str());
result.GetOutputStream().Printf(
"\nThe closest match is '%s'. Help on it follows.\n\n",
sub_cmd_obj->GetCommandName().str().c_str());
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index 48fa86194469d..8a815e46ffd2f 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -217,7 +217,7 @@ bool CommandObjectMultiword::Execute(const char *args_string,
}
}
error_msg.append("\n");
- result.AppendRawError(error_msg);
+ result.AppendRawError(error_msg.c_str());
return false;
}
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 9f5c2b3859e4a..86fd994ebb12c 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -390,7 +390,7 @@ class CommandObjectTargetCreate : public CommandObjectParsed {
module_sp->SetSymbolFileFileSpec(symfile);
if (remote_file) {
std::string remote_path = remote_file.GetPath();
- target_sp->SetArg0(remote_path);
+ target_sp->SetArg0(remote_path.c_str());
module_sp->SetPlatformFileSpec(remote_file);
}
}
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 57b56717cde3f..47ae5968748c9 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -1710,7 +1710,7 @@ class CommandObjectThreadJump : public CommandObjectParsed {
}
if (!warnings.empty())
- result.AppendWarning(warnings);
+ result.AppendWarning(warnings.c_str());
}
result.SetStatus(eReturnStatusSuccessFinishResult);
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 9bf1f8b736433..cc354636987cb 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -1129,7 +1129,7 @@ Disassembler::Disassembler(const ArchSpec &arch, const char *flavor)
thumb_arch_name.erase(0, 3);
thumb_arch_name.insert(0, "thumb");
}
- m_arch.SetTriple(thumb_arch_name);
+ m_arch.SetTriple(thumb_arch_name.c_str());
}
}
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index 22441ea97826e..c5cad95ecafe1 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -629,9 +629,9 @@ static ValueObjectSP ExpandIndexedExpression(ValueObject *valobj, size_t index,
ValueObject::ExpressionPathAftermath what_next =
(deref_pointer ? ValueObject::eExpressionPathAftermathDereference
: ValueObject::eExpressionPathAftermathNothing);
- ValueObjectSP item =
- valobj->GetValueForExpressionPath(ptr_deref_buffer, &reason_to_stop,
- &final_value_type, options, &what_next);
+ ValueObjectSP item = valobj->GetValueForExpressionPath(
+ ptr_deref_buffer.c_str(), &reason_to_stop, &final_value_type, options,
+ &what_next);
if (!item) {
LLDB_LOGF(log,
"[ExpandIndexedExpression] ERROR: why stopping = %d,"
@@ -765,7 +765,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
target =
valobj
- ->GetValueForExpressionPath(expr_path, &reason_to_stop,
+ ->GetValueForExpressionPath(expr_path.c_str(), &reason_to_stop,
&final_value_type, options, &what_next)
.get();
diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
index d07357dac2af5..5138f079e3bbc 100644
--- a/lldb/source/Core/IOHandlerCursesGUI.cpp
+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -3838,7 +3838,7 @@ class CommonCompletionSearcherDelegate : public SearcherDelegate {
void UpdateMatches(const std::string &text) override {
CompletionResult result;
- CompletionRequest request(text, text.size(), result);
+ CompletionRequest request(text.c_str(), text.size(), result);
CommandCompletions::InvokeCommonCompletionCallbacks(
m_debugger.GetCommandInterpreter(), m_completion_mask, request,
nullptr);
diff --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp
index 769755e43750d..ae80f9ad97dc6 100644
--- a/lldb/source/Expression/REPL.cpp
+++ b/lldb/source/Expression/REPL.cpp
@@ -336,9 +336,10 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) {
const char *expr_prefix = nullptr;
lldb::ValueObjectSP result_valobj_sp;
Status error;
- lldb::ExpressionResults execution_results = UserExpression::Evaluate(
- exe_ctx, expr_options, code, expr_prefix, result_valobj_sp, error,
- nullptr); // fixed expression
+ lldb::ExpressionResults execution_results =
+ UserExpression::Evaluate(exe_ctx, expr_options, code.c_str(),
+ expr_prefix, result_valobj_sp, error,
+ nullptr); // fixed expression
// CommandInterpreter &ci = debugger.GetCommandInterpreter();
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 49c93a79ed5b2..4aee2e48a13c4 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1501,7 +1501,8 @@ CommandObject *CommandInterpreter::GetCommandObjectForCommand(
else if (cmd_obj->IsMultiwordObject()) {
// Our current object is a multi-word object; see if the cmd_word is a
// valid sub-command for our object.
- CommandObject *sub_cmd_obj = cmd_obj->GetSubcommandObject(cmd_word);
+ CommandObject *sub_cmd_obj =
+ cmd_obj->GetSubcommandObject(cmd_word.c_str());
if (sub_cmd_obj)
cmd_obj = sub_cmd_obj;
else // cmd_word was not a valid sub-command word, so we are done
@@ -1765,8 +1766,9 @@ Status CommandInterpreter::PreprocessCommand(std::string &command) {
options.SetTryAllThreads(true);
options.SetTimeout(std::nullopt);
- ExpressionResults expr_result = target.EvaluateExpression(
- expr_str, exe_ctx.GetFramePtr(), expr_result_valobj_sp, options);
+ ExpressionResults expr_result =
+ target.EvaluateExpression(expr_str.c_str(), exe_ctx.GetFramePtr(),
+ expr_result_valobj_sp, options);
if (expr_result == eExpressionCompleted) {
Scalar scalar;
@@ -3408,7 +3410,8 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
}
} else {
if (cmd_obj->IsMultiwordObject()) {
- CommandObject *sub_cmd_obj = cmd_obj->GetSubcommandObject(next_word);
+ CommandObject *sub_cmd_obj =
+ cmd_obj->GetSubcommandObject(next_word.c_str());
if (sub_cmd_obj) {
// The subcommand's name includes the parent command's name, so
// restart rather than append to the revised_command_line.
diff --git a/lldb/source/Interpreter/OptionArgParser.cpp b/lldb/source/Interpreter/OptionArgParser.cpp
index ccca8f7a54b44..93b01abde4bb9 100644
--- a/lldb/source/Interpreter/OptionArgParser.cpp
+++ b/lldb/source/Interpreter/OptionArgParser.cpp
@@ -222,7 +222,7 @@ lldb::addr_t OptionArgParser::ToAddress(const ExecutionContext *exe_ctx,
std::string str_offset = matches[3].str();
if (!llvm::StringRef(str_offset).getAsInteger(0, offset)) {
Status error;
- addr = ToAddress(exe_ctx, name, LLDB_INVALID_ADDRESS, &error);
+ addr = ToAddress(exe_ctx, name.c_str(), LLDB_INVALID_ADDRESS, &error);
if (addr != LLDB_INVALID_ADDRESS) {
if (sign[0] == '+')
return addr + offset;
diff --git a/lldb/source/Interpreter/OptionValueArch.cpp b/lldb/source/Interpreter/OptionValueArch.cpp
index 07e61d60047a8..4d1e2c7869f3e 100644
--- a/lldb/source/Interpreter/OptionValueArch.cpp
+++ b/lldb/source/Interpreter/OptionValueArch.cpp
@@ -45,7 +45,7 @@ Status OptionValueArch::SetValueFromString(llvm::StringRef value,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
std::string value_str = value.trim().str();
- if (m_current_value.SetTriple(value_str)) {
+ if (m_current_value.SetTriple(value_str.c_str())) {
m_value_was_set = true;
NotifyValueChanged();
} else
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index 9572176fdf7be..0820755545622 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -82,7 +82,7 @@ ScriptInterpreter::GetDataExtractorFromSBData(const lldb::SBData &data) const {
Status
ScriptInterpreter::GetStatusFromSBError(const lldb::SBError &error) const {
if (error.m_opaque_up)
- return *error.m_opaque_up;
+ return *error.m_opaque_up.get();
return Status();
}
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 9c635c04eb1e8..09dd94d9186d3 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -644,7 +644,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
if (m_load_address == LLDB_INVALID_ADDRESS)
return false;
- FileSpec file_spec(m_name);
+ FileSpec file_spec(m_name.c_str());
llvm::MachO::mach_header mh;
size_t size_to_read = 512;
@@ -785,7 +785,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
PlatformDarwinKernel::GetPluginNameStatic());
if (platform_sp->GetPluginName() == g_platform_name.GetStringRef()) {
ModuleSpec kext_bundle_module_spec(module_spec);
- FileSpec kext_filespec(m_name);
+ FileSpec kext_filespec(m_name.c_str());
FileSpecList search_paths = target.GetExecutableSearchPaths();
kext_bundle_module_spec.GetFileSpec() = kext_filespec;
platform_sp->GetSharedModule(kext_bundle_module_spec, process,
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index cba8191887900..5f7bb1262f8cf 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -116,7 +116,7 @@ std::shared_ptr<ClangModulesDeclVendor>
ClangPersistentVariables::GetClangModulesDeclVendor() {
if (!m_modules_decl_vendor_sp) {
m_modules_decl_vendor_sp.reset(
- ClangModulesDeclVendor::Create(*m_target_sp));
+ ClangModulesDeclVendor::Create(*m_target_sp.get()));
}
return m_modules_decl_vendor_sp;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp
index f5f9a40bb5a36..a67cc8e10c175 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/NameSearchContext.cpp
@@ -117,7 +117,7 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
// will crash in clang.
clang::OverloadedOperatorKind op_kind = clang::NUM_OVERLOADED_OPERATORS;
if (func_proto_type &&
- TypeSystemClang::IsOperator(decl_name.getAsString(), op_kind)) {
+ TypeSystemClang::IsOperator(decl_name.getAsString().c_str(), op_kind)) {
if (!TypeSystemClang::CheckOverloadedOperatorKindParameterCount(
false, op_kind, func_proto_type->getNumParams()))
return nullptr;
diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
index 77d74023e717b..425b0baa453f8 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
@@ -211,7 +211,7 @@ CreateStackTrace(ValueObjectSP o,
const std::string &trace_item_name = ".trace") {
auto trace_sp = std::make_shared<StructuredData::Array>();
ValueObjectSP trace_value_object =
- o->GetValueForExpressionPath(trace_item_name);
+ o->GetValueForExpressionPath(trace_item_name.c_str());
size_t count = trace_value_object->GetNumChildren();
for (size_t j = 0; j < count; j++) {
addr_t trace_addr =
@@ -230,10 +230,11 @@ static StructuredData::ArraySP ConvertToStructuredArray(
const StructuredData::DictionarySP &dict)> const
&callback) {
auto array_sp = std::make_shared<StructuredData::Array>();
- unsigned int count = return_value_sp->GetValueForExpressionPath(count_name)
- ->GetValueAsUnsigned(0);
+ unsigned int count =
+ return_value_sp->GetValueForExpressionPath(count_name.c_str())
+ ->GetValueAsUnsigned(0);
ValueObjectSP objects =
- return_value_sp->GetValueForExpressionPath(items_name);
+ return_value_sp->GetValueForExpressionPath(items_name.c_str());
for (unsigned int i = 0; i < count; i++) {
ValueObjectSP o = objects->GetChildAtIndex(i, true);
auto dict_sp = std::make_shared<StructuredData::Dictionary>();
@@ -248,8 +249,9 @@ static StructuredData::ArraySP ConvertToStructuredArray(
static std::string RetrieveString(ValueObjectSP return_value_sp,
ProcessSP process_sp,
const std::string &expression_path) {
- addr_t ptr = return_value_sp->GetValueForExpressionPath(expression_path)
- ->GetValueAsUnsigned(0);
+ addr_t ptr =
+ return_value_sp->GetValueForExpressionPath(expression_path.c_str())
+ ->GetValueAsUnsigned(0);
std::string str;
Status error;
process_sp->ReadCStringFromMemory(ptr, str, error);
diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
index 66569e9d4669e..7ea8b4697d204 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
@@ -88,7 +88,7 @@ t;
static addr_t RetrieveUnsigned(ValueObjectSP return_value_sp,
ProcessSP process_sp,
const std::string &expression_path) {
- return return_value_sp->GetValueForExpressionPath(expression_path)
+ return return_value_sp->GetValueForExpressionPath(expression_path.c_str())
->GetValueAsUnsigned(0);
}
diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 8d2c84d94a97a..46f82daaff8d5 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -381,12 +381,12 @@ static void NSNumber_FormatInt128(ValueObject &valobj, Stream &stream,
}
}
- stream.PutCString(prefix);
+ stream.PutCString(prefix.c_str());
const int radix = 10;
const bool isSigned = true;
std::string str = llvm::toString(value, radix, isSigned);
- stream.PutCString(str);
- stream.PutCString(suffix);
+ stream.PutCString(str.c_str());
+ stream.PutCString(suffix.c_str());
}
static void NSNumber_FormatFloat(ValueObject &valobj, Stream &stream,
diff --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
index ed815aa9e709a..aaead88369b20 100644
--- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
+++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
@@ -101,8 +101,9 @@ static void CreateHistoryThreadFromValueObject(ProcessSP process_sp,
std::string trace_path = "." + std::string(type) + "_trace";
ValueObjectSP count_sp =
- return_value_sp->GetValueForExpressionPath(count_path);
- ValueObjectSP tid_sp = return_value_sp->GetValueForExpressionPath(tid_path);
+ return_value_sp->GetValueForExpressionPath(count_path.c_str());
+ ValueObjectSP tid_sp =
+ return_value_sp->GetValueForExpressionPath(tid_path.c_str());
if (!count_sp || !tid_sp)
return;
@@ -114,7 +115,7 @@ static void CreateHistoryThreadFromValueObject(ProcessSP process_sp,
return;
ValueObjectSP trace_sp =
- return_value_sp->GetValueForExpressionPath(trace_path);
+ return_value_sp->GetValueForExpressionPath(trace_path.c_str());
if (!trace_sp)
return;
diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
index 083023231e3dd..9af921f4843cf 100644
--- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp
+++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
@@ -134,7 +134,7 @@ Status AdbClient::Connect() {
port = env_port;
}
std::string uri = "connect://127.0.0.1:" + port;
- m_conn->Connect(uri, &error);
+ m_conn->Connect(uri.c_str(), &error);
return error;
}
@@ -304,7 +304,8 @@ Status AdbClient::GetResponseError(const char *response_id) {
std::vector<char> error_message;
auto error = ReadMessage(error_message);
if (error.Success())
- error.SetErrorString(std::string(&error_message[0], error_message.size()));
+ error.SetErrorString(
+ std::string(&error_message[0], error_message.size()).c_str());
return error;
}
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
index 45ba1f9cd9fc3..7c694390b7266 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -95,8 +95,8 @@ bool PlatformAndroidRemoteGDBServer::LaunchGDBServer(lldb::pid_t &pid,
if (gdbstub_port)
local_port = std::stoi(gdbstub_port);
- auto error =
- MakeConnectURL(pid, local_port, remote_port, socket_name, connect_url);
+ auto error = MakeConnectURL(pid, local_port, remote_port, socket_name.c_str(),
+ connect_url);
if (error.Success() && log)
LLDB_LOGF(log, "gdbserver connect URL: %s", connect_url.c_str());
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
index fe63a436cdae4..f4f866b724d6f 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
@@ -86,7 +86,7 @@ bool PlatformDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
llvm::StringRef dirname = GetDeviceSupportDirectoryName();
std::string local_sdk_cache_str = "~/Library/Developer/Xcode/";
local_sdk_cache_str += std::string(dirname);
- FileSpec local_sdk_cache(local_sdk_cache_str);
+ FileSpec local_sdk_cache(local_sdk_cache_str.c_str());
FileSystem::Instance().Resolve(local_sdk_cache);
if (FileSystem::Instance().Exists(local_sdk_cache)) {
if (log) {
@@ -231,7 +231,7 @@ const char *PlatformDarwinDevice::GetDeviceSupportDirectory() {
if (m_device_support_directory.empty()) {
if (FileSpec fspec = HostInfo::GetXcodeDeveloperDirectory()) {
m_device_support_directory = fspec.GetPath();
- m_device_support_directory.append(platform_dir);
+ m_device_support_directory.append(platform_dir.c_str());
} else {
// Assign a single NULL character so we know we tried to find the device
// support directory and we don't keep trying to find it over and over.
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index 7561afe5feb62..3c9cc8e77189e 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -411,7 +411,7 @@ void PlatformDarwinKernel::AddSDKSubdirsToSearchPaths(const std::string &dir) {
const bool find_files = false;
const bool find_other = false;
FileSystem::Instance().EnumerateDirectory(
- dir, find_directories, find_files, find_other,
+ dir.c_str(), find_directories, find_files, find_other,
FindKDKandSDKDirectoriesInDirectory, this);
}
@@ -442,7 +442,7 @@ void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() {
const bool find_files = true;
const bool find_other = true; // I think eFileTypeSymbolicLink are "other"s.
FileSystem::Instance().EnumerateDirectory(
- dir.GetPath(), find_directories, find_files, find_other,
+ dir.GetPath().c_str(), find_directories, find_files, find_other,
GetKernelsAndKextsInDirectoryWithRecursion, this);
}
const uint32_t num_dirs_no_recurse = m_search_directories_no_recursing.size();
@@ -452,7 +452,7 @@ void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() {
const bool find_files = true;
const bool find_other = true; // I think eFileTypeSymbolicLink are "other"s.
FileSystem::Instance().EnumerateDirectory(
- dir.GetPath(), find_directories, find_files, find_other,
+ dir.GetPath().c_str(), find_directories, find_files, find_other,
GetKernelsAndKextsInDirectoryNoRecursion, this);
}
}
@@ -545,7 +545,7 @@ PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper(
const bool find_files = false;
const bool find_other = false;
FileSystem::Instance().EnumerateDirectory(
- search_here_too, find_directories, find_files, find_other,
+ search_here_too.c_str(), find_directories, find_files, find_other,
recurse ? GetKernelsAndKextsInDirectoryWithRecursion
: GetKernelsAndKextsInDirectoryNoRecursion,
baton);
@@ -874,7 +874,8 @@ std::vector<lldb_private::FileSpec>
PlatformDarwinKernel::SearchForExecutablesRecursively(const std::string &dir) {
std::vector<FileSpec> executables;
std::error_code EC;
- for (llvm::sys::fs::recursive_directory_iterator it(dir, EC), end;
+ for (llvm::sys::fs::recursive_directory_iterator it(dir.c_str(), EC),
+ end;
it != end && !EC; it.increment(EC)) {
auto status = it->status();
if (!status)
diff --git a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
index 5d56d6af1a840..a35efd53f313e 100644
--- a/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
+++ b/lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
@@ -60,7 +60,7 @@ class ModelIdentifier {
unsigned int GetVersionAtIndex(size_t idx) const { return m_versions[idx]; }
- std::string GetFamily() const { return m_family; }
+ std::string GetFamily() const { return m_family.c_str(); }
private:
std::string m_family;
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index 24d859f13ce07..780f51cc18c22 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -87,7 +87,7 @@ llvm::StringRef PlatformRemoteGDBServer::GetDescription() {
}
if (!m_platform_description.empty())
- return m_platform_description;
+ return m_platform_description.c_str();
return GetDescriptionStatic();
}
@@ -423,10 +423,10 @@ PlatformRemoteGDBServer::DebugProcess(ProcessLaunchInfo &launch_info,
if (process_sp) {
process_sp->HijackProcessEvents(launch_info.GetHijackListener());
- error = process_sp->ConnectRemote(connect_url);
+ error = process_sp->ConnectRemote(connect_url.c_str());
// Retry the connect remote one time...
if (error.Fail())
- error = process_sp->ConnectRemote(connect_url);
+ error = process_sp->ConnectRemote(connect_url.c_str());
if (error.Success())
error = process_sp->Launch(launch_info);
else if (debugserver_pid != LLDB_INVALID_PROCESS_ID) {
@@ -509,7 +509,7 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach(
target->CreateProcess(attach_info.GetListenerForProcess(debugger),
"gdb-remote", nullptr, true);
if (process_sp) {
- error = process_sp->ConnectRemote(connect_url);
+ error = process_sp->ConnectRemote(connect_url.c_str());
if (error.Success()) {
ListenerSP listener_sp = attach_info.GetHijackListener();
if (listener_sp)
@@ -794,7 +794,7 @@ size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger &debugger,
GetPendingGdbServerList(connection_urls);
for (size_t i = 0; i < connection_urls.size(); ++i) {
- ConnectProcess(connection_urls[i], "gdb-remote", debugger, nullptr, error);
+ ConnectProcess(connection_urls[i].c_str(), "gdb-remote", debugger, nullptr, error);
if (error.Fail())
return i; // We already connected to i process successfully
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 2d83a71ba0447..7daf003fec7ba 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -869,7 +869,7 @@ lldb::thread_result_t GDBRemoteCommunication::ListenThread() {
if (connection) {
// Do the listen on another thread so we can continue on...
if (connection->Connect(
- m_listen_url,
+ m_listen_url.c_str(),
[this](llvm::StringRef port_str) {
uint16_t port = 0;
llvm::to_integer(port_str, port, 10);
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index bcc23d30143fc..29e9620eb433c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1333,7 +1333,7 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) {
else
triple += os_name;
}
- m_host_arch.SetTriple(triple);
+ m_host_arch.SetTriple(triple.c_str());
llvm::Triple &host_triple = m_host_arch.GetTriple();
if (host_triple.getVendor() == llvm::Triple::Apple &&
@@ -1358,7 +1358,7 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) {
}
}
} else {
- m_host_arch.SetTriple(triple);
+ m_host_arch.SetTriple(triple.c_str());
if (pointer_byte_size) {
assert(pointer_byte_size == m_host_arch.GetAddressByteSize());
}
@@ -1615,7 +1615,7 @@ Status GDBRemoteCommunicationClient::GetMemoryRegionInfo(
std::string error_string;
// Now convert the HEX bytes into a string value
error_extractor.GetHexByteString(error_string);
- error.SetErrorString(error_string);
+ error.SetErrorString(error_string.c_str());
} else if (name.equals("dirty-pages")) {
std::vector<addr_t> dirty_page_list;
for (llvm::StringRef x : llvm::split(value, ',')) {
@@ -2023,7 +2023,7 @@ bool GDBRemoteCommunicationClient::DecodeProcessInfoResponse(
StringExtractor extractor(value);
std::string triple;
extractor.GetHexByteString(triple);
- process_info.GetArchitecture().SetTriple(triple);
+ process_info.GetArchitecture().SetTriple(triple.c_str());
} else if (name.equals("name")) {
StringExtractor extractor(value);
// The process name from ASCII hex bytes since we can't control the
@@ -2205,7 +2205,7 @@ bool GDBRemoteCommunicationClient::GetCurrentProcessInfo(bool allow_lazy) {
// Set the ArchSpec from the triple if we have it.
if (!triple.empty()) {
- m_process_arch.SetTriple(triple);
+ m_process_arch.SetTriple(triple.c_str());
m_process_arch.SetFlags(elf_abi);
if (pointer_byte_size) {
assert(pointer_byte_size == m_process_arch.GetAddressByteSize());
@@ -3805,7 +3805,7 @@ bool GDBRemoteCommunicationClient::GetModuleInfo(
StringExtractor extractor(value);
std::string triple;
extractor.GetHexByteString(triple);
- module_spec.GetArchitecture().SetTriple(triple);
+ module_spec.GetArchitecture().SetTriple(triple.c_str());
} else if (name == "file_offset") {
uint64_t ival = 0;
if (!value.getAsInteger(16, ival))
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index e6fece130f90a..c2c01d1e46053 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -747,8 +747,9 @@ GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(
std::string output;
FileSpec working_spec(working_dir);
FileSystem::Instance().Resolve(working_spec);
- Status err = Host::RunShellCommand(path, working_spec, &status, &signo,
- &output, std::chrono::seconds(10));
+ Status err =
+ Host::RunShellCommand(path.c_str(), working_spec, &status, &signo,
+ &output, std::chrono::seconds(10));
StreamGDBRemote response;
if (err.Fail()) {
response.PutCString("F,");
@@ -1135,7 +1136,8 @@ GDBRemoteCommunicationServerCommon::Handle_qModuleInfo(
response.PutChar(';');
response.PutCString("file_path:");
- response.PutStringAsRawHex8(matched_module_spec.GetFileSpec().GetPath());
+ response.PutStringAsRawHex8(
+ matched_module_spec.GetFileSpec().GetPath().c_str());
response.PutChar(';');
response.PutCString("file_offset:");
response.PutHex64(file_offset);
@@ -1210,7 +1212,7 @@ void GDBRemoteCommunicationServerCommon::CreateProcessInfoResponse(
proc_info.GetUserID(), proc_info.GetGroupID(),
proc_info.GetEffectiveUserID(), proc_info.GetEffectiveGroupID());
response.PutCString("name:");
- response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath());
+ response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath().c_str());
response.PutChar(';');
response.PutCString("args:");
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 82401add3982e..13446d560d87e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -1501,7 +1501,7 @@ GDBRemoteCommunicationServerLLGS::Handle_qGetWorkingDir(
FileSpec working_dir{m_process_launch_info.GetWorkingDirectory()};
if (working_dir) {
StreamString response;
- response.PutStringAsRawHex8(working_dir.GetPath());
+ response.PutStringAsRawHex8(working_dir.GetPath().c_str());
return SendPacketNoLock(response.GetString());
}
@@ -3197,7 +3197,7 @@ GDBRemoteCommunicationServerLLGS::ReadXferObject(llvm::StringRef object,
response.Printf("<library-list-svr4 version=\"1.0\">");
for (auto const &library : *library_list) {
response.Printf("<library name=\"%s\" ",
- XMLEncodeAttributeValue(library.name).c_str());
+ XMLEncodeAttributeValue(library.name.c_str()).c_str());
response.Printf("lm=\"0x%" PRIx64 "\" ", library.link_map);
response.Printf("l_addr=\"0x%" PRIx64 "\" ", library.base_addr);
response.Printf("l_ld=\"0x%" PRIx64 "\" />", library.ld_addr);
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index f36733168cab7..0c2e5237f600c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -429,7 +429,7 @@ GDBRemoteCommunicationServerPlatform::Handle_qPathComplete(
separator = ",";
// encode result strings into hex bytes to avoid unexpected error caused by
// special characters like '$'.
- response.PutStringAsRawHex8(match);
+ response.PutStringAsRawHex8(match.c_str());
}
return SendPacketNoLock(response.GetString());
@@ -586,7 +586,8 @@ GDBRemoteCommunicationServerPlatform::GetDomainSocketPath(const char *prefix) {
FileSpec socket_path_spec(GetDomainSocketDir());
socket_path_spec.AppendPathComponent(socket_name.c_str());
- llvm::sys::fs::createUniqueFile(socket_path_spec.GetPath(), socket_path);
+ llvm::sys::fs::createUniqueFile(socket_path_spec.GetPath().c_str(),
+ socket_path);
return FileSpec(socket_path.c_str());
}
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index da4f3d6b900c2..e31d8bb769f85 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -104,7 +104,7 @@ ScriptedProcess::ScriptedProcess(
ExecutionContext exe_ctx(target_sp, /*get_process=*/false);
StructuredData::GenericSP object_sp = GetInterface().CreatePluginObject(
- m_scripted_process_info.GetClassName(), exe_ctx,
+ m_scripted_process_info.GetClassName().c_str(), exe_ctx,
m_scripted_process_info.GetArgsSP());
if (!object_sp || !object_sp->IsValid()) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 4d1a8f5c12900..cbe166281b4bc 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -459,7 +459,8 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
->GetArchitecture()
.GetTriple()
.getArchName()
- .str());
+ .str()
+ .c_str());
comp_unit_info->oso_sp->module_sp = std::make_shared<DebugMapModule>(
obj_file->GetModule(), GetCompUnitInfoIndex(comp_unit_info), oso_file,
oso_arch, oso_object ? &oso_object : nullptr, 0,
diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index c92de9b94ab2c..6e6c0e8c90cbc 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -1442,7 +1442,7 @@ PDBASTParser::AddRecordMethod(lldb_private::SymbolFile &symbol_file,
// TODO: get mangled name for the method.
return m_ast.AddMethodToCXXRecordType(
- record_type.GetOpaqueQualType(), name,
+ record_type.GetOpaqueQualType(), name.c_str(),
/*mangled_name*/ nullptr, method_comp_type, access, method.isVirtual(),
method.isStatic(), method.hasInlineAttribute(),
/*is_explicit*/ false, // FIXME: Need this field in CodeView.
diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 2d42e023133da..0adf204323b39 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -246,7 +246,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
// the full source path remap.
if (do_truncate_remapping_names) {
FileSpec build_path(key.AsCString());
- FileSpec source_path(DBGSourcePath);
+ FileSpec source_path(DBGSourcePath.c_str());
build_path.RemoveLastPathComponent();
build_path.RemoveLastPathComponent();
source_path.RemoveLastPathComponent();
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
index d03a8ce4e9241..796e7e50a8b90 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
@@ -67,7 +67,7 @@ class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly {
m_initial_sp(0), m_cfa_reg_info(), m_fp_is_cfa(false),
m_register_values(), m_pushed_regs(), m_curr_row_modified(false),
m_forward_branch_offset(0) {
- if (m_inst_emulator_up) {
+ if (m_inst_emulator_up.get()) {
m_inst_emulator_up->SetBaton(this);
m_inst_emulator_up->SetCallbacks(ReadMemory, WriteMemory, ReadRegister,
WriteRegister);
diff --git a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
index 498ed76189803..7d24905be3504 100644
--- a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
+++ b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
@@ -350,7 +350,7 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
(CFDictionaryRef)uuid_dict, CFSTR("DBGSymbolRichExecutable"));
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
if (CFCString::FileSystemRepresentation(cf_str, str)) {
- module_spec.GetFileSpec().SetFile(str, FileSpec::Style::native);
+ module_spec.GetFileSpec().SetFile(str.c_str(), FileSpec::Style::native);
FileSystem::Instance().Resolve(module_spec.GetFileSpec());
LLDB_LOGF(log,
"From dsymForUUID plist: Symbol rich executable is at '%s'",
@@ -362,7 +362,8 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
CFSTR("DBGDSYMPath"));
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
if (CFCString::FileSystemRepresentation(cf_str, str)) {
- module_spec.GetSymbolFileSpec().SetFile(str, FileSpec::Style::native);
+ module_spec.GetSymbolFileSpec().SetFile(str.c_str(),
+ FileSpec::Style::native);
FileSystem::Instance().Resolve(module_spec.GetFileSpec());
success = true;
LLDB_LOGF(log, "From dsymForUUID plist: dSYM is at '%s'", str.c_str());
@@ -433,7 +434,7 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
DBGSourcePath = original_DBGSourcePath_value;
}
if (DBGSourcePath[0] == '~') {
- FileSpec resolved_source_path(DBGSourcePath);
+ FileSpec resolved_source_path(DBGSourcePath.c_str());
FileSystem::Instance().Resolve(resolved_source_path);
DBGSourcePath = resolved_source_path.GetPath();
}
@@ -444,8 +445,8 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
module_spec.GetSourceMappingList().Append(DBGBuildSourcePath,
DBGSourcePath, true);
if (do_truncate_remapping_names) {
- FileSpec build_path(DBGBuildSourcePath);
- FileSpec source_path(DBGSourcePath);
+ FileSpec build_path(DBGBuildSourcePath.c_str());
+ FileSpec source_path(DBGSourcePath.c_str());
build_path.RemoveLastPathComponent();
build_path.RemoveLastPathComponent();
source_path.RemoveLastPathComponent();
@@ -479,7 +480,7 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
if (DBGSourcePath[0] == '~') {
- FileSpec resolved_source_path(DBGSourcePath);
+ FileSpec resolved_source_path(DBGSourcePath.c_str());
FileSystem::Instance().Resolve(resolved_source_path);
DBGSourcePath = resolved_source_path.GetPath();
}
diff --git a/lldb/source/Target/LanguageRuntime.cpp b/lldb/source/Target/LanguageRuntime.cpp
index 4d905f4435595..ce3646c8b05c8 100644
--- a/lldb/source/Target/LanguageRuntime.cpp
+++ b/lldb/source/Target/LanguageRuntime.cpp
@@ -300,7 +300,7 @@ void LanguageRuntime::InitializeCommands(CommandObject *parent) {
// and cached because we may create multiple debuggers and need one
// instance of the command each - the implementing function is meant to
// create a new instance of the command each time it is invoked.
- parent->LoadSubCommand(command->GetCommandName().str(), command);
+ parent->LoadSubCommand(command->GetCommandName().str().c_str(), command);
}
}
}
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp
index 012031baaea27..8ce2ae8c2898e 100644
--- a/lldb/source/Target/TargetList.cpp
+++ b/lldb/source/Target/TargetList.cpp
@@ -351,7 +351,7 @@ Status TargetList::CreateTargetInternal(Debugger &debugger,
target_sp->SetArg0(resolved_bundle_exe_path);
} else {
// Use resolved path
- target_sp->SetArg0(file.GetPath());
+ target_sp->SetArg0(file.GetPath().c_str());
}
}
if (file.GetDirectory()) {
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 05c04e3cfddce..5b4c5db2d9286 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -1084,7 +1084,7 @@ ThreadPlanStack &Thread::GetPlans() const {
// queries GetDescription makes, and only assert if you try to run the thread.
if (!m_null_plan_stack_up)
m_null_plan_stack_up = std::make_unique<ThreadPlanStack>(*this, true);
- return *(m_null_plan_stack_up);
+ return *(m_null_plan_stack_up.get());
}
void Thread::PushPlan(ThreadPlanSP thread_plan_sp) {
diff --git a/lldb/source/Target/ThreadPlanStack.cpp b/lldb/source/Target/ThreadPlanStack.cpp
index 1572931429071..ac7b44cef37d4 100644
--- a/lldb/source/Target/ThreadPlanStack.cpp
+++ b/lldb/source/Target/ThreadPlanStack.cpp
@@ -406,7 +406,7 @@ void ThreadPlanStackMap::Update(ThreadList ¤t_threads,
for (auto thread : current_threads.Threads()) {
lldb::tid_t cur_tid = thread->GetID();
if (!Find(cur_tid)) {
- AddThread(*thread);
+ AddThread(*thread.get());
thread->QueueBasePlan(true);
}
}
diff --git a/lldb/tools/debugserver/source/DNBTimer.h b/lldb/tools/debugserver/source/DNBTimer.h
index 7c01a69ae7cd5..2251c50fb8768 100644
--- a/lldb/tools/debugserver/source/DNBTimer.h
+++ b/lldb/tools/debugserver/source/DNBTimer.h
@@ -47,7 +47,7 @@ class DNBTimer {
~DNBTimer() {}
- bool IsThreadSafe() const { return m_mutexAP != NULL; }
+ bool IsThreadSafe() const { return m_mutexAP.get() != NULL; }
// Reset the time value to now
void Reset() {
PTHREAD_MUTEX_LOCKER(locker, m_mutexAP.get());
diff --git a/lldb/tools/lldb-vscode/BreakpointBase.cpp b/lldb/tools/lldb-vscode/BreakpointBase.cpp
index 1dabe20a9f355..9ec392c9afe47 100644
--- a/lldb/tools/lldb-vscode/BreakpointBase.cpp
+++ b/lldb/tools/lldb-vscode/BreakpointBase.cpp
@@ -304,7 +304,7 @@ bool BreakpointBase::BreakpointHitCallback(
}
if (!output.empty() && output.back() != '\n')
output.push_back('\n'); // Ensure log message has line break.
- g_vsc.SendOutput(OutputType::Console, output);
+ g_vsc.SendOutput(OutputType::Console, output.c_str());
// Do not stop.
return false;
More information about the lldb-commits
mailing list