Hi, This patch unbreaks issuing execution commands from a hook-stop: (top-gdb) define hook-stop Type commands for definition of "hook-stop". End with a line saying just "end". >continue >end (top-gdb) start Temporary breakpoint 3 at 0x44f027: file ../../src/gdb/gdb.c, line 28. Starting program: /home/pedro/gdb/baseline/build/gdb/gdb [Thread debugging using libthread_db enabled] Error while running hook_stop: Cannot execute this command while the selected thread is running. The issue is that we're running the hook-stop before tagging the threads as stopped (and before other things, like fixing the selected frame, storing registers for the finish command or an inferior function call). Fixed by running the hook-stop after all those things. New test included. Tested on x86_64-unknown-linux-gnu. OK? -- Pedro Alves