This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] This patch fixes GDBServer's run control for single stepping
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Cc: Pedro Alves <palves at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sat, 18 Feb 2017 22:49:08 +0000
- Subject: Re: [PATCH 1/2] This patch fixes GDBServer's run control for single stepping
- Authentication-results: sourceware.org; auth=none
- References: <20161129120702.9490-1-antoine.tremblay@ericsson.com> <20170127150139.GB24676@E107787-LIN> <wwokwpdg5vxa.fsf@ericsson.com> <CAH=s-PP-i3v_Fr=QeWt9BQeJzjCHtW79nGYpJ9hF-Bb=OBo89Q@mail.gmail.com> <wwokr33o5pkb.fsf@ericsson.com> <CAH=s-PO98nCE4UB9ag+V=M2mBnZT0FOeHV3d7mFMLYe1+v=mFg@mail.gmail.com> <wwok8tps8yo2.fsf@ericsson.com> <2255ed6f-a146-026c-f871-00e9a33dfcf0@redhat.com> <wwokwpcp7fvn.fsf@ericsson.com> <b5fb81d1-66fc-68c2-9785-ffa487de59e0@redhat.com> <wwoktw7t7bzy.fsf@ericsson.com> <CAH=s-PPx+SjoE0DkTKKNqg4Dr4zHFNt6QeC-XXT_LoXVh004iw@mail.gmail.com> <wwokh93s1he3.fsf@ericsson.com>
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.
--
Yao (齐尧)