Commit 2a676664 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

data trace: support for variable address (instead of name) added

parent 5fae957f
...@@ -510,17 +510,22 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id): ...@@ -510,17 +510,22 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id):
dwtconfs = dbgconf.xpath('d:dataTraceConf', namespaces=ns) dwtconfs = dbgconf.xpath('d:dataTraceConf', namespaces=ns)
for dwtconf in dwtconfs: for dwtconf in dwtconfs:
var = dwtconf.xpath('d:variable', namespaces=ns)[0].text.strip() var = dwtconf.xpath('d:variable', namespaces=ns)[0].text.strip()
# convert variable name to address # check if variable field already contains an address
obskey = int(float(obsids[0])) if var.startswith("0x"):
if obskey in symtable: varaddr = var
if var in symtable[obskey]: else:
logger.debug("Variable %s replaced by address 0x%x." % (var, symtable[obskey][var][0])) # convert variable name to address
varaddr = "0x%x" % symtable[obskey][var][0] obskey = int(float(obsids[0]))
if obskey in symtable:
if var in symtable[obskey]:
logger.debug("Variable %s replaced by address 0x%x." % (var, symtable[obskey][var][0]))
varaddr = "0x%x" % symtable[obskey][var][0]
else:
logger.warning("Variable %s not found in symbol table." % var)
continue
else: else:
logger.warning("Variable %s not found in symbol table." % var) logger.warning("Key %u not found in symbol table." % (obskey))
continue continue
else:
logger.debug("Key %u not found in symbol table." % (obskey))
mode = dwtconf.xpath('d:mode', namespaces=ns)[0].text.strip() mode = dwtconf.xpath('d:mode', namespaces=ns)[0].text.strip()
xmlblock += "\t<dataTraceConf>\n\t\t<variable>%s</variable>\n\t\t<varName>%s</varName>\n\t\t<mode>%s</mode>\n\t</dataTraceConf>\n" % (varaddr, var, mode) xmlblock += "\t<dataTraceConf>\n\t\t<variable>%s</variable>\n\t\t<varName>%s</varName>\n\t\t<mode>%s</mode>\n\t</dataTraceConf>\n" % (varaddr, var, mode)
xmlblock += "</obsDebugConf>\n\n" xmlblock += "</obsDebugConf>\n\n"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment