summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
index 48c006a2cf7..43ac4c6747a 100644
--- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
@@ -272,7 +272,7 @@ GoUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
PersistentExpressionState *pv =
target->GetPersistentExpressionStateForLanguage(eLanguageTypeGo);
if (pv != nullptr) {
- result->SetName(pv->GetNextPersistentVariableName());
+ result->SetName(pv->GetNextPersistentVariableName(*target));
pv->AddVariable(result);
}
return lldb::eExpressionCompleted;
@@ -650,11 +650,12 @@ ValueObjectSP GoUserExpression::GoInterpreter::VisitCallExpr(
GoPersistentExpressionState::GoPersistentExpressionState()
: PersistentExpressionState(eKindGo) {}
-ConstString GoPersistentExpressionState::GetNextPersistentVariableName() {
+ConstString
+GoPersistentExpressionState::GetNextPersistentVariableName(Target &target) {
char name_cstr[256];
// We can't use the same variable format as clang.
::snprintf(name_cstr, sizeof(name_cstr), "$go%u",
- m_next_persistent_variable_id++);
+ target.GetNextPersistentVariableIndex());
ConstString name(name_cstr);
return name;
}
OpenPOWER on IntegriCloud