summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-07-19 04:39:22 +0000
committerJason Molenda <jmolenda@apple.com>2013-07-19 04:39:22 +0000
commite6ca2ee6b82d86ef68914de6252fbf2ddc4d47f8 (patch)
tree44acd1cb2fa2cf89c34c622486d50d358c631308 /lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
parent64b29d616b5171f4d8b2e1d07b63d8098506e3cb (diff)
downloadbcm5719-llvm-e6ca2ee6b82d86ef68914de6252fbf2ddc4d47f8.tar.gz
bcm5719-llvm-e6ca2ee6b82d86ef68914de6252fbf2ddc4d47f8.zip
Don't use a function-scope static varaibles in
RegisterContextLLDB::SavedLocationForRegister to cache the pc and sp register numbers -- if lldb is debugging multiple Targets of different architectures, this will be incorrect. If these were to be cached anywhere, it would have to be up in the Target. llvm-svn: 186651
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index b0d623113ad..1ffc30da576 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -936,15 +936,10 @@ RegisterContextLLDB::SavedLocationForRegister (uint32_t lldb_regnum, lldb_privat
}
}
- static uint32_t sp_regnum = LLDB_INVALID_REGNUM;
- static uint32_t pc_regnum = LLDB_INVALID_REGNUM;
- static bool generic_registers_initialized = false;
- if (!generic_registers_initialized)
- {
- m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, eRegisterKindLLDB, sp_regnum);
- m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, eRegisterKindLLDB, pc_regnum);
- generic_registers_initialized = true;
- }
+ uint32_t sp_regnum = LLDB_INVALID_REGNUM;
+ uint32_t pc_regnum = LLDB_INVALID_REGNUM;
+ m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, eRegisterKindLLDB, sp_regnum);
+ m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, eRegisterKindLLDB, pc_regnum);
// Are we looking for the CALLER's stack pointer? The stack pointer is defined to be the same as THIS frame's
// CFA so just return the CFA value. This is true on x86-32/x86-64 at least.
OpenPOWER on IntegriCloud