Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to track down task ID's of RX errors? #3081

Closed
EduardPon opened this issue Oct 20, 2016 · 3 comments
Closed

How to track down task ID's of RX errors? #3081

EduardPon opened this issue Oct 20, 2016 · 3 comments

Comments

@EduardPon
Copy link

Is there a way to log the ID's and reference where this is done of task creation (threads/timers)?

Currently it is hard to track down which task ID runs into a RTX error.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 20, 2016

cc @c1728p9 @geky

@geky
Copy link
Contributor

geky commented Oct 21, 2016

You can use Thread::gettid function to access the thread's id when you spawn a thread. I believe this is the same id printed during errors.

I do know that the thread id is just a casted pointer to rtx's TCB structure (here). If you have a debugger connected you can get a hold of some pretty useful information.

For example with gdb:

set $tcb = (P_TCB)0x1b2b34
# The entry point of the thread
print/a $tcb->ptask    
# The current state of the thread
print (Thread::State)$tcb->state
# Recently called function
print/a ((int*)$tcb->tsk_stack)[13]
# Current stack pointer
print/a $tcb->tsk_stack

@bridadan
Copy link
Contributor

I'm guessing that @geky's answer solved your issue so I'll go ahead and close this. Please reopen it if you'd like to continue the discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants