tags:

views:

308

answers:

1

Is there a way to stop the inferior without using Ctrl+C (or an equivalent signal sent from another process?) I'm using a windows platform and am managing GDB from another process, so with no notion of signals, it seems that there isn't a good way to break execution of my program when it's free running without any breakpoints.

EDIT FOR CLARITY:

There are 2 processes involved here. There's process A, which is the parent of GDB. GDB is managing a process, but it's on a remote host, and we'll call that process C.

When I tell GDB to "run" it kicks off process C on the remote host and blocks either until a breakpoint is hit, process C encounters an error or a fatal signal, or GDB itself receives an interrupt signal. If working interactively, you would simply press CTRL+C at the GDB command console, which GDB interprets as a SIGINT (somehow), triggering GDB to halt process C. Since I'm actually managing GDB with process A (and not dealing with it interactively at the shell) I can't very well press Ctrl+C, and since windows has no native notion of "Signals" like you have in UNIX, I can't figure out how to interrupt GDB when it's blocking waiting for process C to interrupt or hit a breakpoint.

A: 

Hi Ryan, have you got already solution for it? I am also starting gdb from my process and cannot break execution of the "remote" process.If you'd have the solution, pls, let me know, I'll be very thankfull for the answer

Bye, Ifko

Ivo Kovacka
No, there isn't a way to do it that I found. The workaround for me is to use "target async" instead of "target remote" this connects to a target in asynchronous mode, where even when running, the control is returned to the controlling process, so that a halt of the "remote" process is possible.
Ryan