From: Hui Zhu <teawater@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA/tracepoint] Make GDB can work with some old GDB server
Date: Thu, 07 Jul 2011 13:46:00 -0000 [thread overview]
Message-ID: <CANFwon2cnXGSiPTnvNooQAeEtwHQH7wAQafaervTnvRc0o9OCQ@mail.gmail.com> (raw)
In-Reply-To: <20110707091911.GA8747@host1.jankratochvil.net>
On Thu, Jul 7, 2011 at 17:19, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> On Fri, 24 Jun 2011 10:46:58 +0200, Hui Zhu wrote:
>> Sending packet: $qTStatus#49...Ack
>> Packet received: E22
>> trace API error 0x2.
> [...]
>> This is because this kgdb(I think trunk have fixed this bug) don't
>> support qtstatus and reply -0x22.
>> So gdb throw a error. Then all connect process stop.
>
> Why not to just put it more close to the error invocation? Still some calls
> to target_get_trace_status would remain unprotected otherwise.
>
>
> Thanks,
> Jan
>
>
> gdb/
> 2011-07-07 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Work around kgdb.
> * remote.c (remote_get_trace_status): New variable ex. Put
> remote_get_noisy_reply into TRY_CATCH. Call exception_fprintf for it.
>
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -10045,11 +10045,21 @@ remote_get_trace_status (struct trace_status *ts)
> char *p;
> /* FIXME we need to get register block size some other way. */
> extern int trace_regblock_size;
> + volatile struct gdb_exception ex;
>
> trace_regblock_size = get_remote_arch_state ()->sizeof_g_packet;
>
> putpkt ("qTStatus");
> - p = remote_get_noisy_reply (&target_buf, &target_buf_size);
> +
> + TRY_CATCH (ex, RETURN_MASK_ERROR)
> + {
> + p = remote_get_noisy_reply (&target_buf, &target_buf_size);
> + }
> + if (ex.reason < 0)
> + {
> + exception_fprintf (gdb_stderr, ex, "qTStatus: ");
> + return -1;
> + }
>
> /* If the remote target doesn't do tracing, flag it. */
> if (*p == '\0')
>
Cool. This one is more better. I have reverted my patch.
Suggest this patch can check in to both 7.3 and trunk.
Thanks,
Hui
next prev parent reply other threads:[~2011-07-07 13:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 8:47 Hui Zhu
2011-07-04 6:04 ` Hui Zhu
2011-07-05 18:35 ` Tom Tromey
2011-07-06 9:33 ` Hui Zhu
2011-07-06 14:40 ` Tom Tromey
2011-07-07 8:41 ` Hui Zhu
2011-07-07 11:35 ` Jan Kratochvil
2011-07-07 13:46 ` Hui Zhu [this message]
2011-07-13 19:19 ` Jan Kratochvil
2011-07-14 6:27 ` Hui Zhu
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=CANFwon2cnXGSiPTnvNooQAeEtwHQH7wAQafaervTnvRc0o9OCQ@mail.gmail.com \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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