This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Implement -thread-info.
- From: Vladimir Prus <ghost at cs dot msu dot su>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 08 Mar 2008 18:50:15 +0300
- Subject: Re: [RFA] Implement -thread-info.
- References: <200802171833.26673.vladimir@codesourcery.com> <18371.25340.162317.39030@kahikatea.snap.net.nz>
Nick Roberts wrote:
> > --- 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?
I think I agree with Dan's concerns about using a backward-compatibility
mechanisms.
- Volodya