Re: APP cannot be interrupted to gdb console by contrl+c, if APP enters into kernel mode via ioctl.

Paul Koning via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>

> On Feb 2, 2021, at 7:13 AM, He Leon via Gdb <[email protected]> wrote:
> 
> Hi all,
> 
> I meet an issue while debugging APP by gdb.
> 
> I have a very simple APP and a very simple Kernel Mode Driver. APP accesses Kernel Mode Driver via IOCTL.
> 
> When I debug APP in User Mode by gdb, I found if APP enters and stays inside IOCTL, the APP cannot be interrupted to gdb console by control+C.
> 
> The issue is quite easy to be reproduced. I have reproduced it over different versions of kernel or gdb.
> 
> Is there such limitation for: gdb doesn't work if APP enters and stays in kernel mode?

Of course, and that is true for every debugger.  Debugger interrupt works by delivering a signal to the process.  If the process is in a state where a signal can't be delivered to it (such as in a driver operation which you have coded not to be interruptable) then the signal remains pending until the blocking operation finishes.

You probably need to do some kernel mode debugging to fix your driver first.

	paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.