This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
arm-elf-gdb (target remote) -- finish command issue
- From: "Michael Anburaj" <embeddedeng at hotmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Cc: gary at mlbassoc dot com
- Date: Fri, 18 Feb 2005 18:49:40 +0000
- Subject: [ECOS] arm-elf-gdb (target remote) -- finish command issue
- Bcc:
Hi,
This issue is to do with arm-elf-gdb ?w (insight - 5.3) not doing the
expected thing (I may be wrong) when ?finish? command is issued while the PC
is inside a routine. It is supposed to finish the current routine & go back
to the caller & break at the statement next to the call made to this
function. But, it?s not happening.
Details:
--------
Setup: ?arm-elf-gdb ?w? invoked with the elf image build with ?g option.
Target: remote serial <LPC board with remote serial gdb stubs>.
Observation: Loads fine, can see all the registers, breakpoints & single
step works great.
Now to the problem:
Assembly dump of code portion I was debugging:
4000128a: 4843 ldr r0, [pc, #268] (40001398 <.text+0x398>)
4000128c: f950f000 bl 40001530 <CONSOL_SendString>
40001290: 2400 mov r4, #0
40001292: 2101 mov r1, #1
40001294: 2200 mov r2, #0
40001530 <CONSOL_SendString>:
40001530: b510 push {r4, lr}
40001532: 1c04 mov r4, r0 (add r4, r0, #0)
40001534: e003 b 4000153e <CONSOL_SendString+0xe>
40001536: 0e00 lsr r0, r0, #24
40001538: 3401 add r4, #1
4000153a: ffe9f7ff bl 40001510 <CONSOL_SendCh>
4000153e: 7820 ldrb r0, [r4, #0]
40001540: 0600 lsl r0, r0, #24
40001542: 2800 cmp r0, #0
40001544: d1f7 bne 40001536 <CONSOL_SendString+0x6>
40001546: bc10 pop {r4}
40001548: bc01 pop {r0}
4000154a: 4700 bx r0
I stepped into CONSOL_SendString called from 0x4000128c. Then, while PC is
still inside this function I issued the ?finish? command. Instead of
stopping at 0x40001290, it just continued without stopping.
GDB protocol dump (close to the problem area):
c printf "Program stopped at 0x%lx",0x40001536
c finish
w $m4000fcf0,4#f0
r +$91120040#91
w +$m40001274,2#5d
r +$10b5#f8
w +$m40001276,2#5f
r +$81b0#fb
w +$m40001274,2#5d
r +$10b5#f8
w +$M40001274,2:bebe#05
r +$OK#9a
w +$m40001290,2#5b
r +$0024#c6
w +$M40001290,2:bebe#03
r +$OK#9a
w +$c#63
r +$S05#b8
w +$g#67
r
+$911200400a00000014c000e00b000000000000000000000000000000000000000000000000000000000000000000000075120040f4fc004021150040901200400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003300002033000060#cc
w +$M40001274,2:10b5#6f
r +$OK#9a
w +$M40001290,2:0024#3b
r +$OK#9a
w +$Hc0#db
r +$#00
w +$s#73
r +$S05#b8
w +$g#67
r
+$911200400a00000014c000e00b000000000000000000000000000000000000000000000000000000000000000000000075120040f4fc004021150040921200400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003300006033000060#d2
w +$m40001274,2#5d
r +$10b5#f8
w +$M40001274,2:bebe#05
r +$OK#9a
w +$m40001290,2#5b
r +$0024#c6
w +$M40001290,2:bebe#03
r +$OK#9a
w +$Hc0#db
r +$#00
w +$c#63
The follow things happen after the ?finish? command was issued:
1. User: issues a ?finish? command
2. GDB: sets a breakpoint at the right location, 0x40001290. The right place
at the caller just after the function call.
3. GDB: issues a ?continue? command
4. Target: breaks at 0x40001290
5. GDB: clears the breakpoint & issues a single step command
6. Target: stops at the next location, 0x40001292
7. GDB: sets the breakpoint back at 0x40001290 & issues a continue command
Steps 2 & 3 are the expected ones & after the target breaks at the
0x40001290 (the right spot at the caller for the finish command), GDB should
return to the user for further commands. Why is it doing steps 5 & 7 on its
own?
I tried the same with mips-isa32elf-gdb. It does steps 2 & 3 only & returns
the control to the user after 4.
Let me know the reason for this.
Thanks,
-Mike.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss