From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: PATCH: Add xmlRegisters= to qsupported query
Date: Sun, 28 Mar 2010 21:27:00 -0000 [thread overview]
Message-ID: <201003282226.54606.pedro@codesourcery.com> (raw)
In-Reply-To: <20100328205207.GA11401@intel.com>
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
next prev parent reply other threads:[~2010-03-28 21:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 20:48 H.J. Lu
2010-03-28 20:52 ` H.J. Lu
2010-03-28 21:27 ` Pedro Alves [this message]
2010-03-28 22:56 ` H.J. Lu
2010-03-28 23:48 ` H.J. Lu
2010-03-28 23:46 ` H.J. Lu
2010-03-29 6:40 ` Eli Zaretskii
2010-03-29 14:13 ` H.J. Lu
2010-03-29 14:32 ` Eli Zaretskii
2010-03-29 14:47 ` H.J. Lu
2010-03-29 14:55 ` H.J. Lu
2010-03-29 16:19 ` H.J. Lu
2010-03-29 17:49 ` Mark Kettenis
2010-03-29 18:02 ` H.J. Lu
2010-03-30 13:55 ` Pedro Alves
2010-03-30 14:58 ` H.J. Lu
2010-03-30 15:09 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201003282226.54606.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=hjl.tools@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox