How to grab a debug on Syntax Error?

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

How to grab a debug on Syntax Error?

Stephane Ducasse-3
Hi

I'm loading some old code to migrate to github and I got an syntax error.
The support is a bit terrible. You get a pop up but now idea how to do
anything with
it. Can we access the stack?

We should really improve that part. Now I'm using an old Pharo 40 and
trying to guess where was the difference in synta (probably #( #3)) is
not allowed anymore
and republish a new version.

Stef

Reply | Threaded
Open this post in threaded view
|

Re: How to grab a debug on Syntax Error?

Henrik Sperre Johansen
Depends on whether you have a SyntaxErrorNotification or a SemanticError.

For SyntaxErrorNotifications, you can wrap in a handler block raising a debugger (and will see at which index in source the error is for).
Handling automatically is very kludgey without changes to the way OpalCompiler fetches source, which isn't really easily available to edit and resume from SyntaxErrorNotification handling code outside the scope of a controlling SourceEditor.

For SemanticErrors, you're currently SOL, as they have a handling block in the compiler, rather than being raised and, only if unhandled, use a default action which notifies/logs dependent on whether compilation is interactive or not.
Reply | Threaded
Open this post in threaded view
|

Re: How to grab a debug on Syntax Error?

Henrik Sperre Johansen
In reply to this post by Stephane Ducasse-3
Stephane Ducasse-3 wrote
You get a pop up but now idea how to do anything with it.
You're supposed to edit the invalid source code in the popup, and save it.
Then load will proceed using the corrected code.
The title / tooltip for the popup could surely use some better explaining ;)
Reply | Threaded
Open this post in threaded view
|

Re: How to grab a debug on Syntax Error?

Marcus Denker-4

> On 12 Jun 2017, at 10:46, Henrik Sperre Johansen <[hidden email]> wrote:
>
> Stephane Ducasse-3 wrote
>> You get a pop up but now idea how to do anything with it.
>
> You're supposed to edit the invalid source code in the popup, and save it.
> Then load will proceed using the corrected code.

Yes, and it even works (just tested it). It was broken for quite a long time…
(this does not happen often, so issues with it tend to not be worked on with
priority)

> The title / tooltip for the popup could surely use some better explaining ;)
>

There is a menu which is very hidden that has the important “debug calling process”.

The UI needs some improvements to guide the user better, especially as it is just
not every month (or even year) that one sees it…

        Marcus