mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user