go/xenlight: More informative error messages
authorGeorge Dunlap <george.dunlap@citrix.com>
Thu, 26 Dec 2019 14:45:08 +0000 (14:45 +0000)
committerGeorge Dunlap <george.dunlap@citrix.com>
Tue, 21 Jan 2020 17:48:24 +0000 (17:48 +0000)
commitb16f51ea8a59d85cf424494d8e9648df6c93d365
treefcc725b7f55415dac2e272853400ec91777f0d33
parent084974fe715399ba9b4f60be3420f15c68cbfe59
go/xenlight: More informative error messages

If an error is encountered deep in a complicated data structure, it's
often difficult to tell where the error actually is.  Make the error
message from the generated toC() and fromC() structures more
informative by tagging which field being converted encountered the
error.  This will have the effect of giving a "stack trace" of the
failure inside a nested data structure.

NB that my version of python insists on reordering a couple of switch
statements for some reason; In other patches I've reverted those
changes, but in this case it's more difficult because they interact
with actual code changes.  I'll leave this here for now, as we're
going to remove helpers.gen.go from being tracked by git at some point
in the near future anyway.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Nick Rosbrook <rosbrookn@ainfosec.com>
tools/golang/xenlight/gengotypes.py
tools/golang/xenlight/helpers.gen.go