[lldb][NFCI] Methods to load scripting resources should take a Stream by reference

These methods all take a `Stream *` to get feedback about what's going
on. By default, it's a nullptr, but we always feed it with a valid
pointer. It would therefore make more sense to have this take a
reference.

Differential Revision: https://reviews.llvm.org/D154883
This commit is contained in:
Alex Langford
2023-07-10 13:19:13 -07:00
parent 95d62344c0
commit 1d796b48e4
12 changed files with 48 additions and 51 deletions

View File

@@ -1499,7 +1499,7 @@ bool Module::IsLoadedInTarget(Target *target) {
}
bool Module::LoadScriptingResourceInTarget(Target *target, Status &error,
Stream *feedback_stream) {
Stream &feedback_stream) {
if (!target) {
error.SetErrorString("invalid destination Target");
return false;
@@ -1534,17 +1534,16 @@ bool Module::LoadScriptingResourceInTarget(Target *target, Status &error,
if (scripting_fspec &&
FileSystem::Instance().Exists(scripting_fspec)) {
if (should_load == eLoadScriptFromSymFileWarn) {
if (feedback_stream)
feedback_stream->Printf(
"warning: '%s' contains a debug script. To run this script "
"in "
"this debug session:\n\n command script import "
"\"%s\"\n\n"
"To run all discovered debug scripts in this session:\n\n"
" settings set target.load-script-from-symbol-file "
"true\n",
GetFileSpec().GetFileNameStrippingExtension().GetCString(),
scripting_fspec.GetPath().c_str());
feedback_stream.Printf(
"warning: '%s' contains a debug script. To run this script "
"in "
"this debug session:\n\n command script import "
"\"%s\"\n\n"
"To run all discovered debug scripts in this session:\n\n"
" settings set target.load-script-from-symbol-file "
"true\n",
GetFileSpec().GetFileNameStrippingExtension().GetCString(),
scripting_fspec.GetPath().c_str());
return false;
}
StreamString scripting_stream;