As ghedamat wrote:
> So to my understending gdb should send multiple step-into
> instructions to emulate the step-over functionality...
Yes, exactly.
> I'm asking if you have any info about gdb supporting this behavior
> and/or if you have any hints on how to deal with this issue
Sure, it does. For example, below is the AVaRICE debugging log for
single-stepping over an instruction like:
PORTH = (PORTH & ~3) | (~i & 3);
That's an ATmega2560, but the basics should be the same for Xmega
devices. The log is a bit lengthy, but you can clearly see the
multiple GDB requests ``GDB: <s>'', followed by inquiries about the
current PC which is reqported back to GDB. GDB repeats those until
the desired PC for the next statement (0x1b4) is reached.
Single-stepping is sometimes a bit tricky, e.g. when the compiler
inlines some code. Single-stepping over a lengthy loop (like
_delay_ms()) can take forever, due to the debugger round-trips. (AVR
Studio 5 also takes forever for that, they cook with the very same
water.) Usually, it makes more sense to walk along in larger steps
usign temporary breakpoints (command `tbreak', or `tb') rather than
trying to single-step.
> Another question,
>
> If you've the time, could you explain this phrase
>
> "The JTAG ICE's "step over" instruction can only be used the way AVR
> Studio 4 uses it, by prior filling the tag memory"
>
> I'm not able to understand what the prior filling part is about...
The JTAGICEmkII (and AVR Dragon) contains a kind of tag memory (called
`event memory' in appnote AVR067). Each bit in this memory
corresponds to one instruction word (16 bits) in the target's flash
memory area (so covering 256 KiB = 128 Ki instruction words takes 16
KiB of tag memory). AVR Studio 4, before starting the debugging
sessions, fills that tag memory and marks each memory location that
relates to the beginning of one high-level program line of code. This
information is then used when the JTAG ICE is asked to `step over'.
Here's the avarice -d log I mentioned above:
GDB: <m16a,27>
GDB: Read 39 bytes from 0x16A
jtagRead
command[0x05, 1]: 05 A0 28 00 00 00 6A 01 00 00
recv: 0x1b
recv: 0x15
recv: 0x00
recv: 0x29
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 41 bytes
read: 82 1f 93 cf 93 df 93 e9 df 83 e1 92 e0 90 93 25 02 80 93 24 02 c0 e0 d2
e0 00 d0 0f 92 ed b7 fe b7 31 96 ad b7 be b7 12 96
recv: 0x1f
recv: 0xa0
CRC OK
Got message seqno 21 (command_sequence == 21)
response: 82 1F 93 CF 93 DF 93 E9 DF 83 E1 92 E0 90 93 25 02 80 93 24 02 C0 E0
D2 E0 00 D0 0F 92 ED B7 FE B7 31 96 AD B7 BE B7 12 96
->GDB:
1f93cf93df93e9df83e192e09093250280932402c0e0d2e000d00f92edb7feb73196adb7beb712
GDB: <m191,11>
GDB: Read 17 bytes from 0x191
jtagRead
command[0x05, 1]: 05 A0 12 00 00 00 90 01 00 00
recv: 0x1b
recv: 0x16
recv: 0x00
recv: 0x13
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 19 bytes
read: 82 12 96 dc 93 ce 93 11 97 12 83 13 82 18 d0 90 91 02 01
recv: 0x52
recv: 0x16
CRC OK
Got message seqno 22 (command_sequence == 22)
response: 82 12 96 DC 93 CE 93 11 97 12 83 13 82 18 D0 90 91 02 01
->GDB: 96dc93ce9311971283138218d090910201
GDB: <Hc0>
->GDB:
GDB: <s>
command[0x09, 1]: 09 01 01
recv: 0x1b
recv: 0x17
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read: 80
recv: 0x04
recv: 0xc5
CRC OK
Got message seqno 23 (command_sequence == 23)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read: e0 d2 00 00 00 00
recv: 0xf1
recv: 0xc4
CRC OK
command[0x07, 1]: 07
recv: 0x1b
recv: 0x18
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d2 00 00 00
recv: 0x3d
recv: 0x95
CRC OK
Got message seqno 24 (command_sequence == 24)
response: 84 D2 00 00 00
command[0x07, 1]: 07
recv: 0x1b
recv: 0x19
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d2 00 00 00
recv: 0x68
recv: 0x10
CRC OK
Got message seqno 25 (command_sequence == 25)
response: 84 D2 00 00 00
jtagRead
command[0x05, 1]: 05 20 03 00 00 00 5D 00 00 00
recv: 0x1b
recv: 0x1a
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read: 82 f5 21 40
recv: 0x15
recv: 0xe6
CRC OK
Got message seqno 26 (command_sequence == 26)
response: 82 F5 21 40
->GDB: T0520:40;21:f521;22:a4010000;
GDB: <Z0,1a2,2>
BP ADD type: 1 addr: 0x1a2 ENABLED
Slot 0 full
Slot 1 full
->GDB: OK
GDB: <Hc0>
->GDB:
GDB: <s>
command[0x09, 1]: 09 01 01
recv: 0x1b
recv: 0x1b
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read: 80
recv: 0x66
recv: 0xfe
CRC OK
Got message seqno 27 (command_sequence == 27)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read: e0 d3 00 00 00 00
recv: 0xb5
recv: 0xcf
CRC OK
command[0x07, 1]: 07
recv: 0x1b
recv: 0x1c
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d3 00 00 00
recv: 0xf0
recv: 0x8c
CRC OK
Got message seqno 28 (command_sequence == 28)
response: 84 D3 00 00 00
command[0x07, 1]: 07
recv: 0x1b
recv: 0x1d
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d3 00 00 00
recv: 0xa5
recv: 0x09
CRC OK
Got message seqno 29 (command_sequence == 29)
response: 84 D3 00 00 00
jtagRead
command[0x05, 1]: 05 20 03 00 00 00 5D 00 00 00
recv: 0x1b
recv: 0x1e
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read: 82 f5 21 55
recv: 0x6c
recv: 0xff
CRC OK
Got message seqno 30 (command_sequence == 30)
response: 82 F5 21 55
->GDB: T0520:55;21:f521;22:a6010000;
GDB: <s>
command[0x09, 1]: 09 01 01
recv: 0x1b
recv: 0x1f
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read: 80
recv: 0xb8
recv: 0xe8
CRC OK
Got message seqno 31 (command_sequence == 31)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read: e0 d4 00 00 00 00
recv: 0x69
recv: 0xff
CRC OK
command[0x07, 1]: 07
recv: 0x1b
recv: 0x20
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d4 00 00 00
recv: 0x23
recv: 0xea
CRC OK
Got message seqno 32 (command_sequence == 32)
response: 84 D4 00 00 00
command[0x07, 1]: 07
recv: 0x1b
recv: 0x21
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d4 00 00 00
recv: 0x76
recv: 0x6f
CRC OK
Got message seqno 33 (command_sequence == 33)
response: 84 D4 00 00 00
jtagRead
command[0x05, 1]: 05 20 03 00 00 00 5D 00 00 00
recv: 0x1b
recv: 0x22
recv: 0x00
recv: 0x04
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 4 bytes
read: 82 f5 21 41
recv: 0xf9
recv: 0xd8
CRC OK
Got message seqno 34 (command_sequence == 34)
response: 82 F5 21 41
->GDB: T0520:41;21:f521;22:a8010000;
GDB: <s>
command[0x09, 1]: 09 01 01
recv: 0x1b
recv: 0x23
recv: 0x00
recv: 0x01
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 1 bytes
read: 80
recv: 0x52
recv: 0x3e
CRC OK
Got message seqno 35 (command_sequence == 35)
response: 80
Waiting for input.
recv: 0x1b
recv: 0xff
recv: 0xff
recv: 0x06
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 6 bytes
read: e0 d5 00 00 00 00
recv: 0x2d
recv: 0xf4
CRC OK
command[0x07, 1]: 07
recv: 0x1b
recv: 0x24
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d5 00 00 00
recv: 0xee
recv: 0xf3
CRC OK
Got message seqno 36 (command_sequence == 36)
response: 84 D5 00 00 00
command[0x07, 1]: 07
recv: 0x1b
recv: 0x25
recv: 0x00
recv: 0x05
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 5 bytes
read: 84 d5 00 00 00
recv: 0xbb
recv: 0x76
CRC OK
Got message seqno 37 (command_sequence == 37)
response: 84 D5 00 00 00
jtagRead
command[0x05, 1]: 05 0x00
recv: 0x1b
recv: 0x00
recv: 0x00
recv: 0x00
recv: 0x0e
sDATA: reading 27 bytes
read: 82 12 96 dc 93 ce 93 11 97 12 83 13 82 18 d0 90 91 02 01 81 2f 80 95 83
70 9c 7f
recv: 0xe1
recv: 0xfc
CRC OK
Got message seqno 56 (command_sequence == 56)
response: 82 12 96 DC 93 CE 93 11 97 12 83 13 82 18 D0 90 91 02 01 81 2F 80 95
83 70 9C 7F
->GDB: 96dc93ce9311971283138218d090910201812f809583709c7f
GDB: <z0,1a2,2>
BP DEL type: 1 addr: 0x1a2 DISABLED
->GDB: OK
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
avarice-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avarice-user