This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: Remote Stub operation.




On Wed, 29 May 2002, Paul Breed wrote:

> I'm working with a remote serial stub.
> I completely understand the protocol definition,
> but I am looking for some input on the logical operation of the system.
>
> When my stub starts up the stub setup code has a built in breakpoint
> where it stops and waits for GDB, this works well.
>
> However I would like to have the system start up and run normally while
> it waits for GDB to connect.


1. You have to use interrupt driven serial driver on the gdb connection,
   with simple logic:

       if(received_char == 0x3)
         {
            turn_on_tace_bit_in_saved_status_word();
         }

       return_from_interrupt();

2. You have to configure your gdb remote subsystem to send CTRL-C instead
   of BREAK(so you can debug through remote terminal servers).
   Remote used to send break when it starts, I suppose it is still true
   for newer versions of gdb, make sure that this is still the case for
   the version of gdb you are using.

3. Check RTEMS i386 BSP - it does exactly this.

>
> How should the stub respond when the application is already running?

Upon return from interrupt, the saved status word will be restored,
this word would contain trace bit, you will get a trace exception
which will be handled in normal way.

>
> Is there anyway to have GDB try to stop the target if the normal target
> connect fails.

???? Press reset button and try again ????

>
> Paul

Thanks,

Aleksey



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