Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Abhijit Halder <abhijit.k.halder@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: jan.kratochvil@redhat.com, sergiodj@redhat.com,
	tromey@redhat.com, 	pedro@codesourcery.com,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question]
Date: Tue, 16 Aug 2011 17:25:00 -0000	[thread overview]
Message-ID: <CAOhZP9wUposx==KLY27Ji8-EG229ZEjChw01xaw7ZyEF7RZFyg@mail.gmail.com> (raw)
In-Reply-To: <CAOhZP9yEhMGkv2KZBZEUQq8uvuQGOaVpBmbk30a8zw803hJnLw@mail.gmail.com>

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

On Tue, Aug 16, 2011 at 7:39 PM, Abhijit Halder
<abhijit.k.halder@gmail.com> wrote:
> On Tue, Aug 16, 2011 at 7:08 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> Date: Tue, 16 Aug 2011 18:15:19 +0530
>>> From: Abhijit Halder <abhijit.k.halder@gmail.com>
>>> Cc: Eli Zaretskii <eliz@gnu.org>, sergiodj@redhat.com, tromey@redhat.com,
>>>       pedro@codesourcery.com, gdb-patches@sourceware.org
>>>
>>> --- src/gdb/NEWS      2011-08-14 07:27:51.582233000 +0530
>>> +++ dst/gdb/NEWS      2011-08-14 07:50:38.562234498 +0530
>>> @@ -64,6 +64,9 @@
>>>
>>>  * New commands "info macros", and "info definitions" have been added.
>>>
>>> +* New command "pipe" has been added to make GDB command output available to the
>>> +  shell for processing.
>>> +
>>>  * Changed commands
>>
>> This part is okay.
>>
>>> +void
>>> +_initialize_pipe (void)
>>> +{
>>> +  add_cmd ("pipe", no_class, pipe_command, _("\
>>> +Create pipe to pass gdb-command output to the shell for processing.\n\
>>> +Arguments are a delimiter, followed by a gdb-command, then the same delimiter \
>>> +again and finally a shell-command."),
>>
>> This doc string should say something about what can be the delimiter.
>>
>> What about the manual?  (Apologies if I already reviewed that part:
>> this has been a very long thread.)
> I have not yet got a chance to work on document part. I am currently
> working on it.
>>
>> Thanks.
>>
>
Added test-case for this new command. Please review this.

Thanks,
Abhijit Halder

[-- Attachment #2: gdb-pipe-command-testsuite.patch --]
[-- Type: text/x-patch, Size: 2775 bytes --]

diff -rup src/gdb/testsuite/gdb.base/pipe.c dst/gdb/testsuite/gdb.base/pipe.c
--- src/gdb/testsuite/gdb.base/pipe.c	2011-08-16 22:37:37.785351001 +0530
+++ dst/gdb/testsuite/gdb.base/pipe.c	2011-08-16 22:32:40.213350709 +0530
@@ -0,0 +1,27 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2011 Free Software Foundation, Inc.
+
+   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 <stdio.h>
+
+int main ()
+{
+#ifdef usestubs
+  set_debug_traps ();
+  breakpoint ();
+#endif
+  return 0; /* end main */
+}
diff -rup src/gdb/testsuite/gdb.base/pipe.exp dst/gdb/testsuite/gdb.base/pipe.exp
--- src/gdb/testsuite/gdb.base/pipe.exp	2011-08-16 22:37:45.969351119 +0530
+++ dst/gdb/testsuite/gdb.base/pipe.exp	2011-08-16 22:35:34.117356781 +0530
@@ -0,0 +1,49 @@
+#   Copyright 2011 Free Software Foundation, Inc.
+
+# 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/>.
+
+#
+# test gdb pipe commands
+#
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set testfile "pipe"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested pipe.exp
+    return -1
+}
+
+if [get_compiler_info ${binfile}] {
+    return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir ${srcdir}/${subdir}
+gdb_load ${binfile}
+
+set end_main [gdb_get_line_number " end main " $srcfile]
+
+if ![runto_main] then {
+    fail "Can't run to main"
+    return 0
+}
+
+gdb_test "pipe | bt | grep \"main\"" "\#0.*main.*().*at.*${srcfile}:${end_main}"
+

[-- Attachment #3: ChangeLog --]
[-- Type: application/octet-stream, Size: 150 bytes --]

2011-07-29 Abhijit Halder <abhijit.k.halder@gmail.com>

	Testsuite for `pipe' command.

	* gdb.base/pipe.c: New file.
	* gdb.base/pipe.exp: New file.

  reply	other threads:[~2011-08-16 17:25 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 13:59 [PATCH] An implementation of pipe to make I/O communication between gdb and shell Abhijit Halder
2011-07-29 15:29 ` Abhijit Halder
2011-08-02  3:52   ` Sergio Durigan Junior
2011-08-02  6:54   ` Jan Kratochvil
2011-08-02  8:52     ` Abhijit Halder
2011-08-02 15:45       ` Jan Kratochvil
2011-08-02 23:40         ` Sergio Durigan Junior
2011-08-03  7:06           ` Abhijit Halder
2011-08-03 17:46             ` Sergio Durigan Junior
2011-08-04  7:51               ` Abhijit Halder
2011-08-04  8:43                 ` Jan Kratochvil
2011-08-05  8:44                   ` Abhijit Halder
2011-08-04  9:29                 ` Pedro Alves
2011-08-04 14:21                   ` Tom Tromey
2011-08-05 15:05                     ` Abhijit Halder
2011-08-05 15:08                       ` Abhijit Halder
2011-08-05 15:15                       ` Eli Zaretskii
2011-08-05 21:11                         ` Abhijit Halder
2011-08-06  9:58                           ` Abhijit Halder
2011-08-06 22:21                             ` Sergio Durigan Junior
2011-08-08 10:01                               ` Abhijit Halder
2011-08-08 11:15                                 ` Abhijit Halder
2011-08-09  3:03                                 ` Sergio Durigan Junior
2011-08-09 10:42                                   ` Abhijit Halder
2011-08-10 17:54                                     ` Sergio Durigan Junior
2011-08-11  2:51                                       ` Abhijit Halder
2011-08-11 17:44                                         ` Sergio Durigan Junior
2011-08-13 20:51                                     ` Jan Kratochvil
2011-08-13 23:17                                       ` Abhijit Halder
2011-08-13 23:18                                         ` Abhijit Halder
2011-08-14 12:14                                           ` [PATCH] An implementation of pipe to make I/O communication between gdb and shell. [MinGW question] Jan Kratochvil
2011-08-14 14:08                                             ` Eli Zaretskii
2011-08-14 17:02                                               ` Jan Kratochvil
2011-08-14 19:42                                                 ` Eli Zaretskii
2011-08-14 19:55                                                   ` Jan Kratochvil
2011-08-16 12:45                                                     ` Abhijit Halder
2011-08-16 13:38                                                       ` Eli Zaretskii
2011-08-16 14:10                                                         ` Abhijit Halder
2011-08-16 17:25                                                           ` Abhijit Halder [this message]
2011-08-16 17:30                                                             ` Jan Kratochvil
2011-08-17  8:26                                                               ` Abhijit Halder
2011-08-20 18:52                                                                 ` Jan Kratochvil
2011-08-20 19:16                                                       ` Jan Kratochvil
2011-08-23  6:26                                                         ` Abhijit Halder
2011-08-05  7:59                   ` [PATCH] An implementation of pipe to make I/O communication between gdb and shell Abhijit Halder
2011-08-05  8:30                     ` Jan Kratochvil
2011-08-05  8:52                       ` Pedro Alves
2011-08-05  9:09                         ` Jan Kratochvil
2011-08-05  9:41                       ` Abhijit Halder
2011-08-05  9:45                         ` Jan Kratochvil
2011-08-05 10:19                           ` Abhijit Halder
2011-08-05  9:57                         ` Pedro Alves
2011-08-05 10:25                           ` Abhijit Halder
2011-08-05 10:33                             ` Abhijit Halder
2011-08-05 10:36                             ` Pedro Alves
2011-08-05 10:51                               ` Abhijit Halder
2011-08-13 17:24                         ` Jan Kratochvil
2011-08-13 18:10                           ` Abhijit Halder
2011-08-13 20:58                             ` Jan Kratochvil

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='CAOhZP9wUposx==KLY27Ji8-EG229ZEjChw01xaw7ZyEF7RZFyg@mail.gmail.com' \
    --to=abhijit.k.halder@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=pedro@codesourcery.com \
    --cc=sergiodj@redhat.com \
    --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