public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* New gdbserver failures
@ 2010-04-12 14:48 H.J. Lu
  2010-04-12 14:54 ` H.J. Lu
  2010-04-12 15:00 ` Pedro Alves
  0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 2010-04-12 14:48 UTC (permalink / raw)
  To: GDB, Pedro Alves

On Linux/x86-64, I saw

FAIL: gdb.server/ext-attach.exp: attach to remote program 2
FAIL: gdb.server/ext-attach.exp: backtrace 2

They weren't there on April 11, 2010. I got

gnu-18:pts/4[18]> ./gdbserver-old --multi gnu-18:10000
Listening on port 10000
Remote debugging from host 172.25.70.137
readchar: Got EOF
Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 10000
Remote debugging from host 172.25.70.137
Process 64 created; pid = 25716
Detaching from process 25716
1.100000
Cannot attach to lwp 25716: Operation not permitted (1)


-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New gdbserver failures
  2010-04-12 14:48 New gdbserver failures H.J. Lu
@ 2010-04-12 14:54 ` H.J. Lu
  2010-04-12 15:00 ` Pedro Alves
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2010-04-12 14:54 UTC (permalink / raw)
  To: GDB, Pedro Alves

On Mon, Apr 12, 2010 at 7:48 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Linux/x86-64, I saw
>
> FAIL: gdb.server/ext-attach.exp: attach to remote program 2
> FAIL: gdb.server/ext-attach.exp: backtrace 2
>
> They weren't there on April 11, 2010. I got
>
> gnu-18:pts/4[18]> ./gdbserver-old --multi gnu-18:10000
> Listening on port 10000
> Remote debugging from host 172.25.70.137
> readchar: Got EOF
> Remote side has terminated connection.  GDBserver will reopen the connection.
> Listening on port 10000
> Remote debugging from host 172.25.70.137
> Process 64 created; pid = 25716
> Detaching from process 25716
> 1.100000
> Cannot attach to lwp 25716: Operation not permitted (1)
>
>
> --
> H.J.
>

It is caused by

http://sourceware.org/ml/gdb-patches/2010-04/msg00330.html

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New gdbserver failures
  2010-04-12 14:48 New gdbserver failures H.J. Lu
  2010-04-12 14:54 ` H.J. Lu
@ 2010-04-12 15:00 ` Pedro Alves
  2010-04-12 17:45   ` Pedro Alves
  1 sibling, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2010-04-12 15:00 UTC (permalink / raw)
  To: gdb-patches; +Cc: H.J. Lu

On Monday 12 April 2010 15:48:03, H.J. Lu wrote:
> On Linux/x86-64, I saw
> 
> FAIL: gdb.server/ext-attach.exp: attach to remote program 2
> FAIL: gdb.server/ext-attach.exp: backtrace 2

Sigh, these tests _don't_ run with --target_board=native-gdbserver,
only when testing native.

Thanks, I'll take a look.

> 
> They weren't there on April 11, 2010. I got
> 
> gnu-18:pts/4[18]> ./gdbserver-old --multi gnu-18:10000
> Listening on port 10000
> Remote debugging from host 172.25.70.137
> readchar: Got EOF
> Remote side has terminated connection.  GDBserver will reopen the connection.
> Listening on port 10000
> Remote debugging from host 172.25.70.137
> Process 64 created; pid = 25716
> Detaching from process 25716
> 1.100000
> Cannot attach to lwp 25716: Operation not permitted (1)

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: New gdbserver failures
  2010-04-12 15:00 ` Pedro Alves
@ 2010-04-12 17:45   ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2010-04-12 17:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: H.J. Lu

On Monday 12 April 2010 15:59:53, Pedro Alves wrote:
> On Monday 12 April 2010 15:48:03, H.J. Lu wrote:
> > On Linux/x86-64, I saw
> > 
> > FAIL: gdb.server/ext-attach.exp: attach to remote program 2
> > FAIL: gdb.server/ext-attach.exp: backtrace 2

> Thanks, I'll take a look.

When I originaly added the target->mourn callback,
I had a little back and forth deciding who should call
remote_process, and ended up leaving things only
half consistent ( if you know what I mean :-) ).  The 
current problem is that linux_detach was mourning the
inferior, but that was forgetting to also remove
the process from the processes table.  Targets other
than linux would also be crashing, as the target->mourn
callback was being called unconditionally...  Duh on me.

Anyway, this fixes it, and I've applied it, after
confirming it fixes the regression, and after running
the testsuite against gdbserver as well.

Thanks.

-- 
Pedro Alves

