Get trace_regblock_size from metadata instead of event
In ctf trace, for each 'R' block, we save it as a "register" event,
as defined below in metadata.
event {
name = "register";
id = 0;
fields := struct {
ascii contents[440];
};
}
Nowadays, we initialize trace_regblock_size by getting the length of
"contents" from a "register" event. However, 'R' block may not exist
in traceframe, as a result, "register" event doesn't exist in trace file
and trace_regblock_size isn't set.
This patch changes to get trace_regblock_size from metadata (or declaration)
which always exists.
gdb:
2014-04-19 Yao Qi <yao@codesourcery.com>
* ctf.c (handle_id): New static variable.
(ctf_open_dir): Get handle_id from bt_context_add_trace return
value. Get the declaration of event "register" and get length
of field "contents".