Just another debugger bug - primitive 19

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

Just another debugger bug - primitive 19

Christoph Thiede

Hi all, I cannot stop having fun with the debugger & context implementation :D

So here is what I found today ...


Steps to reproduce:

Debug it and step "into" #newProcess :

[self yourself] newProcess


Expected behavior:

You want to see something like this:


Actual behavior:



Explanation:

See Context >> #doPrimitive:method:receiver:args:

Quote: "Judicious use of primitive 19 (a null primitive that doesn't do anything) prevents the debugger from entering various run-away activities such as spawning a new process, etc.  Injudicious use results in the debugger not being able to debug interesting code, such as the debugger itself.  Hence use primitive 19 with care :-)"

With respect to this statement, #newProcess (which only *creates* an object), should not really use this primitive, should it? Why isn't this simulation error rather raised at primitive 87 (#resume)? Or rather, why does this error need to be raised at all when, for example, you debug the forking of a process?


In general, can you tell me any example where primitive 19 is necessary indeed? So far I could not find one.

A common scenario in which I stumble upon it is when I try to step "through" the following:

[self halt] fork.

If I disable primitive 19 in #newProcess, this accident does not occur, instead, the new process just runs asynchronously. Feels more intuitive for me.

Even in MVC, everything I could imagine worked fine without the primitive.


Is it possible that primitive 19 comes from an age when the debugging mechanism had not yet evolved to today's capabilities?

Anyway, I would be glad to hear some story about it :-)


Best,

Christoph



Carpe Squeak!