GDB ignoring break points past the first one

2 posts / 0 new
Last post
Reth
Reth's picture
Offline
Last seen: 6 years 3 months ago
Joined: 2011-07-09 22:16
GDB ignoring break points past the first one
Hi everybody, is it just me or does this not work at all? Here on Peg2 I set two break points in one file. The first one at main, the second at line 364. GDB stops at the first break point as expected. But after pressing c for continue the program runs without any further breaks until termination. The second break point is completely ignored. Is this an internal AOS4-GBB-Problem or did I make sth. wrong/misunderstood sth.? Any hints/help highly appreciated for how becoming GDB to work with more than one breakpoint! Many thanks in advance! Bye
kas1e
kas1e's picture
Offline
Last seen: 3 hours 25 min ago
Joined: 2010-11-30 15:30
Sorry for late reply, but as

Sorry for late reply, but as i plays with GDB right now (public SDK version, update4, i.e. the same what you should have as well), i think that answer can be helpfull somehow. The answer is that breakpoints works on my peg2, check this out:

shell:> gdb -q some_test
(gdb) break main
Breakpoint 1 at 0x7fbdc020
(gdb) r
Starting program: some_test 
BS 6478f4f8
Current action: 2
 
Breakpoint 1, 0x7fbdc020 in main ()
(gdb) disas
Dump of assembler code for function main:
0x7fbdc020 <main+0>:  	lis     r9,25670
0x7fbdc024 <main+4>:  	lwz     r9,27416(r9)
0x7fbdc028 <main+8>:	lwz     r0,128(r9)
0x7fbdc02c <main+12>:	li      r4,0
0x7fbdc030 <main+16>:	li      r5,0
0x7fbdc034 <main+20>:	li      r6,0
0x7fbdc038 <main+24>:	mtctr   r0
0x7fbdc03c <main+28>:	bctrl
End of assembler dump.
(gdb) break *0x7fbdc03c
Breakpoint 2 at 0x7fbdc03c
(gdb) c
Continuing.
 
Breakpoint 2, 0x7fbdc03c in main ()
(gdb) stepi
0x01849e80 in ?? ()
 
(gdb) x/15i 0x01849e80
0x1849e80:	mflr    r0
0x1849e84:	stwu    r1,-80(r1)
0x1849e88:	stw     r27,60(r1)
0x1849e8c:	mr      r27,r5
0x1849e90:	stw     r28,64(r1)
0x1849e94:	mr      r28,r3
0x1849e98:	stw     r29,68(r1)
0x1849e9c:	mr      r29,r6
0x1849ea0:	stw     r31,76(r1)
0x1849ea4:	mr      r31,r4
0x1849ea8:	stw     r26,56(r1)
0x1849eac:	stw     r30,72(r1)
0x1849eb0:	stw     r0,84(r1)
0x1849eb4:	lwz     r9,16(r3)
0x1849eb8:	lwz     r30,8(r4)
(gdb) 

There i setup first breakpoint on main, then run programm, then setup breakpoint on the latest "bctrl" instuction,press "c" for continue and it stops on that second breakpoint. Then i go futher via "stepi" to the kernel, and dump some disassembled code from it after that. Did you have update4 and all the latest stuff ? Because with previous updates it may or may not works. Of course there can be problems beetwen different HW (like something works on peg2, but didn't works on sam, or other way), but as you have peg2 too, then its all should works the same as for me.

Log in or register to post comments