This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] 08/10 Enable thread commands
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 19 May 2008 16:19:43 +0100
- Subject: Re: [RFC] 08/10 Enable thread commands
- References: <200805061649.38195.pedro@codesourcery.com>
A Tuesday 06 May 2008 16:49:38, Pedro Alves wrote:
> Now that "info threads" and "thread n" work with a running
> inferior, we can enable them.
I had forgotten a ChangeLog entry. Here is one. Nothing else changed.
--
Pedro Alves
2008-05-19 Pedro Alves <pedro@codesourcery.com>
* thread.c: Include "cli/cli-decode.h".
(_initialize_thread): Mark "info threads" and "thread" and
async_ok.
---
gdb/Makefile.in | 2 +-
gdb/thread.c | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in 2008-05-19 12:38:26.000000000 +0100
+++ src/gdb/Makefile.in 2008-05-19 13:25:19.000000000 +0100
@@ -2932,7 +2932,7 @@ target-memory.o: target-memory.c $(defs_
thread.o: thread.c $(defs_h) $(symtab_h) $(frame_h) $(inferior_h) \
$(environ_h) $(value_h) $(target_h) $(gdbthread_h) $(exceptions_h) \
$(command_h) $(gdbcmd_h) $(regcache_h) $(gdb_h) $(gdb_string_h) \
- $(ui_out_h) $(observer_h)
+ $(ui_out_h) $(observer_h) $(cli_decode_h)
top.o: top.c $(defs_h) $(gdbcmd_h) $(call_cmds_h) $(cli_cmds_h) \
$(cli_script_h) $(cli_setshow_h) $(cli_decode_h) $(symtab_h) \
$(inferior_h) $(exceptions_h) $(target_h) $(breakpoint_h) \
Index: src/gdb/thread.c
===================================================================
--- src.orig/gdb/thread.c 2008-05-19 13:22:45.000000000 +0100
+++ src/gdb/thread.c 2008-05-19 13:25:19.000000000 +0100
@@ -41,6 +41,8 @@
#include "ui-out.h"
#include "observer.h"
+#include "cli/cli-decode.h"
+
/* Definition of struct thread_info exported to gdbthread.h */
/* Prototypes for exported functions. */
@@ -1003,14 +1005,17 @@ void
_initialize_thread (void)
{
static struct cmd_list_element *thread_apply_list = NULL;
+ struct cmd_list_element *c;
- add_info ("threads", info_threads_command,
- _("IDs of currently known threads."));
+ c = add_info ("threads", info_threads_command,
+ _("IDs of currently known threads."));
+ set_cmd_async_ok (c);
- add_prefix_cmd ("thread", class_run, thread_command, _("\
+ c = add_prefix_cmd ("thread", class_run, thread_command, _("\
Use this command to switch between threads.\n\
The new thread ID must be currently known."),
&thread_cmd_list, "thread ", 1, &cmdlist);
+ set_cmd_async_ok (c);
add_prefix_cmd ("apply", class_run, thread_apply_command,
_("Apply a command to a list of threads."),