From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7252 invoked by alias); 19 Jun 2009 07:08:58 -0000 Received: (qmail 7239 invoked by uid 22791); 19 Jun 2009 07:08:57 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Jun 2009 07:08:50 +0000 Received: from zps38.corp.google.com (zps38.corp.google.com [172.25.146.38]) by smtp-out.google.com with ESMTP id n5J78kEC009895 for ; Fri, 19 Jun 2009 08:08:46 +0100 Received: from yxe36 (yxe36.prod.google.com [10.190.2.36]) by zps38.corp.google.com with ESMTP id n5J78cUl014767 for ; Fri, 19 Jun 2009 00:08:44 -0700 Received: by yxe36 with SMTP id 36so2230068yxe.15 for ; Fri, 19 Jun 2009 00:08:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.35.6 with SMTP id i6mr1880060agi.74.1245395318703; Fri, 19 Jun 2009 00:08:38 -0700 (PDT) In-Reply-To: References: Date: Fri, 19 Jun 2009 07:08:00 -0000 Message-ID: Subject: Re: [patch] gdbserver: Add support for Z0/Z1 packets From: Doug Evans To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true 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: 2009-06/txt/msg00497.txt.bz2 On Tue, Jun 16, 2009 at 6:31 PM, Aleksandar Ristovski wrote: > Aleksandar Ristovski wrote: >> >> Hello, >> >> This adds support for Z0 and Z1 (and z0 and z1) packets. >> > > I apologize, the patch should be this one. Change log corrected as well. > > -- > Aleksandar Ristovski > QNX Software Systems > > > ChangeLog: > > * target.h (insert_breakpoint, remove_breakpoint): New target functions. > * server.c (process_serial_event): 'Z' and 'z' packet - add support > for [Zz]0 and [Zz]1 - software and hardware breakpoints. > * linux-low.c (linux_target_ops): Add new fields. > * spu-low.c (spu_target_ops): Likewise. > * win32-low.c (win32_target_ops): Likewise. Hi. Minor nits (fwiw): Inserting the insert_breakpoint/remove_breakpoint fields *between* the stopped_by_watchpoint/stopped_data_address fields is odd. Can they go before insert_watchpoint? I think the code in server.c that watches for 0/1/2/3/4 should use a switch. The code previously caught invalid values (e.g. type == '5'), but you accidentally removed that (IIUC). The code in server.c does this: + if (the_target->insert_watchpoint == NULL) + { + /* No watchpoint support or not a watchpoint command; + unrecognized either way. */ + own_buf[0] = '\0'; + res = 1; + } and later does this: + if (res == 0) + write_ok (own_buf); + else if (res == 1) + /* Unsupported. */ + own_buf[0] = '\0'; + else + write_enn (own_buf); How about just setting res = 1 in the first code snippet above? [This appears for both 'z' and 'Z' packets.]