This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: block of commands
- From: Doug Evans <dje at google dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Sun, 24 Jan 2016 12:03:08 -0800
- Subject: Re: RFC: block of commands
- Authentication-results: sourceware.org; auth=none
- References: <001a1143804e6a9e8f0529ce089a at google dot com> <1453499357 dot 2097 dot 18 dot camel at skynet dot be>
On Fri, Jan 22, 2016 at 1:49 PM, Philippe Waroquiers
<philippe.waroquiers@skynet.be> wrote:
>
>
> I think that effectively, the principles you suggest below
> should allow to make a reasonable syntax, and no backward
> incompatibility.
> So basically:
> * trailing } is mandatory
> * inside a block of commands, { } and ; must be escaped
> * a command block is limited to be on a single line
> I guess multiple lines will be ok if each line is terminated
> by a \.
>
> The above principles should also allow to extend if/while/...
> to have 'one line' if/while/...
>
> I also think that 'one line if' will allow to do things such as:
>
> thread apply all if $ebp -$esp > 1000000 { echo big frame in this thread }
>
> (today, trying to use an 'if' in thread apply gives a quite strange
> behaviour : the rest of the 'if' command is read during each execution
> for each thread, which is not very user friendly :).
>
> I will work based on the above idea, and resubmit a draft patch
> but that will for sure have to wait after FOSDEM, which
> will already consume the night and week-end free time :).
>
> Thanks for the comments/help/nice suggestions
>
Hi.
Sounds like a plan, but in an effort to make your time
as productive as I can I would suggest first trying to come
up with syntax that the community can accept.
Among the questions we need to answer:
- when/how to escape { } ;
(what I gave was a strawman, I didn't dig deep
into whether there are any gotchas)
- what to do with { } in expressions,
e.g., "if ({1,2,3})[2] == 3 { echo foo }"
- ???
P.S. Hope you enjoy FOSDEM!