Gdb/kgdb remote debugging, target auto rebooted short after hitting gdb breakpoint


I was remote debugging a loadable kernel module, with kgdb enabled on target and gdb-multiarch on a host, kdb wasn’t enabled though.

The flow is like this:

  1. The target was booted with kgdb driver registered, after bootup, cmd echo g >/proc/sysrq-trigger was issued and target rendered control and got halted.
  2. Ran gdb from host, a breakpoint for the module was set then control was returned back to target.
  3. Ran application on target which led the module ran and hit the breakpoint, target got halted and gave control to host gdb.
  4. Checking on the host gdb with some debugging info, however the target got rebooted by itself after 30sec to 1min from the point it got halted.

Anyone saw the same thing during remote debugging? I was expecting the target could get hang in there until host gdb gives back control though. Looks like something else got timed out and made kernel rebooted? Any idea about the cause?

Thank you.

I have not looked at it in a long time, but what you are experiencing is very likely the need to disable hardware watchdog timers. Is there anything someone might be able to offer on disabling watchdog timers for use in kdb/kgdboc (or even under hardware JTAG)?

1 Like

@linuxdev right on the point, it indeed is the watchdog timer. I rebuilt the kernel with CONFIG_WATCHDOG off, and it’s never auto rebooted since. Thank you!