Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Prafull Suryawanshi <prafull.net@gmail.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Andrew Pinski <pinskia@gmail.com>,
	Andreas Schwab <schwab@suse.de>,
		"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Is there single step debugging support being added to aarch64-linux?
Date: Tue, 16 Jun 2015 05:22:00 -0000	[thread overview]
Message-ID: <CAJgVtDVxUS+aoFkD5zmHKpSuyhLvu_gTMc0ed4F6GjXcJE2qLg@mail.gmail.com> (raw)
In-Reply-To: <CAJgVtDW7qi4Zfz_ELnk25THoJpfPf_im=rpv8nv9-ZqqcQmXRw@mail.gmail.com>

(sent too early, putting complete reply)

I debugged this one and found that when compared to gdb-arm,
gdb-aarch64 behaves little different.
Before even invoking software-single-step operations, gdb-arm invokes
Z0 packet before getting registers.
But gdb-aarch64 does not do it. It sets the Z0 after reading registers.
So in case gdb-arm, the Z0 is set to next pc value.
But for gdb-aarch64 it sets the Z0 at current pc only.

Below is logs when enabled remote_debug option.
for gdb-arm
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current
thread [Thread 2229] at 0xc01b2ddc
Sending packet: $Z0,c01b2de0,4#67...Ack

For gdb-aarch64,
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current
thread [Thread 3462] at 0xffffffc00021014c
Sending packet: $Z0,ffffffc00021014c,4#c8...Ack

As we can see, gdb-aarch64 puts Z0 (breakpoint) at same place where
current pc is. But gdb-arm puts breakpoint at just next pc.

Then I found that gdb-arm has below output
infrun: software single step trap for Thread 2229

So I implemented same for gdb-aarch64.

As for KGDB code for aarch64 do not have hardware breakpoint support.
(usermode does have)
Not sure if that could be issue.

Thanks,
Prafull


On Tue, Jun 16, 2015 at 10:47 AM, Prafull Suryawanshi
<prafull.net@gmail.com> wrote:
> I debugged this one and found that when compared to gdb-arm,
> gdb-aarch64 behaves little different.
> Before even invoking software-single-step operations, gdb-arm invokes
> Z0 packet before getting registers.
> But gdb-aarch64 does not do it. It sets the Z0 after reading registers.
> So in case gdb-arm, the Z0 is set to next pc value.
> But for gdb-aarch64 it sets the Z0 at current pc only.
>
> Below is logs when enabled remote_debug option.
> for gdb-arm
> infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current
> thread [Thread 2229] at 0xc01b2ddc
> Sending packet: $Z0,c01b2de0,4#67...Ack
>
>
> For gdb-aarch64,
> infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current
> thread [Thread 3462] at 0xffffffc00021014c
>
> On Mon, Jun 15, 2015 at 6:21 PM, Yao Qi <qiyaoltc@gmail.com> wrote:
>> Prafull Suryawanshi <prafull.net@gmail.com> writes:
>>
>>> I am not sure why hw stepper not works here (might be limitation of hw
>>> I am using).
>>
>> You'd better to check whether hw single step doesn't work in your case.
>>
>>> That is may be the infrun loops as it never gets stop signal. (the
>>> output I earlier pasted).
>>> Is it ok to provide patch for software single step like arm here?
>>
>> We only implement software single step on the targets don't have
>> hardware single step capability, like arm.
>>
>>> (I am preparing one. It will have simulate aarch64 instruction set and
>>> implement aarch64 version of functions of
>>> arm_linux_software_single_step, arm_insert_single_step_breakpoint and
>>> arm_get_next_pc.)
>>
>> Before you start it, better to get the reason why hw single step doesn't
>> work on aarch64.
>>
>> --
>> Yao (齐尧)


      reply	other threads:[~2015-06-16  5:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 10:21 Prafull Suryawanshi
2015-06-15 10:38 ` Andreas Schwab
2015-06-15 10:57   ` Prafull Suryawanshi
2015-06-15 11:03     ` Andreas Schwab
2015-06-15 11:07     ` Prafull Suryawanshi
2015-06-15 11:20       ` pinskia
2015-06-15 11:48         ` Prafull Suryawanshi
2015-06-15 11:57           ` pinskia
2015-06-15 12:12             ` Prafull Suryawanshi
2015-06-15 12:51           ` Yao Qi
2015-06-16  5:18             ` Prafull Suryawanshi
2015-06-16  5:22               ` Prafull Suryawanshi [this message]

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=CAJgVtDVxUS+aoFkD5zmHKpSuyhLvu_gTMc0ed4F6GjXcJE2qLg@mail.gmail.com \
    --to=prafull.net@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=pinskia@gmail.com \
    --cc=qiyaoltc@gmail.com \
    --cc=schwab@suse.de \
    /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