diff options
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser/Go')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h | 2 |
2 files changed, 5 insertions, 4 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; } diff --git a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h index 03ceb76b843..28c00215ed7 100644 --- a/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Go/GoUserExpression.h @@ -29,7 +29,7 @@ class GoPersistentExpressionState : public PersistentExpressionState { public: GoPersistentExpressionState(); - ConstString GetNextPersistentVariableName() override; + ConstString GetNextPersistentVariableName(Target &target) override; void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override; |

