This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH


How if we just put a condition check whether the entered string after
pipe (|) is numeric. For e.g.
(gdb) thread apply all bt | grep foobar
Here the entered string after | is grep foobar which is not numeric.
But here (gdb) print var | 0x50 is numeric.

We may safely use this above notion as in case of any numeric file
name can be encapsulated within quote.

Soon I will submit the updated patch. Please provide feedback on this.

On Tue, Jul 12, 2011 at 5:01 AM, Abhijit Halder
<abhijit.k.halder@gmail.com> wrote:
> Yes I missed it. Let me modify the implementation to achieve the goal.
>
> On Tue, Jul 12, 2011 at 1:17 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> writes:
>>
>> Abhijit> There is no way to pass the output of a gdb command to a shell
>> Abhijit> command. For example, something similar is not permitted: "(gdb)
>> Abhijit> thread apply all bt | vim -". This kind of feature is quite helpful in
>> Abhijit> a scenario where a program under debugger has 100s of threads running
>> Abhijit> and one wants to search a particular pattern in stack-traces. I have
>> Abhijit> implemented a feature which will allow one to pass the output of any
>> Abhijit> gdb command to any shell command.
>>
>> It would be nice to be able to do something like this.
>>
>> Abhijit> 2011-07-09 Abhijit Halder <abhijit.k.halder@symantec.com>
>> Abhijit> ? ? * top.c (execute_command_to_pipe): New function.
>> Abhijit> ? ? ?(execute_command): Update.
>>
>> I don't think this implementation is the right approach.
>> It does the wrong thing with some existing valid commands, e.g. "print x|5".
>>
>> Tom
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]