aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-09 23:22:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-09 23:22:08 +0000
commit34983d5f8fbdced8f38d61a933ce32aff3e0886c (patch)
treedfc2efcdee76e9b5f5f0e1cb8caa4da04bc60def /utils
parenta18e70b25c85d7e653e642b5e6e58d6063af3d83 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/ClangDataFormat.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/ClangDataFormat.py b/utils/ClangDataFormat.py
index a80f0b579f..38ef76b325 100644
--- a/utils/ClangDataFormat.py
+++ b/utils/ClangDataFormat.py
@@ -39,6 +39,7 @@ class SourceLocation(object):
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 @@ class SourceLocation(object):
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 @@ class SourceLocation(object):
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 @@ def findObject(typename, frame):
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()