[cfe-commits] r172017 - /cfe/trunk/utils/ClangDataFormat.py
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jan 9 15:22:08 PST 2013
Author: akirtzidis
Date: Wed Jan 9 17:22:08 2013
New Revision: 172017
URL: http://llvm.org/viewvc/llvm-project?rev=172017&view=rev
Log:
[utils/ClangDataFormat.py] Don't use lldb.frame directly, get the frame from the value.
Some lldb changes made lldb.frame not set until a script is invoked, which made the
formatters not working after a restart.
Modified:
cfe/trunk/utils/ClangDataFormat.py
Modified: cfe/trunk/utils/ClangDataFormat.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ClangDataFormat.py?rev=172017&r1=172016&r2=172017&view=diff
==============================================================================
--- cfe/trunk/utils/ClangDataFormat.py (original)
+++ cfe/trunk/utils/ClangDataFormat.py Wed Jan 9 17:22:08 2013
@@ -39,6 +39,7 @@
def __init__(self, srcloc):
self.srcloc = srcloc
self.ID = srcloc.GetChildAtIndex(0).GetValueAsUnsigned()
+ self.frame = srcloc.GetFrame()
def offset(self):
return getValueFromExpression(self.srcloc, ".getOffset()").GetValueAsUnsigned()
@@ -50,7 +51,7 @@
return getValueFromExpression(self.srcloc, ".isMacroID()").GetValueAsUnsigned()
def isLocal(self, srcmgr_path):
- return lldb.frame.EvaluateExpression("(%s).isLocalSourceLocation(%s)" % (srcmgr_path, getExpressionPath(self.srcloc))).GetValueAsUnsigned()
+ return self.frame.EvaluateExpression("(%s).isLocalSourceLocation(%s)" % (srcmgr_path, getExpressionPath(self.srcloc))).GetValueAsUnsigned()
def getPrint(self, srcmgr_path):
print_str = getValueFromExpression(self.srcloc, ".printToString(%s)" % srcmgr_path)
@@ -59,7 +60,7 @@
def summary(self):
if self.isInvalid():
return "<invalid loc>"
- srcmgr_path = findObjectExpressionPath("clang::SourceManager", lldb.frame)
+ srcmgr_path = findObjectExpressionPath("clang::SourceManager", self.frame)
if srcmgr_path:
return "%s (offset: %d, %s, %s)" % (self.getPrint(srcmgr_path), self.offset(), "macro" if self.isMacro() else "file", "local" if self.isLocal(srcmgr_path) else "loaded")
return "(offset: %d, %s)" % (self.offset(), "macro" if self.isMacro() else "file")
@@ -152,7 +153,7 @@
return found if not found.TypeIsPointerType() else found.Dereference()
def getValueFromExpression(val, expr):
- return lldb.frame.EvaluateExpression(getExpressionPath(val) + expr)
+ return val.GetFrame().EvaluateExpression(getExpressionPath(val) + expr)
def getExpressionPath(val):
stream = lldb.SBStream()
More information about the cfe-commits
mailing list