2010-04-12  Pedro Alves  <pedro@codesourcery.com>

	gdb/gdbserver/
	* linux-low.c (linux_mourn): Also remove the process.
	* server.c (handle_target_event): Don't remove the process here.
	* nto-low.c (nto_mourn): New.
	(nto_target_ops): Install it.
	* spu-low.c (spu_mourn): New.
	(spu_target_ops): Install it.
	* win32-low.c (win32_mourn): New.
	(win32_target_ops): Install it.

---
 gdb/gdbserver/linux-low.c |    2 ++
 gdb/gdbserver/nto-low.c   |    8 +++++++-
 gdb/gdbserver/server.c    |    5 +----
 gdb/gdbserver/spu-low.c   |    8 +++++++-
 gdb/gdbserver/win32-low.c |    8 +++++++-
 5 files changed, 24 insertions(+), 7 deletions(-)

Index: src/gdb/gdbserver/linux-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-low.c	2010-04-12 18:06:02.000000000 +0100
+++ src/gdb/gdbserver/linux-low.c	2010-04-12 18:15:02.000000000 +0100
@@ -901,6 +901,8 @@ linux_mourn (struct process_info *proces
   free (priv->arch_private);
   free (priv);
   process->private = NULL;
+
+  remove_process (process);
 }
 
 static void
Index: src/gdb/gdbserver/server.c
===================================================================
--- src.orig/gdb/gdbserver/server.c	2010-04-12 18:14:31.000000000 +0100
+++ src/gdb/gdbserver/server.c	2010-04-12 18:15:13.000000000 +0100
@@ -2999,10 +2999,7 @@ handle_target_event (int err, gdb_client
 
       if (last_status.kind == TARGET_WAITKIND_EXITED
 	  || last_status.kind == TARGET_WAITKIND_SIGNALLED)
-	{
-	  mourn_inferior (process);
-	  remove_process (process);
-	}
+	mourn_inferior (process);
 
       if (forward_event)
 	{
Index: src/gdb/gdbserver/nto-low.c
===================================================================
--- src.orig/gdb/gdbserver/nto-low.c	2010-04-12 18:14:44.000000000 +0100
+++ src/gdb/gdbserver/nto-low.c	2010-04-12 18:18:17.000000000 +0100
@@ -406,6 +406,12 @@ nto_detach (int pid)
   return 0;
 }
 
+static void
+nto_mourn (struct process_info *process)
+{
+  remove_process (process);
+}
+
 /* Check if the given thread is alive.  
 
    Return 1 if alive, 0 otherwise.  */
@@ -900,7 +906,7 @@ static struct target_ops nto_target_ops 
   nto_attach,
   nto_kill,
   nto_detach,
-  NULL, /* nto_mourn */
+  nto_mourn,
   NULL, /* nto_join */
   nto_thread_alive,
   nto_resume,
Index: src/gdb/gdbserver/spu-low.c
===================================================================
--- src.orig/gdb/gdbserver/spu-low.c	2010-04-12 18:14:41.000000000 +0100
+++ src/gdb/gdbserver/spu-low.c	2010-04-12 18:17:53.000000000 +0100
@@ -355,6 +355,12 @@ spu_detach (int pid)
 }
 
 static void
+spu_mourn (struct process_info *process)
+{
+  remove_process (process);
+}
+
+static void
 spu_join (int pid)
 {
   int status, ret;
@@ -606,7 +612,7 @@ static struct target_ops spu_target_ops 
   spu_attach,
   spu_kill,
   spu_detach,
-  NULL, /* mourn */
+  spu_mourn,
   spu_join,
   spu_thread_alive,
   spu_resume,
Index: src/gdb/gdbserver/win32-low.c
===================================================================
--- src.orig/gdb/gdbserver/win32-low.c	2010-04-12 18:14:39.000000000 +0100
+++ src/gdb/gdbserver/win32-low.c	2010-04-12 18:17:14.000000000 +0100
@@ -763,6 +763,12 @@ win32_detach (int pid)
   return 0;
 }
 
+static void
+win32_mourn (struct process_info *process)
+{
+  remove_process (process);
+}
+
 /* Wait for inferiors to end.  */
 static void
 win32_join (int pid)
@@ -1752,7 +1758,7 @@ static struct target_ops win32_target_op
   win32_attach,
   win32_kill,
   win32_detach,
-  NULL,
+  win32_mourn,
   win32_join,
   win32_thread_alive,
   win32_resume,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-12 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12 14:48 New gdbserver failures H.J. Lu
2010-04-12 14:54 ` H.J. Lu
2010-04-12 15:00 ` Pedro Alves
2010-04-12 17:45   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).