aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2010-01-27 19:57:54 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2010-01-27 19:57:54 +0000
commit16d905e2bea111256aa322e7e76fa647d05dfd1f (patch)
tree4dbb2f4765c6715ffb055b9e5d3a3255583eba76 /gdb
parentde958931bce687e9105946cd2b2868d0d48db1cd (diff)
downloadfsf-binutils-gdb-16d905e2bea111256aa322e7e76fa647d05dfd1f.zip
fsf-binutils-gdb-16d905e2bea111256aa322e7e76fa647d05dfd1f.tar.gz
fsf-binutils-gdb-16d905e2bea111256aa322e7e76fa647d05dfd1f.tar.bz2
* windows-nat.c (windows_initialization_done): New variable.
(get_windows_debug_event): Issue error when process dies before completely initializing. (do_initial_windows_stuff): Set flag to indicate when we are done with the initial steps of attaching to the child.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/windows-nat.c22
2 files changed, 25 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cbfe494..0c6d99f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-27 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * windows-nat.c (windows_initialization_done): New variable.
+ (get_windows_debug_event): Issue error when process dies before
+ completely initializing.
+ (do_initial_windows_stuff): Set flag to indicate when we are done with
+ the initial steps of attaching to the child.
+
2010-01-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* symtab.h (struct symbol <symtab>): New comment on NULL values.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index f91ca32..2740366 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -123,6 +123,8 @@ enum
static uintptr_t dr[8];
static int debug_registers_changed;
static int debug_registers_used;
+
+static int windows_initialization_done;
#define DR6_CLEAR_VALUE 0xffff0ff0
/* The string sent by cygwin when it processes a signal.
@@ -1399,11 +1401,19 @@ get_windows_debug_event (struct target_ops *ops,
(unsigned) current_event.dwProcessId,
(unsigned) current_event.dwThreadId,
"EXIT_PROCESS_DEBUG_EVENT"));
- if (saw_create != 1)
- break;
- ourstatus->kind = TARGET_WAITKIND_EXITED;
- ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
- retval = main_thread_id;
+ if (!windows_initialization_done)
+ {
+ target_terminal_ours ();
+ target_mourn_inferior ();
+ error (_("During startup program exited with code 0x%x."),
+ (unsigned int) current_event.u.ExitProcess.dwExitCode);
+ }
+ else if (saw_create == 1)
+ {
+ ourstatus->kind = TARGET_WAITKIND_EXITED;
+ ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode;
+ retval = main_thread_id;
+ }
break;
case LOAD_DLL_DEBUG_EVENT:
@@ -1598,6 +1608,7 @@ do_initial_windows_stuff (struct target_ops *ops, DWORD pid, int attaching)
terminal_init_inferior_with_pgrp (pid);
target_terminal_inferior ();
+ windows_initialization_done = 0;
inf->stop_soon = STOP_QUIETLY;
while (1)
{
@@ -1610,6 +1621,7 @@ do_initial_windows_stuff (struct target_ops *ops, DWORD pid, int attaching)
break;
}
+ windows_initialization_done = 1;
inf->stop_soon = NO_STOP_QUIETLY;
stop_after_trap = 0;
return;