This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


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

Re: Patch: restoring multi-line breakpoint commands


On 4 Oct 2001, Tom Tromey wrote:

> Keith> +	  sprintf_append_element_to_obj (obj, "loop_break");
>
> Using sprintf_append_element_to_obj is sort of overkill, but I don't
> imagine it matters.

Yeah, it is overkill, but I didn't think it mattered, either. Just so I
don't lose track of optimal behaviors, I'll change it to use
Tcl_ListAppendElement.

> Keith> +    # escape "$", "[", and "]"
> Keith> +    if {[info tclversion] >= 8.1} {
> Keith> +      set expr {([\[\]\$])}
> Keith> +    } else {
> Keith> +      set expr {([][$])}
> Keith> +    }
> Keith> +    regsub -all -- $expr $commands \
> Keith> +      {[format "\\%c" [scan {\1} %c x; set x]]} new_commands
>
> This is the part of the patch I don't understand.
> Why is this necessary?

If you use convenience variable, these will get eval'd by tcl, causing all
kinds of problems, IIRC. Ditto for "[" and "]". (Convenience variables
start with "$".)

Maybe I'm intoxicated or something... I thought that was why I spent so
much time on the darn regexp stuff.
Keith



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