summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-05 12:32:59 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-05 12:32:59 +0000
commit6c64a9b8ab7ebbefb3f7dcda86aa9a6fb915433c (patch)
tree95d64d895544258f95d8f58680cd71521d8e0b40 /lldb/source/Plugins/ExpressionParser
parent6e52d40ce3159ef454eb749176842f0263cc49ea (diff)
downloadbcm5719-llvm-6c64a9b8ab7ebbefb3f7dcda86aa9a6fb915433c.tar.gz
bcm5719-llvm-6c64a9b8ab7ebbefb3f7dcda86aa9a6fb915433c.zip
[lldb] Move redundant persistent variable counter to ClangPersistentVariables
Currently Target::m_next_persistent_variable_index is counting up for our persistent variables ($0, $1, ...) but we also have a unused counter that is supposed to do this in ClangPersistentVariables but that stays always at 0 (because we currently increase the target counter when we should increase that unused counter). This patch removes the counter in Target and lets the documented counter in ClangPersistentVariables do the variable counting. Patch *should* be NFC, but it might unexpectedly bring LLDB to new code paths that could contain exciting new bugs to fix. llvm-svn: 367842
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
index b39f89ad7ee..3aad351ccc3 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
@@ -45,8 +45,18 @@ public:
uint32_t addr_byte_size) override;
void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
- llvm::StringRef
- GetPersistentVariablePrefix(bool is_error) const override {
+
+ ConstString GetNextPersistentVariableName(Target &target,
+ llvm::StringRef prefix) override {
+ llvm::SmallString<64> name;
+ {
+ llvm::raw_svector_ostream os(name);
+ os << prefix << m_next_persistent_variable_id++;
+ }
+ return ConstString(name);
+ }
+
+ llvm::StringRef GetPersistentVariablePrefix(bool is_error) const override {
return "$";
}
OpenPOWER on IntegriCloud