Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'python/src/tcf/services/remote')
-rw-r--r--python/src/tcf/services/remote/ContextQueryProxy.py7
-rw-r--r--python/src/tcf/services/remote/DiagnosticsProxy.py7
-rw-r--r--python/src/tcf/services/remote/DisassemblyProxy.py4
-rw-r--r--python/src/tcf/services/remote/ExpressionsProxy.py3
-rw-r--r--python/src/tcf/services/remote/FileSystemProxy.py15
-rw-r--r--python/src/tcf/services/remote/LineNumbersProxy.py19
-rw-r--r--python/src/tcf/services/remote/LocatorProxy.py4
-rw-r--r--python/src/tcf/services/remote/MemoryMapProxy.py4
-rw-r--r--python/src/tcf/services/remote/MemoryProxy.py25
-rw-r--r--python/src/tcf/services/remote/PathMapProxy.py4
-rw-r--r--python/src/tcf/services/remote/ProcessesProxy.py6
-rw-r--r--python/src/tcf/services/remote/ProcessesV1Proxy.py22
-rw-r--r--python/src/tcf/services/remote/RunControlProxy.py5
-rw-r--r--python/src/tcf/services/remote/StackTraceProxy.py32
-rw-r--r--python/src/tcf/services/remote/SymbolsProxy.py13
15 files changed, 114 insertions, 56 deletions
diff --git a/python/src/tcf/services/remote/ContextQueryProxy.py b/python/src/tcf/services/remote/ContextQueryProxy.py
index a9a08dbaf..c8a7588a6 100644
--- a/python/src/tcf/services/remote/ContextQueryProxy.py
+++ b/python/src/tcf/services/remote/ContextQueryProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2012-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2012-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -45,9 +45,8 @@ class ContextQueryProxy(contextquery.ContextQueryService):
def __init__(self):
super(GetAttrNamesCommand, self).__init__(service.channel,
- service,
- "getAttrNames",
- None)
+ service,
+ "getAttrNames", None)
def done(self, error, args):
res = None
diff --git a/python/src/tcf/services/remote/DiagnosticsProxy.py b/python/src/tcf/services/remote/DiagnosticsProxy.py
index dd7fb4132..31e506d79 100644
--- a/python/src/tcf/services/remote/DiagnosticsProxy.py
+++ b/python/src/tcf/services/remote/DiagnosticsProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -58,10 +58,13 @@ class DiagnosticsProxy(diagnostics.DiagnosticsService):
if isinstance(err, errors.ErrorReport):
errMap = err.getAttributes()
else:
+ # Exception.message does not exist in python3, better use
+ # str(Exception)
+
errMap = {
errors.ERROR_TIME: int(time.time() * 1000),
errors.ERROR_CODE: errors.TCF_ERROR_OTHER,
- errors.ERROR_FORMAT: err.message
+ errors.ERROR_FORMAT: str(err)
}
done = self._makeCallback(done)
service = self
diff --git a/python/src/tcf/services/remote/DisassemblyProxy.py b/python/src/tcf/services/remote/DisassemblyProxy.py
index 123757a9d..94c30af60 100644
--- a/python/src/tcf/services/remote/DisassemblyProxy.py
+++ b/python/src/tcf/services/remote/DisassemblyProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -65,7 +65,7 @@ class DisassemblyProxy(disassembly.DisassemblyService):
def _toDisassemblyArray(o):
if o is None:
return None
- return map(_toDisassemblyLine, o)
+ return list(map(_toDisassemblyLine, o))
def _toDisassemblyLine(m):
diff --git a/python/src/tcf/services/remote/ExpressionsProxy.py b/python/src/tcf/services/remote/ExpressionsProxy.py
index 4d21ca895..953fdf8ec 100644
--- a/python/src/tcf/services/remote/ExpressionsProxy.py
+++ b/python/src/tcf/services/remote/ExpressionsProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -85,6 +85,7 @@ class ExpressionsProxy(expressions.ExpressionsService):
def done(self, error, args):
value = None
+ props = {}
if not error:
assert len(args) == 3
value = channel.toByteArray(args[0])
diff --git a/python/src/tcf/services/remote/FileSystemProxy.py b/python/src/tcf/services/remote/FileSystemProxy.py
index 69b4d8eb6..08c97cf28 100644
--- a/python/src/tcf/services/remote/FileSystemProxy.py
+++ b/python/src/tcf/services/remote/FileSystemProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -54,10 +54,10 @@ class FileSystemCommand(Command):
if len(cmd) > 72:
cmd = cmd[0:72] + "..."
s = Status(error_code,
- "TCF command exception:" +
- "\nCommand: " + cmd +
- "\nException: " + errors.toErrorString(data) +
- "\nError code: " + str(error_code), data)
+ "TCF command exception:" +
+ "\nCommand: " + cmd +
+ "\nException: " + errors.toErrorString(data) +
+ "\nError code: " + str(error_code), data)
caused_by = data.get(errors.ERROR_CAUSED_BY)
if caused_by is not None:
s.initCause(self.toError(caused_by, False))
@@ -480,8 +480,9 @@ class FileSystemProxy(filesystem.FileSystemService):
class CopyCommand(FileSystemCommand):
def __init__(self):
- super(CopyCommand, self).__init__(service, "copy",
- (src_path, dst_path, copy_permissions, copy_uidgid))
+ copyparams = (src_path, dst_path, copy_permissions,
+ copy_uidgid)
+ super(CopyCommand, self).__init__(service, "copy", copyparams)
def done(self, error, args):
s = None
diff --git a/python/src/tcf/services/remote/LineNumbersProxy.py b/python/src/tcf/services/remote/LineNumbersProxy.py
index 5436bd695..86808c6d7 100644
--- a/python/src/tcf/services/remote/LineNumbersProxy.py
+++ b/python/src/tcf/services/remote/LineNumbersProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -69,10 +69,15 @@ def _toCodeAreaArray(o):
directory = area.get("Dir", directory)
filePath = area.get("File", filePath)
arr.append(linenumbers.CodeArea(directory, filePath,
- area.get("SLine", 0), area.get("SCol", 0),
- area.get("ELine", 0), area.get("ECol", 0),
- area.get("SAddr"), area.get("EAddr"),
- area.get("ISA", 0),
- area.get("IsStmt"), area.get("BasicBlock"),
- area.get("PrologueEnd"), area.get("EpilogueBegin")))
+ area.get("SLine", 0),
+ area.get("SCol", 0),
+ area.get("ELine", 0),
+ area.get("ECol", 0),
+ area.get("SAddr"),
+ area.get("EAddr"),
+ area.get("ISA", 0),
+ area.get("IsStmt"),
+ area.get("BasicBlock"),
+ area.get("PrologueEnd"),
+ area.get("EpilogueBegin")))
return arr
diff --git a/python/src/tcf/services/remote/LocatorProxy.py b/python/src/tcf/services/remote/LocatorProxy.py
index 3fbacd340..d5b5c4159 100644
--- a/python/src/tcf/services/remote/LocatorProxy.py
+++ b/python/src/tcf/services/remote/LocatorProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -155,7 +155,7 @@ class LocatorProxy(locator.LocatorService):
try:
l.peerRemoved(peerId)
except Exception as x:
- protocol.log("Unhandled exception in "\
+ protocol.log("Unhandled exception in "
"Locator listener", x)
assert len(service.peers) == 0
diff --git a/python/src/tcf/services/remote/MemoryMapProxy.py b/python/src/tcf/services/remote/MemoryMapProxy.py
index 76ed14f50..81fc3f72f 100644
--- a/python/src/tcf/services/remote/MemoryMapProxy.py
+++ b/python/src/tcf/services/remote/MemoryMapProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -90,7 +90,7 @@ class ChannelEventListener(channel.EventListener):
def _toMemoryMap(o):
if o is None:
return None
- return map(_toMemoryRegion, o)
+ return list(map(_toMemoryRegion, o))
def _toMemoryRegion(o):
diff --git a/python/src/tcf/services/remote/MemoryProxy.py b/python/src/tcf/services/remote/MemoryProxy.py
index fdc51bd7a..4a2f10852 100644
--- a/python/src/tcf/services/remote/MemoryProxy.py
+++ b/python/src/tcf/services/remote/MemoryProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -20,6 +20,9 @@ class Range(object):
stat = 0
msg = None
+ def __lt__(self, o):
+ return self.__cmp__(o) == -1
+
def __cmp__(self, o):
if self.offs < o.offs:
return -1
@@ -59,7 +62,7 @@ class MemoryErrorReport(errors.ErrorReport, memory.MemoryError,
l = 0
h = len(self.ranges) - 1
while l <= h:
- n = (l + h) / 2
+ n = int((l + h) / 2)
r = self.ranges[n]
if r.offs > offset:
h = n - 1
@@ -75,7 +78,7 @@ class MemoryErrorReport(errors.ErrorReport, memory.MemoryError,
l = 0
h = len(self.ranges) - 1
while l <= h:
- n = (l + h) / 2
+ n = int((l + h) / 2)
r = self.ranges[n]
if r.offs > offset:
h = n - 1
@@ -105,7 +108,9 @@ class MemContext(memory.MemoryContext):
def done(self, error, args):
e = None
if error:
- e = memory.MemoryError(error.message)
+ # XXX : fle : Exception.message does not exist in python3,
+ # better use str(Exception)
+ e = memory.MemoryError(str(error))
else:
assert len(args) == 2
e = self.toMemoryError(addr, args[0], args[1])
@@ -126,7 +131,9 @@ class MemContext(memory.MemoryContext):
def done(self, error, args):
e = None
if error:
- e = memory.MemoryError(error.message)
+ # Exception.message does not exist in python3, better use
+ # str(Exception)
+ e = memory.MemoryError(str(error))
else:
assert len(args) == 3
byts = channel.toByteArray(args[0])
@@ -152,7 +159,9 @@ class MemContext(memory.MemoryContext):
def done(self, error, args):
e = None
if error:
- e = memory.MemoryError(error.message)
+ # XXX : fle : Exception.message does not exist in python3,
+ # better use str(Exception)
+ e = memory.MemoryError(str(error))
else:
assert len(args) == 2
e = self.toMemoryError(addr, args[0], args[1])
@@ -282,10 +291,10 @@ def _toContextArray(svc, o):
def _toSizeArray(o):
if o is None:
return None
- return map(lambda m: m.get("size", 0), o)
+ return [m.get("size", 0) for m in o]
def _toAddrArray(o):
if o is None:
return None
- return map(lambda m: m.get("addr"), o)
+ return [m.get("addr") for m in o]
diff --git a/python/src/tcf/services/remote/PathMapProxy.py b/python/src/tcf/services/remote/PathMapProxy.py
index 42da055f3..b2717cdb3 100644
--- a/python/src/tcf/services/remote/PathMapProxy.py
+++ b/python/src/tcf/services/remote/PathMapProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -88,7 +88,7 @@ class PathMapProxy(pathmap.PathMapService):
def _toPathMap(o):
if o is None:
return None
- return map(_toPathMapRule, o)
+ return list(map(_toPathMapRule, o))
def _toPathMapRule(o):
diff --git a/python/src/tcf/services/remote/ProcessesProxy.py b/python/src/tcf/services/remote/ProcessesProxy.py
index c4fbc901b..80bb9b215 100644
--- a/python/src/tcf/services/remote/ProcessesProxy.py
+++ b/python/src/tcf/services/remote/ProcessesProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ class ProcessContext(processes.ProcessContext):
class _Command(Command):
def __init__(self):
super(_Command, self).__init__(service.channel, service,
- command, (contextID,))
+ command, (contextID,))
def done(self, error, args):
if not error:
@@ -248,7 +248,7 @@ def _toEnvStringArray(envVars):
arr = []
if not envVars:
return arr
- for name, value in envVars.items():
+ for name, value in list(envVars.items()):
arr.append("%s=%s" % (name, value))
return arr
diff --git a/python/src/tcf/services/remote/ProcessesV1Proxy.py b/python/src/tcf/services/remote/ProcessesV1Proxy.py
index 2eab77963..b88431966 100644
--- a/python/src/tcf/services/remote/ProcessesV1Proxy.py
+++ b/python/src/tcf/services/remote/ProcessesV1Proxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -47,16 +47,24 @@ class ProcessesV1Proxy(ProcessesProxy.ProcessesProxy,
class GetCapabilitiesCommand(Command):
def __init__(self):
- super(GetCapabilitiesCommand,
- self).__init__(service.channel, service,
- "getCapabilities", (contextId,))
+ super(GetCapabilitiesCommand, self).__init__(service.channel,
+ service,
+ "getCapabilities",
+ (contextId,))
def done(self, error, args):
capabilityData = None
if not error:
- assert len(args) == 2
- error = self.toError(args[0])
- capabilityData = args[1]
+ # Defect WB4-1784, getting capabilities with a null
+ # context ID does not return the global system capabilities
+ # as it should
+ if len(args) == 1:
+ error = self.toError(args[0])
+ capabilityData = {}
+ else:
+ assert len(args) == 2
+ error = self.toError(args[0])
+ capabilityData = args[1]
done.doneGetCapabilities(self.token, error, capabilityData)
diff --git a/python/src/tcf/services/remote/RunControlProxy.py b/python/src/tcf/services/remote/RunControlProxy.py
index 7675a129c..72a5db284 100644
--- a/python/src/tcf/services/remote/RunControlProxy.py
+++ b/python/src/tcf/services/remote/RunControlProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013-2014 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013-2014, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -134,6 +134,9 @@ class ChannelEventListener(channel.EventListener):
elif name == "containerResumed":
assert len(args) == 1
self.listener.containerResumed(args[0])
+ elif name == "contextStateChanged":
+ assert len(args) == 1
+ self.listener.contextStateChanged(args[0])
else:
raise IOError("RunControl service: unknown event: " + name)
except Exception as x:
diff --git a/python/src/tcf/services/remote/StackTraceProxy.py b/python/src/tcf/services/remote/StackTraceProxy.py
index 843cf1e8c..6375ecdd7 100644
--- a/python/src/tcf/services/remote/StackTraceProxy.py
+++ b/python/src/tcf/services/remote/StackTraceProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2015-2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -29,14 +29,38 @@ class StackTraceProxy(stacktrace.StackTraceService):
(parent_context_id,))
def done(self, error, args):
- contexts = None
+ contextIds = None
if not error:
assert len(args) == 2
error = self.toError(args[0])
- contexts = args[1]
- done.doneGetChildren(self.token, error, contexts)
+ contextIds = args[1]
+ done.doneGetChildren(self.token, error, contextIds)
return GetChildrenCommand().token
+ def getChildrenRange(self, parent_context_id, range_start, range_end,
+ done):
+ done = self._makeCallback(done)
+ service = self
+
+ class GetChildrenRangeCommand(Command):
+ def __init__(self):
+ super(GetChildrenRangeCommand, self).__init__(
+ service.channel,
+ service,
+ "getChildrenRange",
+ (parent_context_id,
+ range_start,
+ range_end,))
+
+ def done(self, error, args):
+ contextIds = None
+ if not error:
+ assert len(args) == 2
+ error = self.toError(args[0])
+ contextIds = args[1]
+ done.doneGetChildren(self.token, error, contextIds)
+ return GetChildrenRangeCommand().token
+
def getContext(self, ids, done):
done = self._makeCallback(done)
service = self
diff --git a/python/src/tcf/services/remote/SymbolsProxy.py b/python/src/tcf/services/remote/SymbolsProxy.py
index bce60ac0b..42757105f 100644
--- a/python/src/tcf/services/remote/SymbolsProxy.py
+++ b/python/src/tcf/services/remote/SymbolsProxy.py
@@ -1,5 +1,5 @@
# *****************************************************************************
-# * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+# * Copyright (c) 2011, 2013, 2016 Wind River Systems, Inc. and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -14,11 +14,16 @@ from ... import channel
from ...channel.Command import Command
-class Context(symbols.Symbol):
+class SymbolWithValue(symbols.Symbol):
def __init__(self, props):
- super(Context, self).__init__(props)
+ super(SymbolWithValue, self).__init__(props)
self.value = channel.toByteArray(props.get(symbols.PROP_VALUE))
+ def __str__(self):
+ res = symbols.Symbol.__str__(self).rstrip(']')
+ res += ', value=' + str(self.value) + ']'
+ return res
+
def getValue(self):
return self.value
@@ -44,7 +49,7 @@ class SymbolsProxy(symbols.SymbolsService):
assert len(args) == 2
error = self.toError(args[0])
if args[1]:
- ctx = Context(args[1])
+ ctx = SymbolWithValue(args[1])
done.doneGetContext(self.token, error, ctx)
return GetContextCommand().token

Back to the top