{"action":"created","issue":{"url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/186","repository_url":"https://api.github.com/repos/gnuarmeclipse/plug-ins","labels_url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/186/comments","events_url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/186/events","html_url":"https://github.com/gnuarmeclipse/plug-ins/issues/186","id":212391585,"number":186,"title":"Question: gdb/openocd synchronization/possible race condition","user":{"login":"TM1234","id":14550604,"avatar_url":"https://avatars3.githubusercontent.com/u/14550604?v=3","gravatar_id":"","url":"https://api.github.com/users/TM1234","html_url":"https://github.com/TM1234","followers_url":"https://api.github.com/users/TM1234/followers","following_url":"https://api.github.com/users/TM1234/following{/other_user}","gists_url":"https://api.github.com/users/TM1234/gists{/gist_id}","starred_url":"https://api.github.com/users/TM1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TM1234/subscriptions","organizations_url":"https://api.github.com/users/TM1234/orgs","repos_url":"https://api.github.com/users/TM1234/repos","events_url":"https://api.github.com/users/TM1234/events{/privacy}","received_events_url":"https://api.github.com/users/TM1234/received_events","type":"User","site_admin":false},"labels":[{"id":249196990,"url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"ilg-ul","id":362732,"avatar_url":"https://avatars0.githubusercontent.com/u/362732?v=3","gravatar_id":"","url":"https://api.github.com/users/ilg-ul","html_url":"https://github.com/ilg-ul","followers_url":"https://api.github.com/users/ilg-ul/followers","following_url":"https://api.github.com/users/ilg-ul/following{/other_user}","gists_url":"https://api.github.com/users/ilg-ul/gists{/gist_id}","starred_url":"https://api.github.com/users/ilg-ul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilg-ul/subscriptions","organizations_url":"https://api.github.com/users/ilg-ul/orgs","repos_url":"https://api.github.com/users/ilg-ul/repos","events_url":"https://api.github.com/users/ilg-ul/events{/privacy}","received_events_url":"https://api.github.com/users/ilg-ul/received_events","type":"User","site_admin":false},"assignees":[{"login":"ilg-ul","id":362732,"avatar_url":"https://avatars0.githubusercontent.com/u/362732?v=3","gravatar_id":"","url":"https://api.github.com/users/ilg-ul","html_url":"https://github.com/ilg-ul","followers_url":"https://api.github.com/users/ilg-ul/followers","following_url":"https://api.github.com/users/ilg-ul/following{/other_user}","gists_url":"https://api.github.com/users/ilg-ul/gists{/gist_id}","starred_url":"https://api.github.com/users/ilg-ul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilg-ul/subscriptions","organizations_url":"https://api.github.com/users/ilg-ul/orgs","repos_url":"https://api.github.com/users/ilg-ul/repos","events_url":"https://api.github.com/users/ilg-ul/events{/privacy}","received_events_url":"https://api.github.com/users/ilg-ul/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2017-03-07T10:32:41Z","updated_at":"2017-04-05T19:47:20Z","closed_at":null,"body":"I hope it's OK to post this here in case anybody has some insight even though admittedly it's almost certainly not a GNU ARM Eclipse plugin issue per se (or at all) and I realise that the FAQ says to only post GNU ARM Eclipse issues.\r\n\r\nI see here (http://gnuarmeclipse.github.io/debug/openocd/) under \"Quote the entire echo command\" a snippet about gdb synchronizing with openocd using the -c 'echo \"Started by GNU ARM Eclipse\"' command.\r\n\r\nIs that the sum total of synchronization between gdb and openocd?\r\nAt what point does it happen?\r\nIn particular does that synchronization ensure that openocd has initialized fully (e.g. gdb/mi port 3333 and telnet port 4444 servers if applicable etc.) or just that it has started up but may still have initialization to do?\r\n\r\nMy problem is that in some cases it looks like gdb tries to attach to openocd's gdb/mi port 3333 before openocd has successfully initialized that \"server\" and I get this:\r\n\r\n```\r\nError in final launch sequence\r\nFailed to execute MI command:\r\n-target-select remote localhost:3333\r\nError message from debugger back end:\r\nlocalhost:3333: No connection could be made because the target machine actively refused it.\r\nFailed to execute MI command:\r\n-target-select remote localhost:3333\r\nError message from debugger back end:\r\nlocalhost:3333: No connection could be made because the target machine actively refused it.\r\nlocalhost:3333: No connection could be made because the target machine actively refused it.\r\n```\r\nSpecifically I don't  get this if I have one of our FlashPro programmers attached (driven by a custom JTAG driver that I have added to openocd). But if I have more than one then the added time taken to enumerate/init etc. these seems to delay openocd sufficiently that it has not yet initialized the gdb/mi port 3333 server by the time that gdb attempts to connect.\r\n\r\nHowever even though it has not happened to date with a single programmer attached it seems to me that there is some latent race condition between gdb and openocd and it was simply luck that avoided problems previously?\r\n\r\nAny tips on how to synchronize gdb and openocd in order to avoid this problem?\r\n\r\nThanks and apologies again if this is somewhat off topic from GNU ARM Eclipse proper.\r\n\r\nRegards\r\nTommy`"},"comment":{"url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/comments/291975958","html_url":"https://github.com/gnuarmeclipse/plug-ins/issues/186#issuecomment-291975958","issue_url":"https://api.github.com/repos/gnuarmeclipse/plug-ins/issues/186","id":291975958,"user":{"login":"ilg-ul","id":362732,"avatar_url":"https://avatars0.githubusercontent.com/u/362732?v=3","gravatar_id":"","url":"https://api.github.com/users/ilg-ul","html_url":"https://github.com/ilg-ul","followers_url":"https://api.github.com/users/ilg-ul/followers","following_url":"https://api.github.com/users/ilg-ul/following{/other_user}","gists_url":"https://api.github.com/users/ilg-ul/gists{/gist_id}","starred_url":"https://api.github.com/users/ilg-ul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilg-ul/subscriptions","organizations_url":"https://api.github.com/users/ilg-ul/orgs","repos_url":"https://api.github.com/users/ilg-ul/repos","events_url":"https://api.github.com/users/ilg-ul/events{/privacy}","received_events_url":"https://api.github.com/users/ilg-ul/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T19:47:20Z","updated_at":"2017-04-05T19:47:20Z","body":"> I presume that you build OpenOCD as-is\r\n\r\nthat's correct. unless absolutely needed, I avoid adding patches, since they increase maintenance cost.\r\n\r\nunfortunately your patch is not very fortunate, I would search for a more elaborate solution.\r\n\r\n"}}
{"actor":{"display_login":"ilg-ul"}}