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: RFC: block of commands


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!


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