[PATCH] Add the "-info-os" command to MI

Kwok Cheung Yeung kcy@codesourcery.com
Thu Nov 24 23:15:00 GMT 2011


On 21/10/2011 9:39 PM, Tom Tromey wrote:
>>>>>> ">" == Kwok Cheung Yeung<kcy@codesourcery.com>  writes:
>
>>> +  { "info-os", { "info os", 1 }, NULL },
>
> I'd prefer a new function specific to MI to do the command-line parsing.
>
> I think this approach should be deprecated and that no new instances go
> into the tree.  They unnecessarily link MI to the CLI, making it harder
> to change the CLI.
>
> Tom

I've now created a new mi_cmd_info_os function to service -info-os, which 
delegates to info_osdata_command in osdata.c. This is the same backend that 
'info os' in the CLI uses, but at least now we don't go through the CLI code.
info_osdata_command now needs to be non-static.

Kwok


ChangeLog:

gdb/
	* Makefile.in (SUBDIR_MI_OBS): Add mi-cmd-info.o.
	(SUBDIR_MI_SRCS): Add mi-cmd-info.c.
	(mi-cmd-info.o): New rule.
	* osdata.h: Add declaration for info_osdata_command.
	* osdata.c (info_osdata_command): Change to non-static.
	* mi/mi-cmds.c (mi_cmds): Add -info-os MI command.
	* mi/mi-cmd-info.c: New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mi_info-os.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20111124/110b3109/attachment.ksh>


More information about the Gdb-patches mailing list