From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 11/11] New target_ops hook to_can_do_single_step
Date: Wed, 01 Jul 2015 16:43:00 -0000 [thread overview]
Message-ID: <55941892.3000902@redhat.com> (raw)
In-Reply-To: <1435759111-22856-12-git-send-email-yao.qi@linaro.org>
On 07/01/2015 02:58 PM, Yao Qi wrote:
> Nowadays, GDB only knows whether architecture supports hardware single
> step or software single step (through gdbarch hook software_single_step),
> and for a given instruction or instruction sequence, GDB knows how to
> do single step (hardware or software). However, GDB doesn't know whether
> the target supports hardware single step. It is possible that the
> architecture doesn't support hardware single step, such as arm, but
> the target supports, such as simulator. This was discussed in this
> thread https://www.sourceware.org/ml/gdb/2009-12/msg00033.html before.
>
> I encounter this problem for aarch64 multi-arch support. When aarch64
> debugs arm program, gdbarch is arm, so software single step is still
> used. However, the underneath linux kernel does support hardware
> single step, so IWBN to use it.
>
> This patch is to add a new target_ops hook to_can_do_single_step, and
> only use it in arm_linux_software_single_step to decide whether or not
> to use hardware single step. On the remote target, if the target
> supports s and S actions in the vCont? reply, then target can do single
> step. On the native aarch64 linux target, 1 is returned. On other
> targets, -1 is returned.
Yeah, I've wanted to do this before too.
But my issue with it is that this breaks gdb/gdbserver compatibility.
Old GDB has:
/* If s, S, c, and C are not all supported, we can't use vCont. Clearing
BUF will make packet_ok disable the packet. */
if (!support_s || !support_S || !support_c || !support_C)
buf[0] = 0;
Which means that new x86-86 gdbserver with old gdb will just
stop using vCont after this change.
And old arm gdbserver will still claim support for vCont;s packets,
which means that new gdb with old gdbserver will be broken.
I think this needs to be addressed somehow.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-07-01 16:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 13:58 [PATCH 00/11] Aarch64 linux GDB native multi-arch debugging (part 1) Yao Qi
2015-07-01 13:58 ` [PATCH 07/11] New proc is_aarch32_target Yao Qi
2015-07-01 13:58 ` [PATCH 08/11] New proc is_aarch64_target Yao Qi
2015-07-01 14:10 ` Andreas Schwab
2015-07-01 14:19 ` Yao Qi
2015-07-01 14:39 ` Andreas Schwab
2015-07-01 13:58 ` [PATCH 01/11] Remove {fetch,store}_fpregister and {fetch,store}_register Yao Qi
2015-07-01 13:58 ` [PATCH 04/11] Set architecture to arm in arm-*.xml files Yao Qi
2015-07-01 13:58 ` [PATCH 02/11] New aarch32-linux-nat.c Yao Qi
2015-07-01 13:59 ` [PATCH 09/11] [gdbserver] Rename supports_conditional_breakpoints to supports_hardware_single_step Yao Qi
2015-07-01 13:59 ` [PATCH 03/11] Native debug arm program by aarch64 GDB Yao Qi
2015-07-01 13:59 ` [PATCH 06/11] Enable multi-arch test in catch-syscall.exp on aarch64 Yao Qi
2015-07-01 13:59 ` [PATCH 05/11] Adjust gdb.multi tests for aarch64 Yao Qi
2015-07-01 13:59 ` [PATCH 11/11] New target_ops hook to_can_do_single_step Yao Qi
2015-07-01 16:43 ` Pedro Alves [this message]
2015-07-02 8:56 ` Yao Qi
2015-07-02 9:09 ` Pedro Alves
2015-07-01 13:59 ` [PATCH 10/11] Reply s and S vCont actions if target supports hardware single step Yao Qi
2015-07-01 17:00 ` [PATCH 00/11] Aarch64 linux GDB native multi-arch debugging (part 1) Pedro Alves
2015-07-01 18:54 ` Pedro Alves
2015-07-02 9:05 ` Yao Qi
2015-07-07 16:13 ` Yao Qi
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=55941892.3000902@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).