{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4058","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4058/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4058/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4058/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/4058","id":109973720,"number":4058,"title":"cortex_m: Add debug symbols for OpenOCD/GDB thread support","user":{"login":"daniel-k","id":224128,"avatar_url":"https://avatars.githubusercontent.com/u/224128?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-k","html_url":"https://github.com/daniel-k","followers_url":"https://api.github.com/users/daniel-k/followers","following_url":"https://api.github.com/users/daniel-k/following{/other_user}","gists_url":"https://api.github.com/users/daniel-k/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-k/subscriptions","organizations_url":"https://api.github.com/users/daniel-k/orgs","repos_url":"https://api.github.com/users/daniel-k/repos","events_url":"https://api.github.com/users/daniel-k/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-k/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/arm","name":"arm","color":"dddddd"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/core","name":"core","color":"0052cc"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/new%20feature","name":"new feature","color":"e11d21"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/question","name":"question","color":"cc317c"},{"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Request%20for%20Comments","name":"Request for Comments","color":"23F823"}],"state":"open","locked":false,"assignee":{"login":"OlegHahm","id":1590423,"avatar_url":"https://avatars.githubusercontent.com/u/1590423?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegHahm","html_url":"https://github.com/OlegHahm","followers_url":"https://api.github.com/users/OlegHahm/followers","following_url":"https://api.github.com/users/OlegHahm/following{/other_user}","gists_url":"https://api.github.com/users/OlegHahm/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegHahm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegHahm/subscriptions","organizations_url":"https://api.github.com/users/OlegHahm/orgs","repos_url":"https://api.github.com/users/OlegHahm/repos","events_url":"https://api.github.com/users/OlegHahm/events{/privacy}","received_events_url":"https://api.github.com/users/OlegHahm/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/14","html_url":"https://github.com/RIOT-OS/RIOT/milestones/Release%202016.07","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/14/labels","id":1657251,"number":14,"title":"Release 2016.07","description":"","creator":{"login":"authmillenon","id":675644,"avatar_url":"https://avatars.githubusercontent.com/u/675644?v=3","gravatar_id":"","url":"https://api.github.com/users/authmillenon","html_url":"https://github.com/authmillenon","followers_url":"https://api.github.com/users/authmillenon/followers","following_url":"https://api.github.com/users/authmillenon/following{/other_user}","gists_url":"https://api.github.com/users/authmillenon/gists{/gist_id}","starred_url":"https://api.github.com/users/authmillenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/authmillenon/subscriptions","organizations_url":"https://api.github.com/users/authmillenon/orgs","repos_url":"https://api.github.com/users/authmillenon/repos","events_url":"https://api.github.com/users/authmillenon/events{/privacy}","received_events_url":"https://api.github.com/users/authmillenon/received_events","type":"User","site_admin":false},"open_issues":52,"closed_issues":0,"state":"open","created_at":"2016-03-21T13:28:08Z","updated_at":"2016-03-28T13:28:36Z","due_on":"2016-07-14T22:00:00Z","closed_at":null},"comments":17,"created_at":"2015-10-06T09:55:31Z","updated_at":"2016-03-28T14:46:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/4058","html_url":"https://github.com/RIOT-OS/RIOT/pull/4058","diff_url":"https://github.com/RIOT-OS/RIOT/pull/4058.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/4058.patch"},"body":"GDB has the ability to inspect threads, but to use this feature with RIOT the GDB-server, in this case OpenOCD, needs to know about the thread structures and the stacking. This PR introduces 2 new symbols in order to provide support for GDB threads.\r\n\r\nTo use this feature you need my patched OpenOCD version found [here](https://github.com/daniel-k/openocd/tree/riot_patched). I'm working on getting these patches upstream to OpenOCD so that one day this will be a default feature.\r\n\r\nI added the needed `-rtos auto` line to every board that has a `openocd.cfg` file, but only tested `stm32f4discovery` and `samr21-xpro` yet.\r\n\r\nOpenOCD can only access symbols, no struct offsets or define macros, so I introduced `max_threads` to iterate over `sched_threads` and `_tcb_name_offset` that will only be available when compiled with `DEVELHELP` to access the thread name. Although both symbols are declared as `volatile` they will be optimized away, so that's why I added the hack in `sched_task_exit()`. I'm sure there's a better way, so please tell me :)"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/202422618","html_url":"https://github.com/RIOT-OS/RIOT/pull/4058#issuecomment-202422618","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/4058","id":202422618,"user":{"login":"OlegHahm","id":1590423,"avatar_url":"https://avatars.githubusercontent.com/u/1590423?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegHahm","html_url":"https://github.com/OlegHahm","followers_url":"https://api.github.com/users/OlegHahm/followers","following_url":"https://api.github.com/users/OlegHahm/following{/other_user}","gists_url":"https://api.github.com/users/OlegHahm/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegHahm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegHahm/subscriptions","organizations_url":"https://api.github.com/users/OlegHahm/orgs","repos_url":"https://api.github.com/users/OlegHahm/repos","events_url":"https://api.github.com/users/OlegHahm/events{/privacy}","received_events_url":"https://api.github.com/users/OlegHahm/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T14:46:39Z","updated_at":"2016-03-28T14:46:39Z","body":"The question is: should we merge it here or wait for the review on the OpenOCD site?"}}