Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Leger2012-09-24 14:45:02 +0000
committerAnton Leherbauer2012-09-24 14:45:02 +0000
commit9b59f7ed4b5292f49c9e244d17365acf601d3c4f (patch)
treeb40ea338961254516fa79418622d9f4f6629580e /python/src/tcf/services/disassembly.py
parent40e77cd79e5344d6cab49acdc7808de9434668ed (diff)
downloadorg.eclipse.tcf-9b59f7ed4b5292f49c9e244d17365acf601d3c4f.tar.gz
org.eclipse.tcf-9b59f7ed4b5292f49c9e244d17365acf601d3c4f.tar.xz
org.eclipse.tcf-9b59f7ed4b5292f49c9e244d17365acf601d3c4f.zip
TCF Python: Bug 390178 - Missing APIs/properties in python services
interfaces and proxies
Diffstat (limited to 'python/src/tcf/services/disassembly.py')
-rw-r--r--python/src/tcf/services/disassembly.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/python/src/tcf/services/disassembly.py b/python/src/tcf/services/disassembly.py
index f5260c3b5..6b03340ad 100644
--- a/python/src/tcf/services/disassembly.py
+++ b/python/src/tcf/services/disassembly.py
@@ -1,5 +1,5 @@
-# *******************************************************************************
-# * Copyright (c) 2011 Wind River Systems, Inc. and others.
+# *****************************************************************************
+# * Copyright (c) 2011, 2012 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,7 +7,7 @@
# *
# * Contributors:
# * Wind River Systems - initial API and implementation
-# *******************************************************************************
+# *****************************************************************************
"""
TCF Disassembly service interface.
@@ -34,7 +34,8 @@ FIELD_TYPE = "Type"
# Value of the field for "String" and "Register" types, String.
FIELD_TEXT = "Text"
-# Value of the field for "Address," "Displacement," or "Immediate" types, Number.
+# Value of the field for "Address," "Displacement," or "Immediate" types,
+# Number.
FIELD_VALUE = "Value"
# Context ID of the address space used with "Address" types, String.
@@ -55,7 +56,8 @@ class DisassemblyService(services.Service):
def getCapabilities(self, context_id, done):
"""
Retrieve disassembly service capabilities a given context-id.
- @param context_id - a context ID, usually one returned by Run Control or Memory services.
+ @param context_id - a context ID, usually one returned by Run Control
+ or Memory services.
@param done - command result call back object.
@return - pending command handle.
"""
@@ -63,11 +65,14 @@ class DisassemblyService(services.Service):
def disassemble(self, context_id, addr, size, params, done):
"""
- Disassemble instruction code from a specified range of memory addresses, in a specified context.
- @param context_id - a context ID, usually one returned by Run Control or Memory services.
+ Disassemble instruction code from a specified range of memory
+ addresses, in a specified context.
+ @param context_id - a context ID, usually one returned by Run Control
+ or Memory services.
@param addr - address of first instruction to disassemble.
@param size - size in bytes of the address range.
- @param params - properties to control the disassembly output, an element of capabilities array, see getCapabilities.
+ @param params - properties to control the disassembly output, an
+ element of capabilities array, see getCapabilities.
@param done - command result call back object.
@return - pending command handle.
"""
@@ -82,10 +87,12 @@ class DoneGetCapabilities(object):
Called when capabilities retrieval is done.
@param token - command handle.
@param error - error object or None.
- @param capabilities - array of capabilities, see CAPABILITY_* for contents of each array element.
+ @param capabilities - array of capabilities, see CAPABILITY_* for
+ contents of each array element.
"""
pass
+
class DoneDisassemble(object):
"""
Call back interface for 'disassemble' command.
@@ -99,14 +106,16 @@ class DoneDisassemble(object):
"""
pass
+
class DisassemblyLine(object):
"""
Represents a single disassembly line.
"""
- def __init__(self, addr, size, instruction):
+ def __init__(self, addr, size, instruction, opcode=None):
self.addr = addr
self.size = size or 0
self.instruction = instruction
+ self.opcode = opcode
def getAddress(self):
"""
@@ -114,6 +123,12 @@ class DisassemblyLine(object):
"""
return self.addr
+ def getOpcodeValue(self):
+ """
+ @return instruction address.
+ """
+ return self.opcode
+
def getSize(self):
"""
@return instruction size in bytes.
@@ -122,7 +137,8 @@ class DisassemblyLine(object):
def getInstruction(self):
"""
- @return array of instruction fields, each field is a collection of field properties, see FIELD_*.
+ @return array of instruction fields, each field is a collection of
+ field properties, see FIELD_*.
"""
return self.instruction

Back to the top