summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/DiagnosticManager.cpp12
-rw-r--r--lldb/source/Expression/FunctionCaller.cpp11
-rw-r--r--lldb/source/Expression/LLVMUserExpression.cpp14
3 files changed, 18 insertions, 19 deletions
diff --git a/lldb/source/Expression/DiagnosticManager.cpp b/lldb/source/Expression/DiagnosticManager.cpp
index 37a9df7311b..ad06600e098 100644
--- a/lldb/source/Expression/DiagnosticManager.cpp
+++ b/lldb/source/Expression/DiagnosticManager.cpp
@@ -67,15 +67,15 @@ size_t DiagnosticManager::Printf(DiagnosticSeverity severity,
size_t result = ss.PrintfVarArg(format, args);
va_end(args);
- AddDiagnostic(ss.GetData(), severity, eDiagnosticOriginLLDB);
+ AddDiagnostic(ss.GetString(), severity, eDiagnosticOriginLLDB);
return result;
}
-size_t DiagnosticManager::PutCString(DiagnosticSeverity severity,
- const char *cstr) {
- if (!cstr)
+size_t DiagnosticManager::PutString(DiagnosticSeverity severity,
+ llvm::StringRef str) {
+ if (str.empty())
return 0;
- AddDiagnostic(cstr, severity, eDiagnosticOriginLLDB);
- return strlen(cstr);
+ AddDiagnostic(str, severity, eDiagnosticOriginLLDB);
+ return str.size();
}
diff --git a/lldb/source/Expression/FunctionCaller.cpp b/lldb/source/Expression/FunctionCaller.cpp
index 805afda2fba..f218ccb047a 100644
--- a/lldb/source/Expression/FunctionCaller.cpp
+++ b/lldb/source/Expression/FunctionCaller.cpp
@@ -1,5 +1,4 @@
-//===-- FunctionCaller.cpp ---------------------------------------*- C++
-//-*-===//
+//===-- FunctionCaller.cpp ---------------------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -130,9 +129,9 @@ bool FunctionCaller::WriteFunctionArguments(
// All the information to reconstruct the struct is provided by the
// StructExtractor.
if (!m_struct_valid) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "Argument information was not correctly "
- "parsed, so the function cannot be called.");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "Argument information was not correctly "
+ "parsed, so the function cannot be called.");
return false;
}
@@ -243,7 +242,7 @@ lldb::ThreadPlanSP FunctionCaller::GetThreadPlanToCallFunction(
// FIXME: Use the errors Stream for better error reporting.
Thread *thread = exe_ctx.GetThreadPtr();
if (thread == NULL) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"Can't call a function without a valid thread.");
return NULL;
diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp
index 78207df56b0..379dd98b5ca 100644
--- a/lldb/source/Expression/LLVMUserExpression.cpp
+++ b/lldb/source/Expression/LLVMUserExpression.cpp
@@ -97,7 +97,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
llvm::Function *function = m_execution_unit_sp->GetFunction();
if (!module || !function) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"supposed to interpret, but nothing is there");
return lldb::eExpressionSetupError;
@@ -153,7 +153,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
StreamString ss;
if (!call_plan_sp || !call_plan_sp->ValidatePlan(&ss)) {
- diagnostic_manager.PutCString(eDiagnosticSeverityError, ss.GetData());
+ diagnostic_manager.PutString(eDiagnosticSeverityError, ss.GetData());
return lldb::eExpressionSetupError;
}
@@ -198,8 +198,8 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
"Execution was interrupted, reason: %s.",
error_desc);
else
- diagnostic_manager.PutCString(eDiagnosticSeverityError,
- "Execution was interrupted.");
+ diagnostic_manager.PutString(eDiagnosticSeverityError,
+ "Execution was interrupted.");
if ((execution_result == lldb::eExpressionInterrupted &&
options.DoesUnwindOnError()) ||
@@ -220,7 +220,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
return execution_result;
} else if (execution_result == lldb::eExpressionStoppedForDebug) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityRemark,
"Execution was halted at the first instruction of the expression "
"function because \"debug\" was requested.\n"
@@ -243,7 +243,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
return lldb::eExpressionResultUnavailable;
}
} else {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"Expression can't be run, because there is no JIT compiled function");
return lldb::eExpressionSetupError;
@@ -298,7 +298,7 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
lldb::StackFrameSP frame;
if (!LockAndCheckContext(exe_ctx, target, process, frame)) {
- diagnostic_manager.PutCString(
+ diagnostic_manager.PutString(
eDiagnosticSeverityError,
"The context has changed before we could JIT the expression!");
return false;
OpenPOWER on IntegriCloud