pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Breakpoint in a DoIt method

JM
Jesus Mari Aguirre
Sat, Sep 11, 2021 2:20 PM

I need to set breakpoints in a source code compiled using

aCompiledMethod := self class compiler
source:  source;
noPattern: true;
context: thisContext;
requestor: self;
bindings: self bindings;
compileDoit

This compiled method has noPattern so it is executed as MyClass>>DoIt:
I want to set a breakpoint programmatically, so a tried:

Breakpoint removeAll.

breakpointList do:[ :aBreakpointIndex |
breakpoint := Breakpoint
breakOnAST: ( aCompiledMethod ast statements at: 2 )
inObject: MyClassInstance.
breakpoint enable].

and executing it doesn't rises Break Exception

result:= compiledMethod
valueWithReceiver: MyClassInstance
arguments:{MyClassInstance}.

It seems the breakpoint is installed because if I try to see the
breakpoints folder inspecting MyClassInstance, the debugger
raises errorKeyNotFound: key #DoIt: not Found in method dictionary.

Any ideas?

I need to set breakpoints in a source code compiled using > aCompiledMethod := self class compiler > source: source; > noPattern: true; > context: thisContext; > requestor: self; > bindings: self bindings; > compileDoit This compiled method has noPattern so it is executed as MyClass>>DoIt: I want to set a breakpoint programmatically, so a tried: Breakpoint removeAll. > breakpointList do:[ :aBreakpointIndex | > breakpoint := Breakpoint > breakOnAST: ( aCompiledMethod ast statements at: 2 ) > inObject: MyClassInstance. > breakpoint enable]. and executing it doesn't rises Break Exception > result:= compiledMethod > valueWithReceiver: MyClassInstance > arguments:{MyClassInstance}. It seems the breakpoint is installed because if I try to see the breakpoints folder inspecting MyClassInstance, the debugger raises errorKeyNotFound: key #DoIt: not Found in method dictionary. Any ideas?