From: Philippe Proulx Date: Sat, 8 Nov 2014 04:01:24 +0000 (-0500) Subject: Fix: actually write inner struct offsets X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=3e9291503aea2e05b7f8547a228a460879193e66;p=deliverable%2Fbarectf.git Fix: actually write inner struct offsets --- diff --git a/barectf/cli.py b/barectf/cli.py index 3a1c637..39f6626 100644 --- a/barectf/cli.py +++ b/barectf/cli.py @@ -697,7 +697,8 @@ def _struct_to_c_lines(doc, struct): # as many offset as there are child fields because a future # sequence could refer to any of those fields for lname, offset in offset_vars.items(): - line = 'uint32_t off_{}_{}'.format(fname, lname, _CTX_AT); + fmt = 'uint32_t off_{}_{} = {} + {};' + line = fmt.format(fname, lname, _CTX_AT, offset); lines.append(_CLine(line)) else: # offset of this simple field is the current bit index