From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 676 invoked by alias); 28 Mar 2010 21:27:03 -0000 Received: (qmail 667 invoked by uid 22791); 28 Mar 2010 21:27:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SARE_SUB_OBFU_Q1 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; Sun, 28 Mar 2010 21:26:58 +0000 Received: (qmail 12630 invoked from network); 28 Mar 2010 21:26:56 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Mar 2010 21:26:56 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, "H.J. Lu" Subject: Re: PATCH: Add xmlRegisters= to qsupported query Date: Sun, 28 Mar 2010 21:27:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) References: <20100328204807.GA10649@intel.com> <20100328205207.GA11401@intel.com> In-Reply-To: <20100328205207.GA11401@intel.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003282226.54606.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-03/txt/msg00959.txt.bz2 On Sunday 28 March 2010 21:52:07, H.J. Lu wrote: > const char *qsupported = gdbarch_qsupported (target_gdbarch); > - if (qsupported) > + if (qsupported || remote_support_xml) > { > - char *q; > + char *q, *x; > + char *p = NULL; > + const char *m; > + > if (rs->extended) > - q = concat ("qSupported:multiprocess+;", qsupported, NULL); > + m = "multiprocess+;"; > else > - q = concat ("qSupported:", qsupported, NULL); > + m = ""; > + > + if (remote_support_xml) > + { > + if (qsupported) > + p = concat ("xmlRegisters=", remote_support_xml, > + ";", NULL); > + else > + p = concat ("xmlRegisters=", remote_support_xml, NULL); > + x = p; > + } > + else > + x = ""; > + > + q = concat ("qSupported:", m, x, > + qsupported ? qsupported : "", > + NULL); > putpkt (q); > + if (p) > + xfree (p); > xfree (q); There's some hair here for handling gdbarch_qsupported, but, is it going to end up used at all? It isn't used today. [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.] -- Pedro Alves