Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kwok Cheung Yeung <kcy@codesourcery.com>
To: Tom Tromey <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add the "-info-os" command to MI
Date: Tue, 29 Nov 2011 23:18:00 -0000	[thread overview]
Message-ID: <4ED56826.5000804@codesourcery.com> (raw)
In-Reply-To: <m3k46in47h.fsf@fleche.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

On 29/11/2011 7:01 PM, Tom Tromey wrote:
> Two nits...
>
>>> +  { "info-os", { NULL, 0 }, mi_cmd_info_os},
>
> mi_cmd_info_os doesn't seem to be declared anywhere.
> I think this ought to cause a compilation error.
>

Oops - I did add a declaration in mi/mi-cmds.h but forgot to include it in the 
patch. :-)

>>> +      info_osdata_command (argv [0], 0);
>
> No space before the '['.
>

Fixed.

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 (info_osdata_command): New declaration.
	* osdata.c (info_osdata_command): Change to non-static.
	* mi/mi-cmds.h (mi_cmd_info_os): New declaration.
	* mi/mi-cmds.c (mi_cmds): Add -info-os MI command.
	* mi/mi-cmd-info.c: New.

[-- Attachment #2: mi_info-os.patch --]
[-- Type: text/plain, Size: 5078 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.1178
diff -u -p -r1.1178 Makefile.in
--- Makefile.in	20 Nov 2011 08:59:56 -0000	1.1178
+++ Makefile.in	29 Nov 2011 23:04:39 -0000
@@ -207,6 +207,7 @@ SUBDIR_MI_OBS = \
 	mi-out.o mi-console.o \
 	mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
 	mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-cmd-target.o \
+	mi-cmd-info.o \
 	mi-interp.o \
 	mi-main.o mi-parse.o mi-getopt.o
 SUBDIR_MI_SRCS = \
@@ -214,7 +215,8 @@ SUBDIR_MI_SRCS = \
 	mi/mi-cmds.c mi/mi-cmd-env.c \
 	mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
 	mi/mi-cmd-file.c mi/mi-cmd-disas.c mi/mi-symbol-cmds.c \
-	mi/mi-cmd-target.c mi/mi-interp.c \
+	mi/mi-cmd-target.c mi/mi-cmd-info.c \
+	mi/mi-interp.c \
 	mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
 SUBDIR_MI_DEPS =
 SUBDIR_MI_LDFLAGS=
@@ -1896,6 +1898,10 @@ mi-cmd-file.o: $(srcdir)/mi/mi-cmd-file.
 	$(COMPILE) $(srcdir)/mi/mi-cmd-file.c
 	$(POSTCOMPILE)
 
+mi-cmd-info.o: $(srcdir)/mi/mi-cmd-info.c
+	$(COMPILE) $(srcdir)/mi/mi-cmd-info.c
+	$(POSTCOMPILE)
+
 mi-cmds.o: $(srcdir)/mi/mi-cmds.c
 	$(COMPILE) $(srcdir)/mi/mi-cmds.c
 	$(POSTCOMPILE)
Index: osdata.c
===================================================================
RCS file: /cvs/src/src/gdb/osdata.c,v
retrieving revision 1.13
diff -u -p -r1.13 osdata.c
--- osdata.c	21 Nov 2011 16:54:28 -0000	1.13
+++ osdata.c	29 Nov 2011 23:04:39 -0000
@@ -288,7 +288,7 @@ get_osdata_column (struct osdata_item *i
   return NULL;
 }
 
-static void
+void
 info_osdata_command (char *type, int from_tty)
 {
   struct ui_out *uiout = current_uiout;
Index: osdata.h
===================================================================
RCS file: /cvs/src/src/gdb/osdata.h,v
retrieving revision 1.5
diff -u -p -r1.5 osdata.h
--- osdata.h	1 Jan 2011 15:33:12 -0000	1.5
+++ osdata.h	29 Nov 2011 23:04:39 -0000
@@ -49,5 +49,6 @@ void osdata_free (struct osdata *);
 struct cleanup *make_cleanup_osdata_free (struct osdata *data);
 struct osdata *get_osdata (const char *type);
 const char *get_osdata_column (struct osdata_item *item, const char *name);
+void info_osdata_command (char *type, int from_tty);
 
 #endif /* OSDATA_H */
Index: mi/mi-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmds.c,v
retrieving revision 1.57
diff -u -p -r1.57 mi-cmds.c
--- mi/mi-cmds.c	3 Oct 2011 21:38:31 -0000	1.57
+++ mi/mi-cmds.c	29 Nov 2011 23:04:39 -0000
@@ -90,6 +90,7 @@ struct mi_cmd mi_cmds[] =
   { "gdb-version", { "show version", 0 }, 0 },
   { "inferior-tty-set", { NULL, 0 }, mi_cmd_inferior_tty_set},
   { "inferior-tty-show", { NULL, 0 }, mi_cmd_inferior_tty_show},
+  { "info-os", { NULL, 0 }, mi_cmd_info_os},
   { "interpreter-exec", { NULL, 0 }, mi_cmd_interpreter_exec},
   { "list-features", { NULL, 0 }, mi_cmd_list_features},
   { "list-target-features", { NULL, 0 }, mi_cmd_list_target_features},
Index: mi/mi-cmds.h
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmds.h,v
retrieving revision 1.52
diff -u -p -r1.52 mi-cmds.h
--- mi/mi-cmds.h	3 Oct 2011 21:38:31 -0000	1.52
+++ mi/mi-cmds.h	29 Nov 2011 23:04:39 -0000
@@ -72,6 +72,7 @@ extern mi_cmd_argv_ftype mi_cmd_file_lis
 extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
 extern mi_cmd_argv_ftype mi_cmd_inferior_tty_set;
 extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
+extern mi_cmd_argv_ftype mi_cmd_info_os;
 extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
 extern mi_cmd_argv_ftype mi_cmd_list_features;
 extern mi_cmd_argv_ftype mi_cmd_list_target_features;
Index: mi/mi-cmd-info.c
===================================================================
RCS file: mi/mi-cmd-info.c
diff -N mi/mi-cmd-info.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mi/mi-cmd-info.c	29 Nov 2011 23:04:39 -0000
@@ -0,0 +1,37 @@
+/* MI Command Set - information commands.
+   Copyright (C) 2011 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "defs.h"
+#include "osdata.h"
+
+void
+mi_cmd_info_os (char *command, char **argv, int argc)
+{
+  switch (argc)
+    {
+    case 0:
+      info_osdata_command ("", 0);
+      break;
+    case 1:
+      info_osdata_command (argv[0], 0);
+      break;
+    default:
+      error (_("-info-os: Usage: [INFOTYPE]"));
+      break;
+    }
+}

  reply	other threads:[~2011-11-29 23:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 15:52 Kwok Cheung Yeung
2011-10-13 16:13 ` Eli Zaretskii
2011-11-23 23:37   ` Kwok Cheung Yeung
2011-12-06 18:53     ` Pedro Alves
2011-10-21 20:53 ` Tom Tromey
2011-10-27  0:24   ` Stan Shebs
2011-10-27 16:45     ` Tom Tromey
2011-11-24 23:15   ` Kwok Cheung Yeung
2011-11-25 11:56     ` Eli Zaretskii
2011-11-29 19:01     ` Tom Tromey
2011-11-29 23:18       ` Kwok Cheung Yeung [this message]
2011-11-30 14:47         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED56826.5000804@codesourcery.com \
    --to=kcy@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox