This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/16703] The program breaks at the next instruction when issuing a memory breakpoint on AVR8.


https://sourceware.org/bugzilla/show_bug.cgi?id=16703

--- Comment #5 from Pierre Langlois <pierre.langlois at embecosm dot com> ---
Hello Pedro,

The reason why this has not been addressed is because memory breakpoint are
only supported by the simulation models. On real hardware, memory breakpoints
are not possible due to the flash memory being read-only. So I believe up until
now, only hardware breakpoints have been used.

For instance, I ran the same test using AVaRice (see the following GDB
session), and it resorts to hardware breakpoints.

AVaRice reports the following memory-map:

  Sending packet: $qXfer:memory-map:read::0,18a#b4...Ack
  Packet received: l<memory-map>\n  <memory type="ram" start="0x800000"
  length="0x20000" />\n  <memory type="flash" start="0" length="0x48400">\n
  <property name="blocksize">0x80</property>\n  </memory>\n</memory-map>\n

Resulting in this:
  Note: automatically using hardware breakpoints for read-only addresses.

----------------------------------------------------------------------------

GNU gdb (AVR 8-bit toolchain (built 20140310)) 7.7.50.20140314-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=avr".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.atmel.com>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file atxmega-test.elf
Reading symbols from atxmega-test.elf...done.
(gdb) set debug remote 1
(gdb) target remote :4242
Remote debugging using :4242
Sending packet: $qSupported:multiprocess+;qRelocInsn+#2a...Ack
Packet received: qXfer:memory-map:read+
Packet qSupported (supported-packets) is supported
Sending packet: $Hg0#df...Ack
Packet received:
Sending packet: $qTStatus#49...Ack
Packet received:
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Ack
Packet received: S05
Sending packet: $qfThreadInfo#bb...Ack
Packet received:
Sending packet: $qL1160000000000000000#55...Ack
Packet received:
Sending packet: $Hc-1#09...Ack
Packet received:
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $qAttached#8f...Ack
Packet received:
Packet qAttached (query-attached) is NOT supported
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received:
000000000000000000000000000000000000000000000000000000000000000000ff5f00000000
0x00000000 in __vectors ()
Sending packet: $qSymbol::#5b...Ack
Packet received:
Packet qSymbol (symbol-lookup) is NOT supported
(gdb) break main
Sending packet: $qXfer:memory-map:read::0,18a#b4...Ack
Packet received: l<memory-map>\n  <memory type="ram" start="0x800000"
length="0x20000" />\n  <memory type="flash" start="0" length="0x48400">\n
<property name="blocksize">0x80</property>\n  </memory>\n</memory-map>\n
Sending packet: $m204,2#61...Ack
Packet received: 83e0
Breakpoint 1 at 0x204: file main.c, line 7.
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Sending packet: $Z1,204,2#ab...Ack
Packet received: OK
Packet Z1 (hardware-breakpoint) is supported
Sending packet: $vCont?#49...Ack
Packet received:
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...Ack
Packet received:
Sending packet: $c#63...Ack
Packet received: T0520:00;21:fc5f;22:04020000;
Sending packet: $z1,204,2#cb...Ack
Packet received: OK

Breakpoint 1, main () at main.c:7
7         PORTR.DIRSET = 3;
(gdb) q
A debugging session is active.

        Inferior 1 [Remote target] will be killed.

        Quit anyway? (y or n) y

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]