From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70554 invoked by alias); 28 Apr 2016 17:19:17 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 70536 invoked by uid 89); 28 Apr 2016 17:19:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=agent, farm X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (176.31.208.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 28 Apr 2016 17:19:07 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Fix write endianness/size problem for fast tracepoint enabled flag From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <35fd2deb6916e972248d52b1bc1d584fa9059f8f@gdb-build> Date: Thu, 28 Apr 2016 17:19:00 -0000 X-SW-Source: 2016-q2/txt/msg01953.txt.bz2 *** TEST RESULTS FOR COMMIT 35fd2deb6916e972248d52b1bc1d584fa9059f8f *** Author: Par Olsson Branch: master Commit: 35fd2deb6916e972248d52b1bc1d584fa9059f8f Fix write endianness/size problem for fast tracepoint enabled flag I am sending this fix on behalf of Par Olsson, as a follow-up of this one: https://www.sourceware.org/ml/gdb-patches/2015-10/msg00196.html This problem is exposed when enabling/disabling fast tracepoints on big endian machines. The flag is defined as an int8_t, but is written from gdbserver as an integer (usually 32 bits). When the agent code reads it as an int8_t, it only considers the most significant byte, which is always 0. Also, we were writing 32 bits in an 8 bits field, so the write would overflow, but since the following bytes are padding (the next field is an uint64_t), it luckily didn't cause any issue on little endian systems. The fix was originally tested on ARM big endian systems, but I don't have access to such a system. However, thanks to Marcin's PowerPC fast tracepoint patches and gcc110 (big endian Power7) on the gcc compile farm, I was able to reproduce the problem, test the fix and write a test (the following patch). gdb/gdbserver/ChangeLog: YYYY-MM-DD Par Olsson * tracepoint.c (write_inferior_int8): New function. (cmd_qtenable_disable): Write enable flag using write_inferior_int8.