GDB 7.11 vs. 7.12+ -- expected behaviour after posting a "continue" event?
Sat Feb 15 18:30:00 GMT 2020
I have a set of python scripts that execute "continue" via gdb.post_event() at some point. What I noticed is a weird behaviour after switching to GDB 7.12+. Initially, I've been using GDB 7.11.
Long story short is that once I execute a gdb.post_event() with a "continue" command, GDB 7.12+ no longer accepts CTRL+C as a way to interrupt the target app. Once I execute CTRL+C, I see "^CQuit" being printed in the console but target app is not being interrupted - "info program" says it's still running. However, if I type "interrupt", I see the program gets stopped. When using GDB 7.11, CTRL+C works as expected (from my point of view) after executing the gdb.post_event() with the "continue" command.
Steps to reproduce the described behaviours:
1. Build GDB 7.11 and GDB 8.3 (or GDB 7.12) with python support
2. Build a simple "test" app that executes an infinite loop; we'll use it for debugging
3. In do_continue.py, write a callable like the one below:
4. Experiment the following use case with the two GDB versions mentioned:
a. Start debugging - "gdb test"
b. Run the app - "run"
c. Hit CTRL+C; app must be correctly interrupted
d. Run the script with the gdb.post_event() - "source do_continue.py"; app will be running at this point
e. Press CTRL+C. Program gets interrupted when using GDB 7.11 but not when using GDB 8.3.
Can someone explain the behaviour seen in GDB 7.12+? Is it expected? How can I make GDB 7.12+ behave like GDB 7.11?
More information about the Gdb