#50 Cannot set multi-char patterns as idebug id

None
closed-fixed
nobody
idebug (1)
5
2014-07-10
2013-07-12
No

% proc foo {} {idebug break b}
% idebug on b
% foo
idebug at level #1: foo

Which is correct, but

% proc foo {} {idebug break b}
% idebug on {[ba]}
% foo
%

Fails to enter debug. Such patterns would be useful to be able to select different series of breakpoints to stop at.

The problem comes from the fact the argument to `idebug id' is a list (args). As idebug id (and idebug on) might have as much as one argument only, the following patch (over reléase 2.5) fixes the problem:

@@ -4242,14 +4242,14 @@
set level [expr {[info level]-1}]
switch -glob -- $opt {
on {
- if {[llength $args]} { set IDEBUG(id) $args }
+ if {[llength $args]} { set IDEBUG(id) [lindex $args 0] }
return [set IDEBUG(on) 1]
}
off { return [set IDEBUG(on) 0] }
id {
if {![llength $args]} {
return $IDEBUG(id)
- } else { return [set IDEBUG(id) $args] }
+ } else { return [set IDEBUG(id) [lindex $args 0]] }
}
break {
if {!$IDEBUG(on) || $IDEBUG(debugging) || \

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2014-07-10

    Applied to r1.120.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2014-07-10
    • status: open --> closed-fixed
     

Log in to post a comment.