From patchwork Fri Jul 22 15:33:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 13927 Received: (qmail 92146 invoked by alias); 22 Jul 2016 15:33:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 91923 invoked by uid 89); 22 Jul 2016 15:33:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=tcs X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 22 Jul 2016 15:33:32 +0000 Received: by mail-pf0-f196.google.com with SMTP id y134so7450983pfg.3 for ; Fri, 22 Jul 2016 08:33:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=5z/q/i2P1OZLZ5IbYiuBedYt8RwLQ1OALvjn9gFKEAc=; b=XjPeQWyQPCQ/15BZtxVEMJzaYSeOiameOJ9NcLykG0aUelhWW0LJuiH8YOAi/yC8qJ 7wqmkS2sF5ZYYT14OPlmn2+L0Zqrl1pz5VF9b30Jq+mKYNKuiZjafHmwKs5GvP6AFUIU VQqpZTVYpIuVixw6PXnIAzYlXggIsOlpfJl3KwcNAco6Su9qqRVODZBdPtJKSRIeym1s bmiuTmmhrXC3B0u2Y7fXwMqndUeAzk0KJyEgYGccjtrIC+KVAKPRI7AG0LIjrfGSHyum ZKXuK499rTkzSP5JvXmQLEaJYWquRasiH7HqWOkBNyyUNGV8fVEFex/O2GinBj4Vlmta Titw== X-Gm-Message-State: AEkoouvpfbiyKduxhZeCqKrhzGEQptkYE3jl6lDzCp87OvowpIyHoqjOqu1Ykwa/Z6f7tA== X-Received: by 10.98.63.154 with SMTP id z26mr7413180pfj.41.1469201610599; Fri, 22 Jul 2016 08:33:30 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y6sm20980807pav.1.2016.07.22.08.33.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jul 2016 08:33:30 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH committed] Get "num" as unsigned in ctf Date: Fri, 22 Jul 2016 16:33:19 +0100 Message-Id: <1469201599-1177-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes 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 * ctf.c (ctf_traceframe_info): Call bt_ctf_get_uint64 rather than bt_ctf_get_int64. --- gdb/ChangeLog | 5 +++++ gdb/ctf.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4a58535..f088912 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-07-22 Yao Qi + + * ctf.c (ctf_traceframe_info): Call bt_ctf_get_uint64 rather than + bt_ctf_get_int64. + 2016-07-21 Tom Tromey * rust-lang.c (rust_tuple_struct_type_p): Return false for empty 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