AREPL-electron icon indicating copy to clipboard operation
AREPL-electron copied to clipboard

Actual breakpoints

Open Almenon opened this issue 7 years ago • 3 comments

How breakpoints work currently is..... super hacky, but not in a good way. I simply slice off any text after the breakpoint. In simple cases this is okay but obviously it does not work with functions, whoch may be defined on line 1 yet called on line 100.

Almenon avatar Dec 24 '17 23:12 Almenon

The workaround for this (in the case of AREPL-vscode) is to simply debug it.

Almenon avatar Feb 07 '18 03:02 Almenon

I might be able to do this just by injecting something like the below into the users code:

# define global printLocals func


# later on in code
print(lineNumber, locals())

Or if the user only wants to print locals during a specific iteration:

called=0;called += 1; if called==X: print(lineNumber, locals()) # X being the iteration number

Almenon avatar Feb 07 '18 03:02 Almenon

another way I can use this is by using BDB, the base class for python's pdb debugger.

Almenon avatar May 07 '18 02:05 Almenon