Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Pitchumani Sivanupandi <pitchumani.s@atmel.com>,
	       gdb-patches@sourceware.org, chertykov@gmail.com
Cc: troth@openavr.org, senthil_kumar.selvaraj@atmel.com
Subject: Re: [patch, avr, pr19401] Update PC after break
Date: Wed, 23 Mar 2016 14:40:00 -0000	[thread overview]
Message-ID: <56F2AAC3.8000101@redhat.com> (raw)
In-Reply-To: <20160323141426.GA10252@CHELT0346>

On 03/23/2016 02:14 PM, Pitchumani Sivanupandi wrote:
> avr-gdb doesn't seem to be rewinding the PC after break. If a breakpoint
> is at four byte instruction, it resumes from the middle of the
> instruction. This caused the target to reject the next (half) instruction
> as illegal. In case of breakpoint at two byte instruction, it resumes from
> the the next instruction. Instruction at breakpoint location was skipped
> as the PC was rewinded after break.
> 
> Test case in PR19401 is the example for the first situation. Below
> example is for second situation.

How was this not noticed before?  

> command line: avr-gcc test.c -mmcu=atmega2560 -g -o test.elf
> avr-gdb test.elf
> (gdb) target sim
> (gdb) load
> (gdb) b main
> (gdb) run
> 0x00000124 in main () at sim1.c:5

I would expect to see mention of a SIGTRAP here, and for all
breakpoints, as gdb won't be able to map the current PC address
with any GDB breakpoint. Doesn't that happen?

Is the simulator behaving differently from real hardware?  Are existing
stubs rewinding the PC themselves, or using a different breakpoint
instruction (by implementing the z/Z packets)?

Thanks,
Pedro Alves


  reply	other threads:[~2016-03-23 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 14:14 Pitchumani Sivanupandi
2016-03-23 14:40 ` Pedro Alves [this message]
2016-03-24 13:40   ` Pitchumani Sivanupandi
2016-03-29 17:17     ` Pedro Alves
2016-06-30 13:41       ` Pitchumani Sivanupandi

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=56F2AAC3.8000101@redhat.com \
    --to=palves@redhat.com \
    --cc=chertykov@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pitchumani.s@atmel.com \
    --cc=senthil_kumar.selvaraj@atmel.com \
    --cc=troth@openavr.org \
    /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