Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt GDB #46

Open
c4deszes opened this issue Aug 31, 2020 · 2 comments
Open

Interrupt GDB #46

c4deszes opened this issue Aug 31, 2020 · 2 comments

Comments

@c4deszes
Copy link

Is your feature request related to a problem? Please describe.

#26 This method has since been removed.

#42 The resolution of this issue may not be applicable in every scenario and not all GDB targets support it, while my use case can be solved using -gdb-set target-async on I still feel there should be a method for interrupting execution that works on all platforms.

Describe the solution you'd like

A method that works consistently in all environments with most GDB implementations.

Also the GdbController constructor should have an argument that controls how the process is going to be started with regards to the child process' group.

Describe alternatives you've considered

Currently this line works, sort of:

self.gdbmi.gdb_process.send_signal(signal.CTRL_C_EVENT)

However the issue is that the Signal is also received by Python itself, which in my case causes Pytest to end abruptly in a KeyboardInterrupt exception.

This problem can be fixed by changing the signal handler, or the better way is to assign a new group to the child process, on Unix it's os.setgpid(pid, gid) and on Windows subprocess.Popen(command, ..., creationflags=subprocess.CREATE_NEW_PROCESS_GROUP).

Environment:

  • OS: Windows 10
  • pygdbmi version: 0.10.0.0
@cs01
Copy link
Owner

cs01 commented May 20, 2021

If you would like to put together a PR I would be open to this change

@Pardeep25
Copy link

We are also facing this issue tried above all suggestions but nothing is working for Ctrl-c event.
tried win32com also win32api.GenerateConsoleCtrlEvent(win32con.CTRL_C_EVENT, gdb_pid) but not working.

Can you please suggest some other ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants