To ignore SIGALRM signals while single-stepping, but treat them normally during normal execution, you could define:
define hook-stop
handle SIGALRM nopass
end
define hook-run
handle SIGALRM pass
end
define hook-continue
handle SIGLARM pass
end
NB: recorded in ~gallinar/.gdbinit, which is read automatically by gdb if gallinar or which can be sourced (within gdb) if root.