Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleherbau2011-04-14 13:40:35 +0000
committeraleherbau2011-04-14 13:40:35 +0000
commit618190ae534579d7fede94199bddb5518da5ab7a (patch)
treec318f47e7495fb85492499a84df67560e1a701d5 /python/src/tcf/tests
parent7ddd3c7a9e6f16da5e97eef2ca9485045ae938b7 (diff)
downloadorg.eclipse.tcf-618190ae534579d7fede94199bddb5518da5ab7a.tar.gz
org.eclipse.tcf-618190ae534579d7fede94199bddb5518da5ab7a.tar.xz
org.eclipse.tcf-618190ae534579d7fede94199bddb5518da5ab7a.zip
TCF Python: Added LineNumbers and Processes service proxies
Diffstat (limited to 'python/src/tcf/tests')
-rw-r--r--python/src/tcf/tests/BasicTests.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/python/src/tcf/tests/BasicTests.py b/python/src/tcf/tests/BasicTests.py
index acddf6a9f..24bb022cb 100644
--- a/python/src/tcf/tests/BasicTests.py
+++ b/python/src/tcf/tests/BasicTests.py
@@ -45,9 +45,11 @@ def test():
testSymbols(c)
testRegisters(c)
testExpressions(c)
+ testLineNumbers(c)
testSyncCommands(c)
testEvents(c)
testDataCache(c)
+ testProcesses(c)
except exceptions.Exception as e:
protocol.log(e)
@@ -237,6 +239,7 @@ def testSymbols(c):
protocol.invokeLater(symTest, ctx_id)
def testRegisters(c):
+ if not _suspended: return
from tcf.services import registers
lock = threading.Condition()
def regTest(ctx_id):
@@ -306,6 +309,22 @@ def testExpressions(c):
print e.get(expressions.PROP_EXPRESSION), "=", val
exprs.dispose(id)
+def testLineNumbers(c):
+ if not _suspended: return
+ from tcf.services import linenumbers
+ from tcf.services import stacktrace
+ ctl = sync.CommandControl(c)
+ stack = ctl.StackTrace
+ lineNumbers = ctl.LineNumbers
+ for ctx_id in _suspended:
+ bt = stack.getChildren(ctx_id).get()
+ if bt:
+ bt = stack.getContext(bt).get()
+ for frame in bt:
+ addr = frame.get(stacktrace.PROP_INSTRUCTION_ADDRESS)
+ area = lineNumbers.mapToSource(ctx_id, addr, addr+1).get()
+ print "Frame %d - CodeArea: %s" % (frame.get(stacktrace.PROP_LEVEL), area)
+
def testSyncCommands(c):
# simplified command execution
ctl = sync.CommandControl(c)
@@ -378,5 +397,20 @@ def testDataCache(c):
print "ContextsCache is valid:", contextsCache.getData()
protocol.invokeLater(contextsCache.validate, done)
+def testProcesses(c):
+ from tcf.services import processes
+ def processTest():
+ proc = c.getRemoteService(processes.NAME)
+ if not proc:
+ return
+ class DoneGetChildren(processes.DoneGetChildren):
+ def doneGetChildren(self, token, error, context_ids):
+ if error:
+ protocol.log("Error from Processes.GetChildren", error)
+ else:
+ print "Processes:", context_ids
+ proc.getChildren(None, DoneGetChildren())
+ protocol.invokeLater(processTest)
+
if __name__ == '__main__':
test()

Back to the top