Debugging DLLCC in 7.5 on Win32

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

Debugging DLLCC in 7.5 on Win32

Ian Upright-2
With 7.4, when using DLLCC, if an external call raised an exception, the
exception would not be handled and immediately crash the VM.
One can then attatch a debugger and analyze the problem.

However, with 7.5, it seems to catch the exception and show the
Smalltalk stack of where the error occurred.  This is nice, but not
always what I want.  Is there a way of disabling this exception handling
so that I can attatch a debugger in and have it crash in the traditional
way?

Thanks, Ian

Reply | Threaded
Open this post in threaded view
|

Re: Debugging DLLCC in 7.5 on Win32

Reinout Heeck

On May 20, 2007, at 11:06 PM, ian Upright wrote:

> With 7.4, when using DLLCC, if an external call raised an  
> exception, the
> exception would not be handled and immediately crash the VM.
> One can then attatch a debugger and analyze the problem.
>
> However, with 7.5, it seems to catch the exception and show the
> Smalltalk stack of where the error occurred.  This is nice, but not
> always what I want.  Is there a way of disabling this exception  
> handling
> so that I can attatch a debugger in and have it crash in the  
> traditional
> way?
>

Are you sure you want that?


Recall that there are several classes of bug here:

1) the C code crashed

2) the VM detected a type error

3) the C code returned an error



1) should be caught by your OS, possibly dropping you into a debugger.

2) is handled at the St level, low level debugging seems useless  
here. However you can override #externalAccessFailed: to your liking.

3) I usually debug at the St level, but you might want to step  
through the C- code in the low-level debugger.


For 1) and 3) you could force entering the low level the debugger  
using ObjectMemory class>>enterDebugger.





All selectors from memory, no image here at the moment - HTH,

Reinout
-------









> Thanks, Ian
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Debugging DLLCC in 7.5 on Win32

Eliot Miranda-2
In reply to this post by Ian Upright-2


On 5/20/07, ian Upright <[hidden email]> wrote:
With 7.4, when using DLLCC, if an external call raised an exception, the
exception would not be handled and immediately crash the VM.
One can then attatch a debugger and analyze the problem.


I find this hard to believe.  The Vm code for DLLCC on Windows was upgraded at around 7.4 for better 64-bit datatype support but the basic exception-handling support for catching callout errors wasn't changed IIRC.  In any case you can toggle the support using

    ObjectMemory registerObject: false withEngineFor: 'catchExternalCallErrors'

which should also work in 7.4.

HTH

However, with 7.5, it seems to catch the exception and show the
Smalltalk stack of where the error occurred.  This is nice, but not
always what I want.  Is there a way of disabling this exception handling
so that I can attatch a debugger in and have it crash in the traditional
way?

Thanks, Ian