diff options
author | Doug Evans <dje@google.com> | 2011-05-10 16:53:23 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2011-05-10 16:53:23 +0000 |
commit | 84e578fbe67910f19ed0bbbc4e8aebd0f87c462a (patch) | |
tree | 913caccda7e412c55dba0287b11d7a797d54f7b0 /gdb/gdbserver | |
parent | 7e665af3af6fdf33dfcbecaa95ccdaa34b285008 (diff) | |
download | gdb-84e578fbe67910f19ed0bbbc4e8aebd0f87c462a.zip gdb-84e578fbe67910f19ed0bbbc4e8aebd0f87c462a.tar.gz gdb-84e578fbe67910f19ed0bbbc4e8aebd0f87c462a.tar.bz2 |
* linux-thread-db.c (set_libthread_db_search_path): New function.
(_initialize_thread_db): Add setter for libthread-db-search-path.
gdbserver/
* thread-db.c (thread_db_handle_monitor_command): Handle elided path.
doc/
* gdb.texinfo (Threads): If an empty path is provided for
libthread-db-search-path it is reset to its default value.
(Server): Ditto.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/gdbserver/thread-db.c | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index a29ee23..bea804d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2011-05-10 Doug Evans <dje@google.com> + + * thread-db.c (thread_db_handle_monitor_command): Handle elided path. + 2011-05-04 Doug Evans <dje@google.com> * linux-low.c (linux_join): Skip process lookup. diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index 529516e..872151e 100644 --- a/gdb/gdbserver/thread-db.c +++ b/gdb/gdbserver/thread-db.c @@ -916,9 +916,14 @@ thread_db_mourn (struct process_info *proc) int thread_db_handle_monitor_command (char *mon) { - if (strncmp (mon, "set libthread-db-search-path ", 29) == 0) + const char *cmd = "set libthread-db-search-path"; + size_t cmd_len = strlen (cmd); + + if (strncmp (mon, cmd, cmd_len) == 0 + && (mon[cmd_len] == '\0' + || mon[cmd_len] == ' ')) { - const char *cp = mon + 29; + const char *cp = mon + cmd_len; if (libthread_db_search_path != NULL) free (libthread_db_search_path); @@ -927,6 +932,8 @@ thread_db_handle_monitor_command (char *mon) while (isspace (*cp)) ++cp; + if (*cp == '\0') + cp = LIBTHREAD_DB_SEARCH_PATH; libthread_db_search_path = xstrdup (cp); monitor_output ("libthread-db-search-path set to `"); |