Squeak 4.1 debugger problems.

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

Squeak 4.1 debugger problems.

John Chludzinski
I set a number of break points in my code (self break.).  Had no problems for a while BUT then I got the emergency debugger in the upper left corner (Object>>primitiveError:).  Looking at the call stack showed a number of problems:

1) CompiledMethod>>asString does NOT exist!

2) DebuggerMethodMap>>cacheDebugMap:forMethod:  appears to be deleting the most recent (not oldest) entry from MapCache?

3) DebuggerMethodMap>>cacheDebugMap:forMethod: seems to loose entries in MapCache?  After getting the keys for MapCache and trying to index into MapCache, an errorKeyNotFound occurs.  I re-initialized the class variables (MapCache, MapCacheEntries) by executing: DebuggerMethodMap class>>voidMapCache.   This seemed to cure the problem BUT I did notice the comment in DebuggerMethodMap>>cacheDebugMap:forMethod:  "There be race conditions and reentrancy issues here".  What's the deal with this?

---John


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 4.1 debugger problems.

Levente Uzonyi-2
On Mon, 23 Aug 2010, John Chludzinski wrote:

> I set a number of break points in my code (self break.).  Had no problems
> for a while BUT then I got the emergency debugger in the upper left corner
> (Object>>primitiveError:).  Looking at the call stack showed a number of
> problems:
>
> 1) CompiledMethod>>asString does NOT exist!

#asString is defined in ByteArray, the superclass of CompiledMethod, but
if you send it to a CompiledMethod, it will raise an error.

>
> 2) DebuggerMethodMap>>cacheDebugMap:forMethod:  appears to be deleting the
> most recent (not oldest) entry from MapCache?

You're right. That method has several other issues, it should be
rewritten.


Levente

>
> 3) DebuggerMethodMap>>cacheDebugMap:forMethod: seems to loose entries in
> MapCache?  After getting the keys for MapCache and trying to index
> into MapCache, an errorKeyNotFound occurs.  I re-initialized the class
> variables (MapCache, MapCacheEntries) by executing: DebuggerMethodMap
> class>>voidMapCache.   This seemed to cure the problem BUT I did notice the
> comment in DebuggerMethodMap>>cacheDebugMap:forMethod:  "There be race
> conditions and reentrancy issues here".  What's the deal with this?
>
> ---John
>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak 4.1 debugger problems.

John Chludzinski
In reply to this post by John Chludzinski
Still not certain what problem, 

MapCache := WeakIdentityKeyDictionary new, 

(in DebuggerMethodMap class>>voidMapCache) solves?

On Mon, Aug 23, 2010, Levente Uzonyi [hidden email] wrote:
On Mon, 23 Aug 2010, John Chludzinski wrote:

> I set a number of break points in my code (self break.).  Had no problems
> for a while BUT then I got the emergency debugger in the upper left corner
> (Object>>primitiveError:).  Looking at the call stack showed a number of
> problems:
>
> 1) CompiledMethod>>asString does NOT exist!

#asString is defined in ByteArray, the superclass of CompiledMethod, but 
if you send it to a CompiledMethod, it will raise an error.

>
> 2) DebuggerMethodMap>>cacheDebugMap:forMethod:  appears to be deleting the
> most recent (not oldest) entry from MapCache?

You're right. That method has several other issues, it should be 
rewritten.


Levente




Reply | Threaded
Open this post in threaded view
|

Re: Squeak 4.1 debugger problems.

Eliot Miranda-2


On Tue, Aug 24, 2010 at 1:00 PM, John Chludzinski <[hidden email]> wrote:
Still not certain what problem, 

MapCache := WeakIdentityKeyDictionary new, 

(in DebuggerMethodMap class>>voidMapCache) solves?

The use of a WeakIdentityKeyDictionary  stops the debugger from holding onto obsolete methods, which in turn stops it form holding onto obsolete classes.
The map cache itself speeds up the debugger, avoiding running the compiler for the most recent N debugged methods.

does that help?

Eliot 
 

On Mon, Aug 23, 2010, Levente Uzonyi [hidden email] wrote:
On Mon, 23 Aug 2010, John Chludzinski wrote: > I set a number of break points in my code (self break.). Had no problems > for a while BUT then I got the emergency debugger in the upper left corner > (Object>>primitiveError:). Looking at the call stack showed a number of > problems: > > 1) CompiledMethod>>asString does NOT exist!
#asString is defined in ByteArray, the superclass of CompiledMethod, but if you send it to a CompiledMethod, it will raise an error. >
> 2) DebuggerMethodMap>>cacheDebugMap:forMethod: appears to be deleting the > most recent (not oldest) entry from MapCache?
You're right. That method has several other issues, it should be rewritten. Levente