From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29755 invoked by alias); 25 Feb 2013 03:12:23 -0000 Received: (qmail 29747 invoked by uid 22791); 25 Feb 2013 03:12:22 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_QT X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Feb 2013 03:12:17 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1U9oUC-0000cZ-Mq from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sun, 24 Feb 2013 19:12:16 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 24 Feb 2013 19:12:16 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Sun, 24 Feb 2013 19:12:15 -0800 From: Yao Qi To: Subject: [PATCH] Fix a bug in cmd_qtbuffer. Date: Mon, 25 Feb 2013 03:12:00 -0000 Message-ID: <1361761876-10017-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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: 2013-02/txt/msg00614.txt.bz2 Hi, When playing with packet "qTBuffer", I find a bug in cmd_qtbuffer. We don't have to set '\0' to OWN_BUF, because convert_int_to_ascii did that. On the other hand, it is incorrect to set '\0' to own_buf[num] because convert_int_to_ascii writes 2 * num of bytes to OWN_BUF, it is correct to set '\0' to own_buf[2 * num]. This patch fixes the bug I found when using "qTBuffer". Regression tested on x86_64-linux. OK? gdb/gdbserver: 2013-02-25 Yao Qi * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF. --- gdb/gdbserver/tracepoint.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 95c55ad..ba681c4 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -4002,7 +4002,6 @@ cmd_qtbuffer (char *own_buf) num = (PBUFSIZ - 16) / 2; convert_int_to_ascii (tbp, own_buf, num); - own_buf[num] = '\0'; } static void -- 1.7.7.6