diff options
Diffstat (limited to 'python/src/tcf/services/remote/LineNumbersProxy.py')
-rw-r--r-- | python/src/tcf/services/remote/LineNumbersProxy.py | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/python/src/tcf/services/remote/LineNumbersProxy.py b/python/src/tcf/services/remote/LineNumbersProxy.py index 7452cc761..5436bd695 100644 --- a/python/src/tcf/services/remote/LineNumbersProxy.py +++ b/python/src/tcf/services/remote/LineNumbersProxy.py @@ -1,5 +1,5 @@ -# ******************************************************************************* -# * Copyright (c) 2011 Wind River Systems, Inc. and others. +# ***************************************************************************** +# * Copyright (c) 2011, 2013 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 @@ -7,23 +7,28 @@ # * # * Contributors: # * Wind River Systems - initial API and implementation -# ******************************************************************************* +# ***************************************************************************** + +from .. import linenumbers +from ...channel.Command import Command -from tcf.services import linenumbers -from tcf.channel.Command import Command class LineNumbersProxy(linenumbers.LineNumbersService): def __init__(self, channel): self.channel = channel - def mapToSource(self, context_id, start_address, end_address, done): + def mapToSource(self, context_id, start_address, end_address, done): done = self._makeCallback(done) service = self + class MapCommand(Command): def __init__(self): super(MapCommand, self).__init__(service.channel, service, - "mapToSource", (context_id, start_address, end_address)) + "mapToSource", + (context_id, start_address, + end_address)) + def done(self, error, args): arr = None if not error: @@ -33,13 +38,17 @@ class LineNumbersProxy(linenumbers.LineNumbersService): done.doneMapToSource(self.token, error, arr) return MapCommand().token - def mapToMemory(self, context_id, file, line, column, done): + def mapToMemory(self, context_id, filePath, line, column, done): done = self._makeCallback(done) service = self + class MapCommand(Command): def __init__(self): super(MapCommand, self).__init__(service.channel, service, - "mapToMemory", (context_id, file, line, column)) + "mapToMemory", + (context_id, filePath, line, + column)) + def done(self, error, args): arr = None if not error: @@ -49,15 +58,17 @@ class LineNumbersProxy(linenumbers.LineNumbersService): done.doneMapToMemory(self.token, error, arr) return MapCommand().token + def _toCodeAreaArray(o): - if not o: return None + if not o: + return None arr = [] directory = None - file = None + filePath = None for area in o: directory = area.get("Dir", directory) - file = area.get("File", file) - arr.append(linenumbers.CodeArea(directory, file, + 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"), |