aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-05-30 19:05:33 +0000
committerDaniel Jacobowitz <drow@false.org>2006-05-30 19:05:33 +0000
commitea025f5f6106407104418941ea81bebc41e12661 (patch)
tree2386ae588f3f7f9475334db4de3b4acdf9968e12 /gdb/gdbserver
parent24718e3ba575439155f233fc593a9ebd6d33f3c5 (diff)
downloadgdb-ea025f5f6106407104418941ea81bebc41e12661.zip
gdb-ea025f5f6106407104418941ea81bebc41e12661.tar.gz
gdb-ea025f5f6106407104418941ea81bebc41e12661.tar.bz2
* 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.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/remote-utils.c14
-rw-r--r--gdb/gdbserver/server.h7
-rw-r--r--gdb/gdbserver/thread-db.c4
4 files changed, 29 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 250eea9..2881a26 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,12 @@
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.
* linux-arm-low.c: Include "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index b8634e8..60403ff 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -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));
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 88d35d0..a659bbb 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -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);
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index b47f576..24531bf 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -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: