diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-03-15 13:53:25 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-03-15 13:53:25 +0000 |
commit | 73cc0963f8281351a50394710027e4cf5f475f5b (patch) | |
tree | d7cff9a5043406eb771e1b93f29dea381bc040e5 /gdb/mi/mi-main.c | |
parent | c3e3d5994cf7c416257245a0e312f6f69a36f7a6 (diff) | |
download | gdb-73cc0963f8281351a50394710027e4cf5f475f5b.tar.gz |
Implement -thread-info.
* gdbthread.h (print_thread_info): Declare.
* thread.c (print_thread_info): New, extracted
from info_threads_command and adjusted to
work for CLI and MI.
(info_threads_command): Use print_thread_info.
* Makefile.in: Update dependencies.
* mi/mi-cmds.c (mi_cmds): Specify a handler
for -thread-info.
* mi/mi-cmds.h (mi_cmd_thread_info): Declare.
* mi/mi-main.c (mi_cmd_thread_info): New.
(mi_cmd_list_features): Include 'thread-info'.
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r-- | gdb/mi/mi-main.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 41e12d2e4db..cea8503b1fa 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -277,6 +277,24 @@ mi_cmd_thread_list_ids (char *command, char **argv, int argc) } enum mi_cmd_result +mi_cmd_thread_info (char *command, char **argv, int argc) +{ + int thread = -1; + + if (argc != 0 && argc != 1) + { + mi_error_message = xstrprintf ("Invalid MI command"); + return MI_CMD_ERROR; + } + + if (argc == 1) + thread = atoi (argv[0]); + + print_thread_info (uiout, thread); + return MI_CMD_DONE; +} + +enum mi_cmd_result mi_cmd_data_list_register_names (char *command, char **argv, int argc) { int regnum, numregs; @@ -1055,6 +1073,7 @@ mi_cmd_list_features (char *command, char **argv, int argc) ui_out_field_string (uiout, NULL, "frozen-varobjs"); ui_out_field_string (uiout, NULL, "pending-breakpoints"); + ui_out_field_string (uiout, NULL, "thread-info"); do_cleanups (cleanup); |