Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Yao Qi <qiyaoltc@gmail.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] Support single step by arch or target
Date: Tue, 01 Sep 2015 13:18:00 -0000	[thread overview]
Message-ID: <55E5A5A9.4030603@ericsson.com> (raw)
In-Reply-To: <1441096915-23615-3-git-send-email-yao.qi@linaro.org>



On 09/01/2015 04:41 AM, 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.

Could we name this can_hardware_single_step instead ? Since the target 
may be able to software single step (in gdbserver). And thus it would be 
confusing...It would also be more consistent with the 
supports_hardware_single_step hook ?


> --- a/gdb/arm-linux-tdep.c
> +++ b/gdb/arm-linux-tdep.c
> @@ -917,6 +917,11 @@ arm_linux_software_single_step (struct frame_info *frame)
>     if (arm_deal_with_atomic_sequence (frame))
>       return 1;
>
> +  /* If the target does have hardware single step, GDB doesn't have
> +     to bother software single step.  */
> +  if (target_can_do_single_step () == 1)
> +    return 0;
> +
>     next_pc = arm_get_next_pc (frame, get_frame_pc (frame));
>
>     /* The Linux kernel offers some user-mode helpers in a high page.  We can

target_can_do_single_step () should be before 
arm_deal_with_atomic_sequence ...



  reply	other threads:[~2015-09-01 13:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  8:42 [PATCH 0/2 V2] " Yao Qi
2015-09-01  8:42 ` [PATCH 1/2] [gdbserver] Rename supports_conditional_breakpoints to supports_hardware_single_step Yao Qi
2015-09-02 19:22   ` Antoine Tremblay
2015-09-03 15:13     ` Antoine Tremblay
2015-09-04 14:40       ` Antoine Tremblay
2015-09-04 15:04         ` Antoine Tremblay
2015-09-08 14:32     ` Yao Qi
2015-09-08 19:01       ` Antoine Tremblay
2015-09-09 15:37   ` Antoine Tremblay
2015-09-01  8:42 ` [PATCH 2/2] Support single step by arch or target Yao Qi
2015-09-01 13:18   ` Antoine Tremblay [this message]
2015-09-01 14:23     ` Yao Qi
2015-09-01 15:30       ` Antoine Tremblay
2015-09-01 14:40   ` Eli Zaretskii
2015-09-04 14:46   ` Antoine Tremblay
2015-09-14  8:18     ` Yao Qi
2015-09-15 13:31   ` Pedro Alves
2015-09-15 13:11 ` [PATCH 0/2 V2] " 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=55E5A5A9.4030603@ericsson.com \
    --to=antoine.tremblay@ericsson.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