From: Abhijit Halder <abhijit.k.halder@gmail.com>
To: oza Pawandeep <oza.pawandeep@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH
Date: Mon, 11 Jul 2011 12:13:00 -0000 [thread overview]
Message-ID: <CAOhZP9xkBQ_d+ejFqaz0smfz6EV=2yVvxxZaE+j_Rmw=N2bdjA@mail.gmail.com> (raw)
In-Reply-To: <CAK1A=4xM3uAjw2kaO5z5Ogr2soeRz-E3Dv-7QHQqKM6LUMYX2Q@mail.gmail.com>
Yes, you are right. But to run a shell script you have to either quit
from gdb session or you have to run shell command to get a shell. In
first choice the analysis of debug information is offline that may not
be acceptable in certain situation where you take certain decision
based on your debug information. In second choice you every time get a
shell you source your shell profile (like bashrc bash_profile) that is
not acceptable.
Finally, the method you suggested will dump all the debug info in a
file (this sometimes annoying). Processing that big file will again
consumes more resources.
On Sat, Jul 9, 2011 at 6:39 PM, oza Pawandeep <oza.pawandeep@gmail.com> wrote:
> Hi,
>
> with tee command, or similar things you can always redirect output to
> file, and from there you may apply the script to get output from that.
> probably use source command to automate and use shell command to run
> the script to get the things done.
> sure your way just gets output instantly, but other than that what
> value does it add; I am trying to understand.
>
> Regards,
> Oza.
>
> On Sat, Jul 9, 2011 at 2:00 PM, Abhijit Halder
> <abhijit.k.halder@gmail.com> wrote:
>> There is no way to pass the output of a gdb command to a shell
>> command. For example, something similar is not permitted: "(gdb)
>> thread apply all bt | vim -". This kind of feature is quite helpful in
>> a scenario where a program under debugger has 100s of threads running
>> and one wants to search a particular pattern in stack-traces. I have
>> implemented a feature which will allow one to pass the output of any
>> gdb command to any shell command.
>>
>> 2011-07-09 Abhijit Halder <abhijit.k.halder@symantec.com>
>>
>> * top.c (execute_command_to_pipe): New function.
>> (execute_command): Update.
>> * ui-file.c (gdb_modify_io): New function.
>> * ui-file.h (gdb_modify_io): Add prototype.
>>
>
WARNING: multiple messages have this Message-ID
From: Abhijit Halder <abhijit.k.halder@gmail.com>
To: oza Pawandeep <oza.pawandeep@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH
Date: Mon, 11 Jul 2011 13:42:00 -0000 [thread overview]
Message-ID: <CAOhZP9xkBQ_d+ejFqaz0smfz6EV=2yVvxxZaE+j_Rmw=N2bdjA@mail.gmail.com> (raw)
Message-ID: <20110711134200.ohzHB_3KFeElgi_X4_ear76HCHFl8j1bABnxACtg9Ks@z> (raw)
In-Reply-To: <CAK1A=4xM3uAjw2kaO5z5Ogr2soeRz-E3Dv-7QHQqKM6LUMYX2Q@mail.gmail.com>
Yes, you are right. But to run a shell script you have to either quit
from gdb session or you have to run shell command to get a shell. In
first choice the analysis of debug information is offline that may not
be acceptable in certain situation where you take certain decision
based on your debug information. In second choice you every time get a
shell you source your shell profile (like bashrc bash_profile) that is
not acceptable.
Finally, the method you suggested will dump all the debug info in a
file (this sometimes annoying). Processing that big file will again
consumes more resources.
On Sat, Jul 9, 2011 at 6:39 PM, oza Pawandeep <oza.pawandeep@gmail.com> wrote:
> Hi,
>
> with tee command, or similar things you can always redirect output to
> file, and from there you may apply the script to get output from that.
> probably use source command to automate and use shell command to run
> the script to get the things done.
> sure your way just gets output instantly, but other than that what
> value does it add; I am trying to understand.
>
> Regards,
> Oza.
>
> On Sat, Jul 9, 2011 at 2:00 PM, Abhijit Halder
> <abhijit.k.halder@gmail.com> wrote:
>> There is no way to pass the output of a gdb command to a shell
>> command. For example, something similar is not permitted: "(gdb)
>> thread apply all bt | vim -". This kind of feature is quite helpful in
>> a scenario where a program under debugger has 100s of threads running
>> and one wants to search a particular pattern in stack-traces. I have
>> implemented a feature which will allow one to pass the output of any
>> gdb command to any shell command.
>>
>> 2011-07-09 Abhijit Halder <abhijit.k.halder@symantec.com>
>>
>> * top.c (execute_command_to_pipe): New function.
>> (execute_command): Update.
>> * ui-file.c (gdb_modify_io): New function.
>> * ui-file.h (gdb_modify_io): Add prototype.
>>
>
next prev parent reply other threads:[~2011-07-10 7:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-09 13:09 PATCH Abhijit Halder
2011-07-09 19:06 ` PATCH oza Pawandeep
2011-07-11 12:13 ` Abhijit Halder [this message]
2011-07-11 13:42 ` PATCH Abhijit Halder
2011-07-10 7:47 ` PATCH Mike Frysinger
2011-07-11 21:10 ` PATCH Tom Tromey
2011-07-12 0:51 ` PATCH Abhijit Halder
2011-07-12 7:15 ` PATCH Abhijit Halder
2011-07-12 8:34 ` PATCH Mike Frysinger
2011-07-12 9:01 ` PATCH Abhijit Halder
2011-07-12 17:31 ` PATCH Mike Frysinger
2011-07-12 17:49 ` PATCH Matt Rice
2011-07-12 19:25 ` PATCH Mike Frysinger
2011-07-12 19:49 ` PATCH Tom Tromey
2011-07-12 20:43 ` PATCH Mike Frysinger
2011-07-13 8:45 ` PATCH Abhijit Halder
2011-07-15 14:15 ` PATCH Abhijit Halder
2011-07-15 20:49 ` PATCH Tom Tromey
2011-07-20 19:25 ` PATCH Sergio Durigan Junior
2011-07-21 11:08 ` gdb output pipelining to shell (was: Re: PATCH) Pedro Alves
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='CAOhZP9xkBQ_d+ejFqaz0smfz6EV=2yVvxxZaE+j_Rmw=N2bdjA@mail.gmail.com' \
--to=abhijit.k.halder@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=oza.pawandeep@gmail.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