aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-main.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2008-03-15 13:53:25 +0000
committerVladimir Prus <vladimir@codesourcery.com>2008-03-15 13:53:25 +0000
commit8e8901c5c22072ecab98e3f3e121df2bf0aefc01 (patch)
tree25ab58963d0a6a3199cd4190561f6417efb5a435 /gdb/mi/mi-main.c
parent7d1e6fb8639f8b672daaa338744003b4b2595d37 (diff)
downloadgdb-8e8901c5c22072ecab98e3f3e121df2bf0aefc01.zip
gdb-8e8901c5c22072ecab98e3f3e121df2bf0aefc01.tar.gz
gdb-8e8901c5c22072ecab98e3f3e121df2bf0aefc01.tar.bz2
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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 41e12d2..cea8503 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);