From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54997 invoked by alias); 3 Jun 2015 16:09:41 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 54962 invoked by uid 89); 3 Jun 2015 16:09:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailuogwhop.emc.com Received: from mailuogwhop.emc.com (HELO mailuogwhop.emc.com) (168.159.213.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 03 Jun 2015 16:09:38 +0000 Received: from maildlpprd06.lss.emc.com (maildlpprd06.lss.emc.com [10.253.24.38]) by mailuogwprd01.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t53G9YVK020561 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 3 Jun 2015 12:09:35 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd01.lss.emc.com t53G9YVK020561 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd01.lss.emc.com t53G9YVK020561 Received: from mailsyshubprd04.lss.emc.com (mailsyshubprd04.lss.emc.com [10.253.24.26]) by maildlpprd06.lss.emc.com (RSA Interceptor) for ; Wed, 3 Jun 2015 12:09:24 -0400 Received: from usendtaylorx2l.lss.emc.com (usendtaylorx2l.lss.emc.com [10.243.10.188]) by mailsyshubprd04.lss.emc.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.0) with ESMTP id t53G9Q2r030251 for ; Wed, 3 Jun 2015 12:09:26 -0400 From: David Taylor To: gdb@sourceware.org Subject: bitfields and tracepoints Date: Wed, 03 Jun 2015 16:09:00 -0000 Message-ID: <11969.1433347766@usendtaylorx2l.lss.emc.com> X-RSA-Classifications: DLM_1, public X-Sentrion-Hostname: mailuogwprd01.lss.emc.com X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00000.txt.bz2 In file gdb/value.c, function value_fetch_lazy, there is this comment: /* To read a lazy bitfield, read the entire enclosing value. This prevents reading the same block of (possibly volatile) memory once per bitfield. It would be even better to read only the containing word, but we have no way to record that just specific bits of a value have been fetched. */ This causes problems for tracepoints. At a tracepoint you can ask to collect a bit field. And GDB will send an expression to the remote target to collect the byte that contains the bitfield. When it comes time to view the collected data, it doesn't work -- the code right after the above comment tries to fetch the entire structure. Since we didn't ask for the entire structure to be collected -- just the part containing the bitfield -- it fails. But, if you compute the offset of the bitfield from the start of the structure and look there, you see that the value was correctly collected. Either the collect action needs to collect the entire structure since it is a bitfield (bleech!) or the value retrieval code needs to only require the bytes containing the bitfield.