[lldb] Fix Microsoft guard variable detection
authorRaphael Isemann <teemperor@gmail.com>
Tue, 13 Aug 2019 14:13:39 +0000 (14:13 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 13 Aug 2019 14:13:39 +0000 (14:13 +0000)
Apparently we need to check for a suffix, not a prefix. This broke
probably broke expression evaluation on Windows.

llvm-svn: 368695

lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

index 20049e0..b266b55 100644 (file)
@@ -160,7 +160,7 @@ static bool isGuardVariableSymbol(llvm::StringRef mangled_symbol,
                                   bool check_ms_abi = true) {
   bool result = mangled_symbol.startswith("_ZGV"); // Itanium ABI guard variable
   if (check_ms_abi)
-    result |= mangled_symbol.startswith("@4IA"); // Microsoft ABI
+    result |= mangled_symbol.endswith("@4IA"); // Microsoft ABI
   return result;
 }