I haven't examined the code in detail, but I'm using this message in 
riscv-tests and haven't encountered any problems so far. The real reason I 
added the message is to know the port that OpenOCD is actually listening on, 
when the caller sets it to 0.


---

** [tickets:#147] How to know when OpenOCD is fully ready?**

**Status:** new
**Milestone:** 0.9.0
**Created:** Tue Mar 07, 2017 11:29 PM UTC by Tommy Murphy
**Last Updated:** Mon Sep 11, 2017 04:40 PM UTC
**Owner:** nobody


Hi there - I searched the existing tickets but didn't see any obvious mention 
of this issue. 

I cannot see any way to know that OpenOCD is fully initialized and ready to 
accept connections - e.g.  GDB/MI connections on port 3333 (by default). For 
example the GNU ARM Eclipse plugins call OpenOCD with any user specified 
command line options as well as -c 'echo "Started by GNU ARM Eclipse"' and then 
waits for OpenOCD to output the string "Started by GNU ARM Eclipse" before 
starting gdb which will then connect to OpenOCD's GDB/MI socket interface via 
target remote ... etc. See 
https://github.com/gnuarmeclipse/plug-ins/issues/186#issuecomment-284703073. 

Liviu Ionescu (creator of GNU ARM Eclipse) chose this as the only way he could 
see to attempt to synchronize OpenOCD with gdb so that gdb was only launched 
when OpenOCD was ready. However there is still a race condition here as OpenOCD 
processes the echo command before it has fully initialized the target 
interface, opened/initialized the GDB/MI socket interface etc. In some cases 
OpenOCD may be fuly ready for gdb by the time that gdb connects but if the 
OpenOCD startup/init code takes "too long" then it may not and then gdb fails 
to connect. 

Is there any mechanism whereby a process can know that OpenOCD is "fully ready" 
before starting another process such as gdb which will connect to it? Even if 
OpenOCD output a simple string indicating that the relevant interface was 
initialized and ready for connections would help (e.g. Ready for GDB/MI 
connections on port 3333").

Any suggestions?

Thanks a lot.


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to