On 03/16/2012 07:17 AM, Jan Kiszka wrote:
> Hook into machine restart/power-off/halt handlers and call gdbstub_exit
> so that a attached gdb frontend is properly informed. If kgdb is
> disabled or no frontend attached, gdbstub_exit will do nothing.
> 


We have long had an out of tree patch which hooked the reboot notifier, vs 
adding call backs to the actual reboot functions.  It seems at first glance 
that all of cases that Jan probably cares about are actually caught by the 
reboot notifier.

I attached the patch I am referencing, and perhaps Jan can try it out.   It 
applies on top of Jan's series at the moment.

A few more comments first.

>  static void __machine_emergency_restart(int emergency)
>  {
>       reboot_emergency = emergency;
> +     gdbstub_exit(1);


If we do have to add callbacks at the arch level, my preference is to pass the 
stop code like you would have received in the reboot notifier.  Specifically 
something like:  gdbstub_exit(SYS_RESTART).

>       machine_ops.emergency_restart();
>  }
>  
> @@ -730,6 +732,7 @@ struct machine_ops machine_ops = {
>  
>  void machine_power_off(void)
>  {
> +     gdbstub_exit(0);


Similarly gdbstub_exit(SYS_HALT) and so on.

Jan, what do you think about trying the reboot notifier version?

Thanks,
Jason.
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to