From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>,
Pedro Alves <palves@redhat.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/2] This patch fixes GDBServer's run control for single stepping
Date: Sun, 19 Feb 2017 20:31:00 -0000 [thread overview]
Message-ID: <wwoka89h2a9b.fsf@ericsson.com> (raw)
In-Reply-To: <wwokfuja0y2i.fsf@ericsson.com>
Antoine Tremblay writes:
> Yao Qi writes:
>
>> On 17-02-17 19:17:56, Antoine Tremblay wrote:
>>> > In ARM ARM, we have the pseudo code,
>>> >
>>> > boolean InITBlock()
>>> > return (ITSTATE.IT<3:0> != â0000â);
>>> >
>>> > ITSTATE can be got from CPSR.
>>>
>>> Yes that's good if you're inserting a breakpoint at current PC but
>>> otherwise you will need something else...
>>
>> In software single step, we calculate the next pcs, and select
>> breakpoint kinds of them, according to current pc. If current
>> pc is not within IT block (!InITBlock ()) or the last instruction
>> in IT block (LastInITBlock ()), we can safely use 16-bit thumb
>> breakpoint for any thumb instruction. That is, in
>> gdbserver/linux-aarch32-low.c:arm_breakpoint_kind_from_current_state,
>> we can return ARM_BP_KIND_THUMB if (!InITBlock () || LastInITBlock ()).
>>
>> Then, in some level, when installing software single step breakpoints,
>> if one breakpoint type is ARM_BP_KIND_THUMB2 and installed
>> address is 2-byte aligned, stop all threads.
>
> Yes that would make sense but I think we can be calling get_next_pc
> to insert a software single step breakpoint at an address different then
> the current PCs next address.
>
> See: https://sourceware.org/ml/gdb-patches/2016-06/msg00268.html
>
> "> If we only remove before reporting an event to gdb, then I don't
>> understand this. We already insert single-step breakpoints when
>> we process the resume request from gdb, no?
>
> We insert single-step breakpoints when we process the resume requests
> and threads are about to be resumed. If threads still have pending
> status, single-step breakpoints are not installed, so we need to install
> them in proceed_all_lwps."
>
> This is still true AFAIK so GDBServer may be at any PC stopped on a
> pending event and need to insert a single step breakpoint at an address
> unrelated to that event so in that case CPSR can't be used...
>
> Thanks,
> Antoine
Oops looks like it had been a while since I checked the get_next_pc
code, so we switch the current thread and use that PC so it should work.
Disregard my last mail :)
Looks like this solution is a good way forward.
next prev parent reply other threads:[~2017-02-19 20:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-29 12:07 Antoine Tremblay
2016-11-29 12:07 ` [PATCH 2/2] Avoid step-over infinite loop in GDBServer Antoine Tremblay
2017-01-16 17:27 ` Antoine Tremblay
2017-01-18 16:31 ` Antoine Tremblay
2017-02-03 16:21 ` Pedro Alves
2017-02-17 3:39 ` Antoine Tremblay
2017-02-22 10:15 ` Yao Qi
2016-11-29 12:12 ` [PATCH 1/2] This patch fixes GDBServer's run control for single stepping Antoine Tremblay
2017-01-16 17:28 ` Antoine Tremblay
2017-01-27 15:01 ` Yao Qi
2017-01-27 16:07 ` Antoine Tremblay
[not found] ` <CAH=s-PP-i3v_Fr=QeWt9BQeJzjCHtW79nGYpJ9hF-Bb=OBo89Q@mail.gmail.com>
2017-01-27 18:24 ` Antoine Tremblay
2017-01-29 21:41 ` Yao Qi
2017-01-30 13:29 ` Antoine Tremblay
2017-02-16 22:32 ` Yao Qi
2017-02-17 2:17 ` Antoine Tremblay
[not found] ` <2255ed6f-a146-026c-f871-00e9a33dfcf0@redhat.com>
2017-02-17 1:42 ` Antoine Tremblay
2017-02-17 2:05 ` Pedro Alves
2017-02-17 3:06 ` Antoine Tremblay
2017-02-17 22:19 ` Yao Qi
2017-02-18 0:19 ` Antoine Tremblay
2017-02-18 22:49 ` Yao Qi
2017-02-19 19:40 ` Antoine Tremblay
2017-02-19 20:31 ` Antoine Tremblay [this message]
2017-03-29 12:41 ` Antoine Tremblay
2017-03-29 14:11 ` Antoine Tremblay
2017-03-29 17:54 ` Antoine Tremblay
[not found] ` <86d1cy4umo.fsf@gmail.com>
2017-03-30 18:31 ` Antoine Tremblay
2017-03-31 16:31 ` Yao Qi
2017-03-31 18:22 ` Antoine Tremblay
2017-04-03 12:41 ` Yao Qi
2017-04-03 13:18 ` Antoine Tremblay
2017-04-03 15:18 ` Yao Qi
2017-04-03 16:57 ` Antoine Tremblay
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=wwoka89h2a9b.fsf@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--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