I am working with a blind student. She can run gdb from the command line to debug a window-based program, but the program takes the focus from gdb, so if a breakpoint is hit or the program crashes, the screen reader does not read the gdb result. Ideally, it would like if the focus would go to the terminal when it gets gdb output, but otherwise, is there a way to run a linux command when gdb hits a breakpoint or when the program crashes? Then I could run "espeak gdb" and she would know that gdb needs to get focus.
Seems there should be an easy way to do this using scripting in .gdbinit.
Edited later:
I figure out that you can put this code into .gdbinit:
python
import os
def stop_handler (event):
os.system("espeak gdb")
gdb.events.stop.connect (stop_handler)