User forums > Help
Problem pausing debugger using TDM-GCC64, C::B v13.12
ollydbg:
I see some source code in GDB: windows-nat.c
--- Code: ---/* Wait for interesting events to occur in the target process. */
static ptid_t
windows_wait (struct target_ops *ops,
ptid_t ptid, struct target_waitstatus *ourstatus, int options)
{
int pid = -1;
target_terminal_ours ();
/* We loop when we get a non-standard exception rather than return
with a SPURIOUS because resume can try and step or modify things,
which needs a current_thread->h. But some of these exceptions mark
the birth or death of threads, which mean that the current thread
isn't necessarily what you think it is. */
while (1)
{
int retval;
/* If the user presses Ctrl-c while the debugger is waiting
for an event, he expects the debugger to interrupt his program
and to get the prompt back. There are two possible situations:
- The debugger and the program do not share the console, in
which case the Ctrl-c event only reached the debugger.
In that case, the ctrl_c handler will take care of interrupting
the inferior. Note that this case is working starting with
Windows XP. For Windows 2000, Ctrl-C should be pressed in the
inferior console.
- The debugger and the program share the same console, in which
case both debugger and inferior will receive the Ctrl-c event.
In that case the ctrl_c handler will ignore the event, as the
Ctrl-c event generated inside the inferior will trigger the
expected debug event.
FIXME: brobecker/2008-05-20: If the inferior receives the
signal first and the delay until GDB receives that signal
is sufficiently long, GDB can sometimes receive the SIGINT
after we have unblocked the CTRL+C handler. This would
lead to the debugger stopping prematurely while handling
the new-thread event that comes with the handling of the SIGINT
inside the inferior, and then stop again immediately when
the user tries to resume the execution in the inferior.
This is a classic race that we should try to fix one day. */
SetConsoleCtrlHandler (&ctrl_c_handler, TRUE);
retval = get_windows_debug_event (ops, pid, ourstatus);
SetConsoleCtrlHandler (&ctrl_c_handler, FALSE);
--- End code ---
So, it looks like CTRL+C should work. But I don't know how to send a CTRL+C from Codeblocks(32bit) to GDB(64bit).
oBFusCATed:
See the logic for interrupting the debugger for remote debugging on windows.
It opens a console and sends the SIGINT equivalent. On Linux I couldn't make sending SIGINT directly to gdb to work as far as I remember.
Navigation
[0] Message Index
[*] Previous page
Go to full version