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: gdb stub execute check


Yoshinori Sato wrote:
Will not there be a method to judge to be it from target program whether gdb stub becomes active?
This is tricky, because a RAM loaded program may be communicating with the ROM for all its services. Only the ROM knows if a stub is present and if, for example, it is using the GDB channel as the console/debug channel.

The best you can do probably is use the hal_if.h functions to detect if the currently selected channel is the GDB "mangler". Do this by calling CYGACC_CALL_IF_SET_DEBUG_COMM( CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT ); and looking at the return code to see if it is CYGNUM_CALL_IF_SET_COMM_ID_MANGLER.

But if the user isn't connected to a debugger, that's not the same thing as *whether* there is a stub.

When gdb stub works when I output a message in serial port, I want to output it with protocol of gdb.
This should happen automatically when you connect via GDB in the first place. To force it later, set the debug channel (as above) and/or possibly your console channel, depending on your CDL config and what you're exactly trying to achieve, to the mangler channel ID ( CYGNUM_CALL_IF_SET_COMM_ID_MANGLER ).

Jifl
--
eCosCentric http://www.eCosCentric.com/ <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[ can rejoice because thorns have roses." -Lincoln ]-- Opinions==mine


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


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