Debugging a program under Darwin does not work:
(gdb) start
Temporary breakpoint 1 at 0x100000fb4: file /tmp/helloworld.c, line 1.
Starting program: /private/tmp/helloworld
[New Thread 0x2903 of process 60326]
During startup program terminated with signal SIGTRAP, Trace/breakpoint
trap.
Field signaled from darwin_thread_info is not initialized thus signal
sent to
the debuggee is considered as not sent by GDB whereas it should.
This patch fixes this problem.
gdb/ChangeLog:
* darwin-nat.c (darwin_check_new_threads): Initialize signaled
field.
Change-Id: I02052473f1f8d28106cc343f440fa784b110bbf5
---
gdb/darwin-nat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 9ad4a87..bbd2700 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -341,6 +341,7 @@ darwin_check_new_threads (struct inferior *inf)
/* A thread was created. */
darwin_thread_info *pti = new darwin_thread_info;
+ pti->signaled = 0;
pti->gdb_port = new_id;
pti->msg_state = DARWIN_RUNNING;