This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

Re: arm-elf-gdb (target remote) -- breakpoint issue


Hi Gary,

Thanks for the email. I had some email issues & did not see this email until now. With the -g option it works great!

I have posted another issue which is to do with the finish command. Let me know your thoughts on it.

Thanks a lot,
-Mike.

From: Gary Thomas <gary@mlbassoc.com>
To: Michael Anburaj <embeddedeng@hotmail.com>
CC: eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] arm-elf-gdb (target remote) -- breakpoint issue
Date: Mon, 07 Feb 2005 06:35:18 -0700

On Mon, 2005-02-07 at 13:24 +0000, Michael Anburaj wrote:
> Hi,
>
> Tools used:
> GNU gdb 5.3 (insight)
> LPC2106 board running ARM remote GDB stubs (over UART)
>
> Short description:
> When I try to set a breakpoint at a thumb C-function starting at address
> 0x40000278, GDB debugger (insight) sends a (GDB protocol) command to write
> 0xbebe (Instruction which would generate a Undef exception) at 0x40000282 &
> not at 0x40000278. Which is actually the functionÿs exit & not the entry.
>
> Detailed description:
> I issue the following commands on the GDBÿs console
>
> $ target /dev/com1
> $ load
> $ b APP_vMain
> $ c
>
> And GDB log file reads as follows <Just the important lines are included
> here>:
>
> c b APP_vMain
> w $m40000278,2#60
> r +$00b5#f7
> w +$m4000027a,2#89
> r +$0248#ce
> w +$m4000027c,2#8b
> r +$00f0#f6
> w +$m4000027e,2#8d
> r +$02fb#2a
> w +$m40000280,2#59
> r +$01bc#26
> w +
> c c
> w $Z0,40000282,2#a4
> r +$#00
> w +$m40000282,2#5b
> r +$0047#cb
> w +$M40000282,2:bebe#03
> r +$OK#9a
> w +$Hc0#db
>
>
> Clipping from the image disassembly around APP_vMain() function:
>
> 40000274: 4000fc00 andmi pc, r0, r0, lsl #24
>
> 40000278 <APP_vMain>:
> 40000278: b500 push {lr}
> 4000027a: 4802 ldr r0, [pc, #8] (40000284 <.text+0x184>)
> 4000027c: fb02f000 bl 40000884 <CONSOL_SendString>
> 40000280: bc01 pop {r0}
> 40000282: 4700 bx r0
> 40000284: 0ff0 lsr r0, r6, #31
> 40000286: 4000 and r0, r0
>
> GDB reads the 1st 5 instructions staring 0x40000274 (APP_vMain) & finally
> sets the Break (Undef) instruction at the 6th instruction. Why?


Because that's the first user instruction in the function.
The first 5 instructions are the function preamble.

>
> Please help me understand the issue behind this.

Do you have a problem, other than the location chosen for the
breakpoint?  Does it work (or not)?

--
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------




-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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