GDB 7.11 vs. 7.12+ -- expected behaviour after posting a "continue" event?

Adrian Oltean <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <AM6PR04MB63763B36A10C7C5C3CB9D7CCF1140@AM6PR04MB6376.eurprd04.prod.outlook.com>
Hi,

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:
import _gdb
class DoContinue():
    def __call__(self):
        _gdb.execute("continue")
_gdb.post_event(DoContinue())
  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?

Thank you,
Adrian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.