qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Rolnik <mrolnik@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Sarah Harris <S.E.Harris@kent.ac.uk>,
	Richard Henderson <richard.henderson@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH RFC v20 3/8] target/avr: Add mechanism to check for active debugger connection
Date: Wed, 5 Jun 2019 20:57:10 +0300	[thread overview]
Message-ID: <CAK4993hUtq72tfdzM8hTPRZkBL-Djcs6x6=SVQtHLizkciHhaA@mail.gmail.com> (raw)
In-Reply-To: <87o93crp23.fsf@zen.linaroharston>

Just ran the test with simavr, once it hit BREAK, gdb stopped

On Wed, Jun 5, 2019 at 7:12 PM Alex Bennée <alex.bennee@linaro.org> wrote:

>
> Michael Rolnik <mrolnik@gmail.com> writes:
>
> > Richard.
> >
> > We use break instruction for testing. (Here
> > https://github.com/seharris/qemu-avr-tests/tree/master/instruction-tests
> ).
> > Each test is a big list of small tests with a break between them. We run
> > the tests on HW and on QEMU then compare register after each break.
>
> This is exactly the same process RISU uses for testing. But it works
> with a) linux-user and b) some architecturally defined illegal
> instruction that will cause a SIGILL.
>
> > If we
> > don't implement break the way Sarah suggested we have no way of
> > testing.
>
> So this is the behaviour of AVR simulator when gdb is attached?
>
> > What do you suggest?
> >
> > Sent from my cell phone, please ignore typos
> >
> > On Wed, Jun 5, 2019, 5:37 PM Richard Henderson <
> richard.henderson@linaro.org>
> > wrote:
> >
> >> On 6/5/19 2:20 AM, Michael Rolnik wrote:
> >> > Hi Richard.
> >> >
> >> > I am still struggling with this one.
> >> >
> >> > The spec says.
> >> > The BREAK instruction is used by the On-chip Debug system, and is
> >> normally not
> >> > used in the application software.
> >> > When the BREAK instruction is executed, the AVR CPU is set in the
> >> Stopped Mode.
> >> > This gives the On-chip Debugger access to internal resources.
> >> > If any Lock bits are set, or either the JTAGEN or OCDEN Fuses are
> >> unprogrammed,
> >> > the CPU will treat the BREAK instruction as a NOP and will not enter
> the
> >> > Stopped mode.
> >>
> >> Yep.
> >>
> >> > I read is as follows
> >> > - If user has an intention of using debugger, BREAK should be
> translated
> >> to
> >> > QEMU debug breakpoint
> >> > - If user has no intention of using debugger, BREAK should be
> translated
> >> into NOP.
> >>
> >> I do not read it that way.  The spec is talking about a specific
> >> implementation
> >> of debugging -- fuses, jtag and all.  We do not need to implement
> >> breakpoints
> >> using any of those mechanisms, because we can insert breakpoints via
> >> on-the-side data structures and re-translation.
> >>
> >>
> >> r~
> >>
> >
> > On Wed, Jun 5, 2019, 5:37 PM Richard Henderson <
> richard.henderson@linaro.org>
> > wrote:
> >
> >> On 6/5/19 2:20 AM, Michael Rolnik wrote:
> >> > Hi Richard.
> >> >
> >> > I am still struggling with this one.
> >> >
> >> > The spec says.
> >> > The BREAK instruction is used by the On-chip Debug system, and is
> >> normally not
> >> > used in the application software.
> >> > When the BREAK instruction is executed, the AVR CPU is set in the
> >> Stopped Mode.
> >> > This gives the On-chip Debugger access to internal resources.
> >> > If any Lock bits are set, or either the JTAGEN or OCDEN Fuses are
> >> unprogrammed,
> >> > the CPU will treat the BREAK instruction as a NOP and will not enter
> the
> >> > Stopped mode.
> >>
> >> Yep.
> >>
> >> > I read is as follows
> >> > - If user has an intention of using debugger, BREAK should be
> translated
> >> to
> >> > QEMU debug breakpoint
> >> > - If user has no intention of using debugger, BREAK should be
> translated
> >> into NOP.
> >>
> >> I do not read it that way.  The spec is talking about a specific
> >> implementation
> >> of debugging -- fuses, jtag and all.  We do not need to implement
> >> breakpoints
> >> using any of those mechanisms, because we can insert breakpoints via
> >> on-the-side data structures and re-translation.
> >>
> >>
> >> r~
> >>
>
>
> --
> Alex Bennée
>
>

-- 
Best Regards,
Michael Rolnik

  reply	other threads:[~2019-06-05 17:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 19:07 [Qemu-devel] [PATCH RFC v20 0/8] QEMU AVR 8 bit cores Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 1/8] target/avr: Add outward facing interfaces and core CPU logic Michael Rolnik
2019-05-31  8:02   ` Igor Mammedov
2019-05-31  8:15     ` Michael Rolnik
2019-05-31  9:56       ` Igor Mammedov
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 2/8] target/avr: Add instruction helpers Michael Rolnik
2019-05-31 13:50   ` Richard Henderson
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 3/8] target/avr: Add mechanism to check for active debugger connection Michael Rolnik
2019-05-31 13:54   ` Richard Henderson
2019-06-01 21:12     ` Michael Rolnik
2019-06-03 15:44       ` Richard Henderson
2019-06-03 16:29         ` Michael Rolnik
2019-06-03 16:36           ` Richard Henderson
2019-06-03 17:04             ` Michael Rolnik
2019-06-05  7:20               ` Michael Rolnik
2019-06-05 14:36                 ` Richard Henderson
2019-06-05 15:19                   ` Michael Rolnik
2019-06-05 16:06                     ` Richard Henderson
2019-06-05 16:10                     ` Alex Bennée
2019-06-05 17:57                       ` Michael Rolnik [this message]
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 4/8] target-avr: Add instruction decoding Michael Rolnik
2019-05-31 14:45   ` Richard Henderson
2019-06-03 20:13     ` Michael Rolnik
2019-06-03 21:48       ` Richard Henderson
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 5/8] target/avr: Add instruction translation Michael Rolnik
2019-05-31 15:31   ` Richard Henderson
2019-06-02  3:44     ` Michael Rolnik
2019-06-03 15:31       ` Richard Henderson
2019-06-03 15:34         ` Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 6/8] target/avr: Add limited support for USART and 16 bit timer peripherals Michael Rolnik
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 7/8] target/avr: Add example board configuration Michael Rolnik
2019-05-31  8:06   ` Igor Mammedov
2019-05-30 19:07 ` [Qemu-devel] [PATCH RFC v20 8/8] target/avr: Register AVR support with the rest of QEMU, the build system, and the MAINTAINERS file Michael Rolnik
2019-05-31 14:50   ` Eric Blake
2019-06-01 21:20     ` Michael Rolnik
2019-06-03 19:47       ` Eric Blake
2019-06-03 19:53         ` Michael Rolnik
2019-05-30 20:16 ` [Qemu-devel] [PATCH RFC v20 0/8] QEMU AVR 8 bit cores no-reply

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='CAK4993hUtq72tfdzM8hTPRZkBL-Djcs6x6=SVQtHLizkciHhaA@mail.gmail.com' \
    --to=mrolnik@gmail.com \
    --cc=S.E.Harris@kent.ac.uk \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    /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 NNTP newsgroup(s).