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


Yes Mike. I am really sorry for this silly post made in hurry. Yes
since the pipe (|) symbol is also a c operator, it will confuse gdb.
Even if we use |& we may land up into a trouble situation.

Breakpoint 1, main (argc=1, argv=0x7fffb6e506a8) at test.c:15
15          return (SUCCESS) ;
(gdb) p argc|&*argc
$1 = 1
(gdb) p argc |& *argc
$2 = 1
(gdb)



On Tue, Jul 12, 2011 at 10:47 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday, July 12, 2011 00:24:15 Abhijit Halder wrote:
>
> please do not top post in your replies
>
>> 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.
>
> that wont work as it's "EXPR | EXPR". ?so you could do:
> (gdb) print x | x
>
> or if your variable was named "vim", it's impossible to determine the user's
> intention if they wrote something like:
> (gdb) print x | vim
> do they want the variable "vim" ? ?or do they want to shell out to `vim` ?
>
> i think we'll have to introduce a dedicated operator here that doesn't show up
> in C expressions. ?how about "|&" ? ?this is a bashism for doing
> redirection+pipe in one go, so it'll be somewhat familiar to people.
>
> along those lines, i wonder if generic redirection operators would be useful
> too. ?something like:
> (gdb) thread apply all bt >& file
> -mike
>


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