[RFA] Implement -thread-info.

Nick Roberts nickrob@snap.net.nz
Tue Feb 26 00:58:00 GMT 2008


 > --- a/gdb/mi/mi-cmds.c
 > +++ b/gdb/mi/mi-cmds.c
 > @@ -130,8 +130,7 @@ struct mi_cmd mi_cmds[] =
 >    { "target-list-current-targets", { NULL, 0 }, NULL, NULL },
 >    { "target-list-parameters", { NULL, 0 }, NULL, NULL },
 >    { "target-select", { NULL, 0 }, mi_cmd_target_select},
 > -  { "thread-info", { NULL, 0 }, NULL, NULL },
 > -  { "thread-list-all-threads", { NULL, 0 }, NULL, NULL },
 > +  { "thread-info", { NULL, 0 }, NULL, mi_cmd_thread_info },
 >    { "thread-list-ids", { NULL, 0 }, 0, mi_cmd_thread_list_ids},
 >    { "thread-select", { NULL, 0 }, 0, mi_cmd_thread_select},
 >    { "trace-actions", { NULL, 0 }, NULL, NULL },

I was thinking:

*** mi-cmds.c.~1.30.~	2008-01-04 10:24:35.000000000 +1300
--- mi-cmds.c	2008-02-26 13:47:53.000000000 +1300
*************** struct mi_cmd mi_cmds[] =
*** 133,138 ****
--- 133,139 ----
    { "thread-info", { NULL, 0 }, NULL, NULL },
    { "thread-list-all-threads", { NULL, 0 }, NULL, NULL },
    { "thread-list-ids", { NULL, 0 }, 0, mi_cmd_thread_list_ids},
+   { "thread-info", { "info threads", 0 }, NULL, NULL },
    { "thread-select", { NULL, 0 }, 0, mi_cmd_thread_select},
    { "trace-actions", { NULL, 0 }, NULL, NULL },
    { "trace-delete", { NULL, 0 }, NULL, NULL },

like for "info break".

I realise that -thread-info can give info about one thread but presumably
the change could allow "info threads" to do that too (just as is already
done for "info break").  Then you just need

+   { "thread-info", { "info threads", 1 }, NULL, NULL },

WDYT?

-- 
Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb-patches mailing list