aboutsummaryrefslogtreecommitdiff
path: root/gdb/ctf.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-07-22 16:31:41 +0100
committerYao Qi <yao.qi@linaro.org>2016-07-22 16:31:41 +0100
commiteed2386e45968fa4fee8d093895f4789044fb077 (patch)
tree188a322bab2da999793261c94f79552a33082246 /gdb/ctf.c
parentc02d11a585398734a2178d65a17411cd3050b9d2 (diff)
downloadgdb-eed2386e45968fa4fee8d093895f4789044fb077.zip
gdb-eed2386e45968fa4fee8d093895f4789044fb077.tar.gz
gdb-eed2386e45968fa4fee8d093895f4789044fb077.tar.bz2
Get "num" as unsigned in ctf
I see the following fail due to the warning, -trace-frame-collected^M [warning] Extracting signed value from an unsigned int (num)^M .... FAIL: gdb.trace/mi-trace-frame-collected.exp: ctf: -trace-frame-collected In ctf metadata, "num" in "tsv" is defined as unint32_t, ctf_save_write_metadata (&writer->tcs, "event {\n\tname = \"tsv\";\n\tid = %u;\n" "\tfields := struct { \n" "\t\tuint64_t val;\n" "\t\tuint32_t num;\n" "\t};\n" "};\n", CTF_EVENT_ID_TSV); so we should read it as unsigned. The patch below fixes the fail by changing to bt_ctf_get_uint64. gdb: 2016-07-22 Yao Qi <yao.qi@linaro.org> * ctf.c (ctf_traceframe_info): Call bt_ctf_get_uint64 rather than bt_ctf_get_int64.
Diffstat (limited to 'gdb/ctf.c')
-rw-r--r--gdb/ctf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 795c365..0e13cc1 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1692,7 +1692,7 @@ ctf_traceframe_info (struct target_ops *self)
const struct bt_definition *def;
def = bt_ctf_get_field (event, scope, "num");
- vnum = (int) bt_ctf_get_int64 (def);
+ vnum = (int) bt_ctf_get_uint64 (def);
VEC_safe_push (int, info->tvars, vnum);
}
else