(oops, let me reply again; there are *three* ways :) )

On Wed, Feb 15, 2012 at 4:40 AM, Javier Pimás <elpochodelagente@gmail.com> wrote:
 
I want to debug asm instruction per instruction with gdb, but the heartbeat keeps interrupting. Is there a way to disable it or make gdb ignore it in some way?

Yes, at three levels.  First, signals, via

handle SIGUSR1 nostop noprint noignore
handle SIGUSR2 nostop noprint noignore
handle SIGALRM nostop noprint noignore
handle SIGPOLL nostop noprint noignore
handle SIGPIPE nostop noprint noignore

etc.  This can and should be put in ~/.gdbinit (find mine attached; note its called gdbinit only because I can't attach .gdbinit; you need to rename it when you install it; pbreg prints my Bochs instance in the JIT simulator; feel free to delete that :) )


Second, to avoid the effect that the heartbeat has on control flow (e.g. causing a process switch) you can set suppressHeartbeatFlag to 1, while running via

(gdb) set var suppressHeartbeatFlag = 1

or from start-up via the -noheartbeat flag, e.g.

(gdb) run -noheartbeat myimage.image

HTH
Eliot
 
Cheers,
Javier

--
Lic. Javier Pimás
Ciudad de Buenos Aires