12

I'm currently debugging kernel code using KGDB. Whenever I break in I naturally jump to the interrupt handler for kgdb. Under GDB I ran the following command.

info threads 

and the output would be

7    Thread 7 (rcu_sched) 0x0000000000000000 in irq_stack_union ()

6    Thread 5 (kworker/0:0H) 0x0000000000000000 in irq_stack_union ()

5    Thread 3 (ksoftirqd/0) 0x0000000000000000 in irq_stack_union ()

4    Thread 2 (kthreadd) 0x0000000000000000 in irq_stack_union ()

3    Thread 1 (init)   0x0000000000000000 in irq_stack_union ()

2    Thread 3754 (Xorg) 0x0000000000000000 in irq_stack_union ()

* 1    Thread 4294967294 (shadowCPU0) kgdb_breakpoint ()

    at kernel/debug/debug_core.c:1042

I would then jump through the code expecting to end up in a different thread (I'm interested in Xorg) however after i step through the code the next executing thread becomes cpu idle.

info thread

* 1    Thread 4294967294 (shadowCPU0) cpu_idle_loop () at kernel/cpu/idle.c:116

How can I switch my debug context to Xorg or any other thread, additionally what does irq_stack_union () mean. Thread is idle pending interrupts?

1 Answer 1

16

According to the offical documentation is is just thread threadno https://sourceware.org/gdb/onlinedocs/gdb/Threads.html

Sign up to request clarification or add additional context in comments.

2 Comments

I've tried this, though this seems to change context for viewing thread info only. Whenever I start stepping it would go back to cpu idle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.