From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12669 invoked by alias); 28 Mar 2010 22:56:55 -0000 Received: (qmail 12661 invoked by uid 22791); 28 Mar 2010 22:56:55 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SARE_SUB_OBFU_Q1 X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Mar 2010 22:56:50 +0000 Received: by vws20 with SMTP id 20so5454238vws.0 for ; Sun, 28 Mar 2010 15:56:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.90.201 with HTTP; Sun, 28 Mar 2010 15:56:48 -0700 (PDT) In-Reply-To: <201003282226.54606.pedro@codesourcery.com> References: <20100328204807.GA10649@intel.com> <20100328205207.GA11401@intel.com> <201003282226.54606.pedro@codesourcery.com> Date: Sun, 28 Mar 2010 22:56:00 -0000 Received: by 10.220.124.214 with SMTP id v22mr2363540vcr.221.1269817008362; Sun, 28 Mar 2010 15:56:48 -0700 (PDT) Message-ID: <6dc9ffc81003281556n51481a8cv45a11b6924a15dd6@mail.gmail.com> Subject: Re: PATCH: Add xmlRegisters= to qsupported query From: "H.J. Lu" To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-03/txt/msg00961.txt.bz2 On Sun, Mar 28, 2010 at 2:26 PM, Pedro Alves wrote: > On Sunday 28 March 2010 21:52:07, H.J. Lu wrote: >> =A0 =A0 =A0 =A0const char *qsupported =3D gdbarch_qsupported (target_gdb= arch); >> - =A0 =A0 =A0if (qsupported) >> + =A0 =A0 =A0if (qsupported || remote_support_xml) >> =A0 =A0 =A0 =A0 { >> - =A0 =A0 =A0 =A0 char *q; >> + =A0 =A0 =A0 =A0 char *q, *x; >> + =A0 =A0 =A0 =A0 char *p =3D NULL; >> + =A0 =A0 =A0 =A0 const char *m; >> + >> =A0 =A0 =A0 =A0 =A0 if (rs->extended) >> - =A0 =A0 =A0 =A0 =A0 q =3D concat ("qSupported:multiprocess+;", qsuppor= ted, NULL); >> + =A0 =A0 =A0 =A0 =A0 m =3D "multiprocess+;"; >> =A0 =A0 =A0 =A0 =A0 else >> - =A0 =A0 =A0 =A0 =A0 q =3D concat ("qSupported:", qsupported, NULL); >> + =A0 =A0 =A0 =A0 =A0 m =3D ""; >> + >> + =A0 =A0 =A0 =A0 if (remote_support_xml) >> + =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 if (qsupported) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 p =3D concat ("xmlRegisters=3D", remote_su= pport_xml, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ";", NULL); >> + =A0 =A0 =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 p =3D concat ("xmlRegisters=3D", remote_su= pport_xml, NULL); >> + =A0 =A0 =A0 =A0 =A0 =A0 x =3D p; >> + =A0 =A0 =A0 =A0 =A0 } >> + =A0 =A0 =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 x =3D ""; >> + >> + =A0 =A0 =A0 =A0 q =3D concat ("qSupported:", m, x, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 qsupported ? qsupported : "", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL); >> =A0 =A0 =A0 =A0 =A0 putpkt (q); >> + =A0 =A0 =A0 =A0 if (p) >> + =A0 =A0 =A0 =A0 =A0 xfree (p); >> =A0 =A0 =A0 =A0 =A0 xfree (q); > > There's some hair here for handling gdbarch_qsupported, but, > is it going to end up used at all? =A0It isn't used today. I added it to prepare for AVX support. But I don't need it anymore since I will use xmlRegisters=3D. > [personaly, I'd try to write the above in a way that avoids all > this if/then/if/then/else/else nesting everytime a few > qSupported feature is added.] > I can try something. --=20 H.J.