From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6957 invoked by alias); 20 Oct 2010 10:28:26 -0000 Received: (qmail 6946 invoked by uid 22791); 20 Oct 2010 10:28:26 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Oct 2010 10:28:21 +0000 Received: (qmail 23921 invoked from network); 20 Oct 2010 10:28:19 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Oct 2010 10:28:19 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] tracepoint: fix tfile byte order issue Date: Wed, 20 Oct 2010 10:28:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Hui Zhu References: <201010191020.04495.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010201128.17479.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00315.txt.bz2 On Wednesday 20 October 2010 09:49:58, Hui Zhu wrote: > I make a new patch change to use target_gdbarch and use > extract_signed_integer in signed value. > > And I found that tfile_trace_find define the size of a frame to a int: > int data_size; > > But I found that gdbserver/tracepoint.c:struct traceframe: > unsigned int data_size : 32; > > So I change this int to unsigned int. Thanks. It appears the format description in gdb.texinfo doesn't make that explicit, but indeed all sizes should be unsigned. > @@ -3665,6 +3665,9 @@ tfile_get_traceframe_address (off_t tfra > perror_with_name (trace_filename); > else if (gotten < 2) > error (_("Premature end of file while reading trace file")); > + tpnum = (short) extract_signed_integer ((gdb_byte *)&tpnum, 2, > + gdbarch_byte_order > + (target_gdbarch)); I don't think you need all the casts to short, int, etc.. anymore. Please add the missing space in the second cast: "(gdb_byte *) &tpnum" everywhere too. Otherwise okay. Thanks. -- Pedro Alves