# HG changeset patch # User Claus Gittinger # Date 1371747616 -7200 # Node ID 7ef42553161802f8259ad215477e8ce0c5801b34 # Parent 78a465c907cd9364c6e37271f1915082401bdfc3 class: Tools::BreakpointService changed: #setOrToggleBreakpointAtLine: diff -r 78a465c907cd -r 7ef425531618 Tools__BreakpointService.st --- a/Tools__BreakpointService.st Thu Jun 20 18:22:10 2013 +0200 +++ b/Tools__BreakpointService.st Thu Jun 20 19:00:16 2013 +0200 @@ -276,7 +276,9 @@ ! setOrToggleBreakpointAtLine:line - |pos bpnt| + |pos bpnt prepareFullBreakSupport| + + prepareFullBreakSupport := true. textView reallyModified ifTrue:[ "/ leads to ugly behavior (method no longer found), if we allow @@ -288,8 +290,28 @@ pos := textView characterPositionOfLine:line col:1. bpnt := self breakpointAtLine:line. bpnt isNil ifTrue:[ + "/ no breakpoint there - add as required (self canCreateOrToggleBreakpointAtLine:line) ifTrue:[ - breakpoints add:((bpnt := Breakpoint new) position:pos line:line). + prepareFullBreakSupport ifTrue:[ + "/ add a (disabled) breakpoint for every source line. This + "/ allows for breakpoints to be enabled/disabled in the debugger... + 1 to:textView numberOfLines do:[:eachLine | + |oldBPnt eachPos otherBpnt| + + oldBPnt := self breakpointAtLine:eachLine. + oldBPnt isNil ifTrue:[ + eachPos := textView characterPositionOfLine:eachLine col:1. + breakpoints add:((otherBpnt := Breakpoint new) position:eachPos line:eachLine). + eachLine == line ifTrue:[ + bpnt := otherBpnt. + ] ifFalse:[ + otherBpnt beInvisible. + ] + ]. + ]. + ] ifFalse:[ + breakpoints add:((bpnt := Breakpoint new) position:pos line:line). + ]. Display shiftDown ifTrue:[ "/ trace bpnt beTracepoint @@ -303,6 +325,7 @@ ]. ] ] ifFalse:[ + "/ breakpoint already there - just enable/disable Display shiftDown ifTrue:[ bpnt toggleTracing ] ifFalse:[ @@ -394,11 +417,11 @@ !BreakpointService class methodsFor:'documentation'! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.21 2013-06-14 13:17:53 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.22 2013-06-20 17:00:16 cg Exp $' ! version_SVN - ^ '$Id: Tools__BreakpointService.st,v 1.21 2013-06-14 13:17:53 cg Exp $' + ^ '$Id: Tools__BreakpointService.st,v 1.22 2013-06-20 17:00:16 cg Exp $' ! !