public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
* RFA: try opening thread agent only when all symbols requested
@ 2004-10-19 22:19 Jim Blandy
  2004-10-20 15:40 ` Kevin Buettner
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Blandy @ 2004-10-19 22:19 UTC (permalink / raw)
  To: rda


2004-10-19  Jim Blandy  <jimb@redhat.com>

	* thread-db.c (thread_db_get_gen): There's no reason to try to
	open a thread agent until we've at least requested values for all
	the symbols we know about.
	
Index: rda/unix/thread-db.c
===================================================================
RCS file: /cvs/src/src/rda/unix/thread-db.c,v
retrieving revision 1.6
diff -c -r1.6 thread-db.c
*** rda/unix/thread-db.c	19 Oct 2004 21:20:08 -0000	1.6
--- rda/unix/thread-db.c	19 Oct 2004 22:00:26 -0000
***************
*** 1088,1097 ****
  	    }
  	}
  
        /* Now the reply depends on whether there is another 
  	 symbol in need of lookup.  */
!       thread_db_open (serv, process->pid);
!       if ((symbol_query = next_undefined_symbol ()) == NULL)
  	{
  	  gdbserv_output_string (serv, "OK");
  	}
--- 1088,1117 ----
  	    }
  	}
  
+       /* If we have no more symbols to look up, try opening a thread
+ 	 agent.  It's possible that opening an agent could succeed
+ 	 before we have finished looking up all the symbols, but since
+ 	 we always loop until all the symbols we know about have been
+ 	 requested anyway, it's unnecessary.
+ 
+ 	 This ensures that ps_pglobal_lookup will always succeed in
+ 	 the case where we can obtain the full list of symbol names
+ 	 before opening the agent; this may be a little more robust
+ 	 than assuming it will handle all errors gracefully.
+ 	 
+ 	 Otherwise, if ps_pglobal_lookup fails, it will at least add
+ 	 the missing symbol's name to the list, and we'll request
+ 	 their values the next time around.  */
+       symbol_query = next_undefined_symbol ();
+       if (! symbol_query)
+ 	{
+ 	  thread_db_open (serv, process->pid);
+ 	  symbol_query = next_undefined_symbol ();
+ 	}
+ 
        /* Now the reply depends on whether there is another 
  	 symbol in need of lookup.  */
!       if (! symbol_query)
  	{
  	  gdbserv_output_string (serv, "OK");
  	}

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

* Re: RFA: try opening thread agent only when all symbols requested
  2004-10-19 22:19 RFA: try opening thread agent only when all symbols requested Jim Blandy
@ 2004-10-20 15:40 ` Kevin Buettner
  2004-10-20 19:23   ` Jim Blandy
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2004-10-20 15:40 UTC (permalink / raw)
  To: Jim Blandy; +Cc: rda

On 19 Oct 2004 17:17:44 -0500
Jim Blandy <jimb@redhat.com> wrote:

> 2004-10-19  Jim Blandy  <jimb@redhat.com>
> 
> 	* thread-db.c (thread_db_get_gen): There's no reason to try to
> 	open a thread agent until we've at least requested values for all
> 	the symbols we know about.

Okay.

Kevin

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

* Re: RFA: try opening thread agent only when all symbols requested
  2004-10-20 15:40 ` Kevin Buettner
@ 2004-10-20 19:23   ` Jim Blandy
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Blandy @ 2004-10-20 19:23 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: rda

Kevin Buettner <kevinb@redhat.com> writes:

> On 19 Oct 2004 17:17:44 -0500
> Jim Blandy <jimb@redhat.com> wrote:
> 
> > 2004-10-19  Jim Blandy  <jimb@redhat.com>
> > 
> > 	* thread-db.c (thread_db_get_gen): There's no reason to try to
> > 	open a thread agent until we've at least requested values for all
> > 	the symbols we know about.
> 
> Okay.

Committed, thanks.

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

end of thread, other threads:[~2004-10-20 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 22:19 RFA: try opening thread agent only when all symbols requested Jim Blandy
2004-10-20 15:40 ` Kevin Buettner
2004-10-20 19:23   ` Jim Blandy

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).