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: redboot gdb async break support for mips


Andy Dyer wrote:
I'm trying to figure out how gdb async break support is supposed to work on MIPS. I have some test code
that never enables interrupts, it just blinks LEDs
and runs in a long loop. If I load the code with
gdb from redboot and run it, gdb async breaks will not work. After loading the code if I set the MIPS
global interrupt enable in gdb ('set $sr |= 0x01')
and then run it, async breaks work as expected.
Is this the expected behavior (ie the application
would have to enable interrupts)?

Yes. When the eCos kernel starts, that would enable interrupts. If you're doing stuff without the kernel or before it starts, then you need to enable them yourself if you want it to work.


If I look in redboot/current/src/main.c trampoline()
I see a call to HAL_DISABLE_INTERRUPTS before the call
to the breakpoint() function that actually kicks me
into the gdb stubs.  This clears bit 0 of the status
register, disabling interrupts and causing the register
saved version of the status register to have interrupts
disabled once the gdb stubs get to it.

Yep.


On exit from the stubs (the gdb continue command)
execution passes through handle_exception_init (hal_stub.c)
and the interruptible() function sets up the COMMS stuff to
handle the serial interrupt.

Yep. All ready for the global interrupts to be enabled later :-).


Should it (or some other code) also enable the interrupt in
the register saved version of $sp before the gdb stub returns
control to the downloaded code?

Nope. Programs rely on this behaviour in fact - you don't need to worry about interrupts until after cyg_start has had a chance to set things up.


Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
>>>>> Visit us in booth 2527 at the Embedded Systems Conference 2004 <<<<<
March 30 - April 1, San Francisco http://www.esconline.com/electronicaUSA/
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine


-- 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]