Breakpoint restart error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Breakpoint restart error

Ben Coman
I trying to set a breakpoint programatically so that users can be dropped into the custom script they can add to a system. I try...

Object compile: 'myTest
  |a b c|
  a := 1.
  b := 2.
  c := 3'.
Breakpoint new node: (Object>>#myTest) ast; install.
Object new myTest.
"click <over>  <over>  <restart>  <over>"

but the following error appears and the debugger gets confused...
image.png

What am I doing wrong?

cheers -ben
Reply | Threaded
Open this post in threaded view
|

Re: Breakpoint restart error

Thomas Dupriez-2

Hi ben,

If you don't touch the new error and keep stepping over in the original debugger, it does not get confused. It's not really a "solution" though, merely an observation.


The issue is not related to the restart. It comes from stepping over a message with a breakpoint.
For example, if you also set a breakpoint on the "b := 2" node and step over it, there is the same issue. Example code:

Object compile: 'myTest2
  |a b c|
  a := 1.
  b := 2.
  c := 3'.
Breakpoint new node: (Object>>#myTest2) ast; install.
Breakpoint new node: (Object>>#myTest2) ast children first statements second; install. "Installing breakpoint on node b := 2"
Object new myTest2.
"<over>, <over>, <over> -> issue"


In your example, here's what happens:
- you run the test
- the breakpoint triggers, and stops the execution
- you step over two times
- you restart, which means the next code to be executed is now the breakpoint that was inserted at the start of the test method
- you step over a breakpoint, which causes the issue.

A very similar issue occurs when stepping over a 'self halt'.

Cheers,
Thomas

On 04/08/2019 17:09, Ben Coman wrote:
I trying to set a breakpoint programatically so that users can be dropped into the custom script they can add to a system. I try...

Object compile: 'myTest
  |a b c|
  a := 1.
  b := 2.
  c := 3'.
Breakpoint new node: (Object>>#myTest) ast; install.
Object new myTest.
"click <over>  <over>  <restart>  <over>"

but the following error appears and the debugger gets confused...
image.png

What am I doing wrong?

cheers -ben