* remote-utils.c (all_symbols_looked_up): New variable.
authorDaniel Jacobowitz <drow@false.org>
Tue, 30 May 2006 19:05:33 +0000 (19:05 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 30 May 2006 19:05:33 +0000 (19:05 +0000)
(look_up_one_symbol): Check it.
* server.h (look_up_one_symbol): New declaration.
* thread-db.c (thread_db_init): Set all_symbols_looked_up.

gdb/gdbserver/ChangeLog
gdb/gdbserver/remote-utils.c
gdb/gdbserver/server.h
gdb/gdbserver/thread-db.c

index 250eea9babe63bd8aa32e4cd4b73b761395ce660..2881a26ae31d8c6a5d3fba7ff58d5218f86a16ad 100644 (file)
@@ -1,3 +1,10 @@
+2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * remote-utils.c (all_symbols_looked_up): New variable.
+       (look_up_one_symbol): Check it.
+       * server.h (look_up_one_symbol): New declaration.
+       * thread-db.c (thread_db_init): Set all_symbols_looked_up.
+
 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (linux-arm-low.o): Update dependencies.
index b8634e877fe31f8c64af702362647f9f7296f336..60403ff6bb481b305f6fef6e371b2a71aad512b2 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote utility routines for the remote server for GDB.
    Copyright (C) 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005
+   2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -52,6 +52,10 @@ struct sym_cache
 /* The symbol cache.  */
 static struct sym_cache *symbol_cache;
 
+/* If this flag has been set, assume cache misses are
+   failures.  */
+int all_symbols_looked_up;
+
 int remote_debug = 0;
 struct ui_file *gdb_stdlog;
 
@@ -769,6 +773,14 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp)
        return 1;
       }
 
+  /* If we've passed the call to thread_db_look_up_symbols, then
+     anything not in the cache must not exist; we're not interested
+     in any libraries loaded after that point, only in symbols in
+     libpthread.so.  It might not be an appropriate time to look
+     up a symbol, e.g. while we're trying to fetch registers.  */
+  if (all_symbols_looked_up)
+    return 0;
+
   /* Send the request.  */
   strcpy (own_buf, "qSymbol:");
   hexify (own_buf + strlen ("qSymbol:"), name, strlen (name));
index 88d35d04136e866d1c531e34df76dfe204efe52f..a659bbbe32ce54af435e5c0320929205c35e3731 100644 (file)
@@ -1,5 +1,6 @@
 /* Common definitions for remote server for GDB.
-   Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005
+   Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005,
+   2006
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -127,7 +128,9 @@ extern int server_waiting;
 
 extern jmp_buf toplevel;
 
-/* Functions from remote-utils.c */
+/* From remote-utils.c */
+
+extern int all_symbols_looked_up;
 
 int putpkt (char *buf);
 int getpkt (char *buf);
index b47f576d2e98f49b2e0aa0c04ad834468c9f5327..24531bf4194dfe609f1da68224dea02cc6d4c80b 100644 (file)
@@ -336,6 +336,9 @@ thread_db_init ()
      process in the list is the thread group leader.  */
   proc_handle.pid = ((struct inferior_list_entry *)current_inferior)->id;
 
+  /* Allow new symbol lookups.  */
+  all_symbols_looked_up = 0;
+
   err = td_ta_new (&proc_handle, &thread_agent);
   switch (err)
     {
@@ -350,6 +353,7 @@ thread_db_init ()
        return 0;
       thread_db_find_new_threads ();
       thread_db_look_up_symbols ();
+      all_symbols_looked_up = 1;
       return 1;
 
     default:
This page took 0.036285 seconds and 4 git commands to generate.