How can I prevent interrupts stepping out from my code while debugging?

331 Views Asked by At

I'm currently debugging the linux kernel and it's properly set up with kgdb.

I set a breakpoint to a function I am trying to debug, and the break occurs once I run my program which needs this kernel function to do something, this is wanted. But whenever I try to step through the code with "n" or "si", I always immediately land in arch/x86/include/asm/apic.h, which then runs some interrupt handling code and timers. I'm aware of the kernel being heavily parallelized so it has to move into some other code while being executed, but is it possible to step through the function more comfortably?

What I want to achieve:

before:

-> line A

line B

after:

line A

-> line B

What I have right now:

before:

-> line A

line B

after:

line A

... jumps into way different code here

1

There are 1 best solutions below

0
tyChen On

I think it's hard. Let's think if the interrupts are all aborted, then how can you put your order by keybord or mouse?