This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Patch: restoring multi-line breakpoint commands
- To: Tom Tromey <tromey at redhat dot com>
- Subject: Re: Patch: restoring multi-line breakpoint commands
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Thu, 4 Oct 2001 19:35:03 -0700 (PDT)
- cc: Insight List <insight at sourceware dot cygnus dot com>
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