[ANN] TDDFacilities

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

Re: FFI problem

Benoit St-Jean
Retested the FFI stuff..  All tests are green and my ODBC stuff works again!  Thanks to all!

Un gros merci à tous!
 
-----------------
Benoit St-Jean
Yahoo! Messenger: bstjean
Blog: lamneth.wordpress.com
A standpoint is an intellectual horizon of radius zero.
(Albert Einstein)



From: Mariano Martinez Peck <[hidden email]>
To: [hidden email]
Sent: Tuesday, July 7, 2009 6:52:22 PM
Subject: Re: [Pharo-project] FFI problem

Ok, now you can close http://code.google.com/p/pharo/issues/detail?id=908

in 10372


On Tue, Jul 7, 2009 at 6:26 PM, Stéphane Ducasse <[hidden email]> wrote:

On Jul 7, 2009, at 11:20 PM, Mariano Martinez Peck wrote:

> Stef: Yes, it works. But, I have some questions:
>
> 1) Is it ok to have
>
> self new installer monticello http:
> 'source.squeakfoundation.org';     ???
>
> or it is just temp ? In addition, why was #squeakfundation removed ?
> this is because now all is here: source.squeakfoundation.org???   If
> so, we can create a method for this new repository...

It is temporary.
First I would say that FFI should have a loader doing the
initialization properly. 

Second we will probably have a new loader in the near future.


> 2) I don't know what Smalltalk recreateSpecialObjectsArray.

specialObjectsArray is an array known by the VM

> But older version of FFI worked ok and also this version works ok in
> Linux...I don't understand why.

I do not know :)

> Is there a logic here I cannot see ?
> Is there a drawback in evaluating Smalltalk
> recreateSpecialObjectsArray. ?
>
> Cheers,
>
> Mariano
>
> On Tue, Jul 7, 2009 at 8:01 PM, Stéphane Ducasse <[hidden email]
> > wrote:
> Mariano
>
> I just published in Pharo a new ScriptLoader which I hope fix the
> problem.
> Could you check it?
>
> Stef
>
> On Jul 5, 2009, at 9:05 PM, Mariano Martinez Peck wrote:
>
> > Andreas: can you see new comments here: http://code.google.com/p/pharo/issues/detail?id=908
> >
> > What do you think?
> >
> > Thanks!
> >
> > Mariano
> >
> > On Tue, Jun 30, 2009 at 12:26 PM, Mariano Martinez Peck <[hidden email]
> > > wrote:
> > I crated the issue so that no to forget about it:
> >
> > http://code.google.com/p/pharo/issues/detail?id=908
> >
> > Best,
> >
> > Mariano
> >
> >
> > On Sun, Jun 28, 2009 at 3:56 AM, Andreas Raab <[hidden email]>
> > wrote:
> > Mariano Martinez Peck wrote:
> > Ok. Pharo people is in this mail. Let's wait if someone can help us.
> >
> > Please cc vm-dev on any responses. I'm not subscribed to the Pharo
> > list.
> >
> >
> > I don't know why in mi Windows machine the dump file is not
> > generated :(
> >
> > It looks like the crash has two different ways of showing. In the
> > first situation, it crashes with a recursive DNU. In the second, it
> > actually does generate a crash dump (attached). The latter seems to
> > happen when you try to step through the code.
> >
> >
> > Benoit St-Jean can you attach the complete dump file?
> >
> > I tried this in Linux and it doesn't crash my image. So, only
> > windows :(
> >
> > Difficult to say. There is a good possibility that the problem is
> > unrelated to the FFI since I have been completely unable to
> > reproduce the problem elsewhere.
> >
> > Cheers,
> >  - Andreas
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free!
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: extended search -> senders of it (n) - defect?

Adrian Lienhard
In reply to this post by Mariano Martinez Peck
The reason that ifNil: is not found is that it is inlined. If you view  
the bytecode representation of an ifNil: send, you see that this  
message is never sent. The search looks for symbols in the literal  
frame of compiled methods and hence does not find this special case.

Cheers,
Adrian


On Jul 8, 2009, at 05:52 , Mariano Martinez Peck wrote:

> 2009/7/7 Cameron Sanders <[hidden email]>
>
>> On Jul 7, 2009, at 7:39 PM, Mariano Martinez Peck wrote (below my  
>> original
>> text):
>>
>> can you give us a concrete example?
>>
>> In my opinion, if you have a symbol with that text, it must be  
>> found by
>> "senders of it". In VAST it is like that.
>> So, if you have #ifNil:   for me it is correct to be found.
>>
>> best,
>>
>> Mariano
>>
>>
>> What you say makes sense for performance reasons. I just picked  
>> through
>> those 10 methods more carefully, and they each contain the symbol  
>> #ifNil:,
>> so the one error I thought I was seeing (of a match for a pattern of
>> xxxIfNil:) is not what is causing them to be found. So, I'm glad  
>> you asked,
>> as that forced me to recheck that aspect. Should it be called
>> "search->methods referencing symbol (n)" or something -- I don't  
>> care about
>> pesky details like that.
>>
>
> You are welcome.
>
>
>
>>
>> What matters to me is the failure to find my references/sends:
>>
>> My broken method (FaTableAccessor>>columnAt:) is just one of *many*  
>> places
>> I have used #ifNil:, and is NOT being found.
>>
>> The search is only finding 10 methods in the entire system (in the  
>> classes
>> Decompiler, MessageNode, MethodFinder, OCompletionTable, PSUIManager,
>> RBMessageNode, RBProgramNode) that reference the symbol #ifNil:.
>>
>> Previously, this feature has worked for me as expected (to the best  
>> of my
>> knowledge). But I can't guarantee that I have ever searched for  
>> #ifNil:.
>>
>> I just searched for collect:, and that turned up a more reasonable  
>> 1092
>> methods, some of which are mine. I am surprised there are not more  
>> uses of
>> it, but at least it is a more credible number than "10". So maybe  
>> it is just
>> something weird for the symbol ifNil:, which I can live with; that  
>> would
>> make this a low priority issue, assuming it is working for most other
>> symbols pretty well.
>>
>
> Perhaps a lot of people does isNil ifTrue: instead of ifNil:  hahaha
>
>
>>
>> Recap: I am selecting "ifNil:" (without the quotes) in a workspace,  
>> and
>> using "extended search"->"senders of it (n)"; this is failing to find
>> methods of mine that include the symbol (as a selector).
>>
>
> Can you give me an example of your code that containg ifNil: and  
> that's is
> not being found ? just to test it here.
>
> cheers,
>
> Mariano
>
>
>> Happy Hunting,
>> Cam
>>
>>
>>
>> On Tue, Jul 7, 2009 at 6:32 PM, Cameron Sanders <
>> [hidden email]> wrote:
>>
>>> Having made some bozo statements lately, I am hesitant to even  
>>> inquire
>>> (because I am probably doing something dumb), but...
>>>
>>> I noted an error in my code that read xxx isNumber ifNil: [...] and
>>> figured that when I imported in from VisualWorks, I must have  
>>> "fixed"
>>> things too hastily. Wondering where else I may have made this  
>>> error I
>>> did the following on an iMac using the 10371web image recently  
>>> posted:
>>>
>>> In a workspace I typed and highlighted "ifNil:" --without the quotes
>>> of course-- and selected "extended search...".
>>> Then I selected "senders of it (n)", and to my surprise, not my
>>> erroneous method was not displayed in the results. Ten (10) methods
>>> turn up in the results, and some of them are not actually senders of
>>> it; the non-senders may include the pattern in an array, or as a
>>> substring of some symbol.
>>
>>
>>
>>
>>
>>
>>
>>>
>>>
>>> Is this a known defect? Previously (from images two months ago and
>>> less) this searching worked as expected.
>>>
>>> A search of the defect db, using only the word "senders", gave me  
>>> this
>>> (semi-related) issue:
>>>
>>> http://code.google.com/p/pharo/issues/detail?id=261&q=sendeifNilrs&colspec=ID%20Type%20Status%20Summary%20Milestone 
>>> <http://code.google.com/p/pharo/issues/detail?id=261&q=senders&colspec=ID%20Type%20Status%20Summary%20Milestone 
>>> >
>>>
>>> Thanks in advance,
>>> Cam
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: extended search -> senders of it (n) - defect?

Cameron Sanders-3
Thank you, that is informative! So, if a guy, a semi-newbie at that,  
were to want to write his own search method to look for particular  
byte-code patterns (suggestive of an inlined ifNil:) ... what would be  
some useful examples or a good place to start learning? MethodFinder,  
or is there a better  example?

And, on a related note, if I more generally wanted to write a module  
to eject/translate-to Objective-C instead of C, where would be a good  
place to get started on that learning curve? (Are the classes that  
*once* ejected C code for the VM still functional? Are they in Pharo?)

Thanks in advance,
Cam


On Jul 8, 2009, at 1:43 AM, Adrian Lienhard wrote:

> The reason that ifNil: is not found is that it is inlined. If you view
> the bytecode representation of an ifNil: send, you see that this
> message is never sent. The search looks for symbols in the literal
> frame of compiled methods and hence does not find this special case.
>
> Cheers,
> Adrian
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

byte codes, parse-tree walking, etc.

Cameron Sanders-3
1) What classes should I look at to learn about the byte-code  
generation?

2) What are good examples of code that handles/manipulates/processes  
the byte-code? e.g. like the code used for searching for symbol  
references in the byte-code, what is that called? (Is that  
MethodFinder stuff?)

        2.b) And what is the name (& path) of the C module that actually  
implements the VM case statement (or whatever dispatch is used)?

3. Once upon a time there was some code that processed Slang ... but I  
have no idea whether that code is in Pharo, or completely antiquated  
in all versions. (And if gone from Pharo, what should I look for and  
in which version of Squeak?)

A list of a few classes (in current use) would be greatly appreciated.

Thanks in advance,
Cam
PS: reading through list archives can be painful, as they often either  
build on known information, or if you back up too far, the material -
you later learn- is completely antiquated.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

Igor Stasenko
2009/7/8 Cameron Sanders <[hidden email]>:
> 1) What classes should I look at to learn about the byte-code
> generation?
>
I think you'd better look at NewCompiler.
Don't look at compiler implementation in its current state :)

> 2) What are good examples of code that handles/manipulates/processes
> the byte-code? e.g. like the code used for searching for symbol
> references in the byte-code, what is that called? (Is that
> MethodFinder stuff?)
>
There is InstructionStream, and of course see CompiledMethod itself.

>        2.b) And what is the name (& path) of the C module that actually
> implements the VM case statement (or whatever dispatch is used)?
>
VMMaker is _smalltalk_ package which implements such dispatch, and
then translated to C & compiled to get a VM binary.
Look for VMMaker package at squeaksource.com

> 3. Once upon a time there was some code that processed Slang ... but I
> have no idea whether that code is in Pharo, or completely antiquated
> in all versions. (And if gone from Pharo, what should I look for and
> in which version of Squeak?)
>
> A list of a few classes (in current use) would be greatly appreciated.
>
VMMaker: Interpreter, ObjectMemory
Image: Compiler/Parser (but better look a NewCompiler)
  InstructionStream, ContextPart, CompiledMethod

> Thanks in advance,
> Cam
> PS: reading through list archives can be painful, as they often either
> build on known information, or if you back up too far, the material -
> you later learn- is completely antiquated.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

Cameron Sanders-3
Awesome, thanks for the leads!

-Cam

On Jul 8, 2009, at 3:43 PM, Igor Stasenko wrote:
...
> VMMaker is _smalltalk_ package which implements such dispatch, and
> then translated to C & compiled to get a VM binary.
> Look for VMMaker package at squeaksource.com
...


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

Stéphane Ducasse
In reply to this post by Igor Stasenko
BTW we should make sure that it is easy to load VMMaker
the last time I got a problem with Genie plugin.

stef
On Jul 8, 2009, at 9:43 PM, Igor Stasenko wrote:

> 2009/7/8 Cameron Sanders <[hidden email]>:
>> 1) What classes should I look at to learn about the byte-code
>> generation?
>>
> I think you'd better look at NewCompiler.
> Don't look at compiler implementation in its current state :)
>
>> 2) What are good examples of code that handles/manipulates/processes
>> the byte-code? e.g. like the code used for searching for symbol
>> references in the byte-code, what is that called? (Is that
>> MethodFinder stuff?)
>>
> There is InstructionStream, and of course see CompiledMethod itself.
>
>>        2.b) And what is the name (& path) of the C module that  
>> actually
>> implements the VM case statement (or whatever dispatch is used)?
>>
> VMMaker is _smalltalk_ package which implements such dispatch, and
> then translated to C & compiled to get a VM binary.
> Look for VMMaker package at squeaksource.com
>
>> 3. Once upon a time there was some code that processed Slang ...  
>> but I
>> have no idea whether that code is in Pharo, or completely antiquated
>> in all versions. (And if gone from Pharo, what should I look for and
>> in which version of Squeak?)
>>
>> A list of a few classes (in current use) would be greatly  
>> appreciated.
>>
> VMMaker: Interpreter, ObjectMemory
> Image: Compiler/Parser (but better look a NewCompiler)
>  InstructionStream, ContextPart, CompiledMethod
>
>> Thanks in advance,
>> Cam
>> PS: reading through list archives can be painful, as they often  
>> either
>> build on known information, or if you back up too far, the material -
>> you later learn- is completely antiquated.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

Marcus Denker-3
In reply to this post by Cameron Sanders-3

On 08.07.2009, at 20:45, Cameron Sanders wrote:

> 1) What classes should I look at to learn about the byte-code
> generation?
>

These slides give an introduction:

http://marcusdenker.de/talks/07SCGSmalltalk/11Bytecode.pdf

> 2) What are good examples of code that handles/manipulates/processes
> the byte-code?

There are multiple parts of the system dealing with bytecode:

1) VM. This is SLANG, compiled to C, compiled to a Binary.

2) Compiler. Generates Bytecode. Here the old one is very strange (to  
me at least).
Anthony's newcompiler is much easier to understand,
This has a backend called "IR Builder" that can be used to generate  
bytecode easily.
(Or to modify code on the level of bytecode abstraction, see http://scg.unibe.ch/research/bytesurgeon 
  )

3) Debugger / Simulator. This is in class ContextPart. A bytecode  
interpreter written in Smalltalk that the
    Debugger uses for stepping.

> e.g. like the code used for searching for symbol
> references in the byte-code, what is that called? (Is that
> MethodFinder stuff?)
>
No.

Check SystemNavigation, method #allCallsOn:


        Marcus





--
Marcus Denker - http://marcusdenker.de
PLEIAD Lab - Computer Science Department (DCC) - University of Chile


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

David T. Lewis
In reply to this post by Cameron Sanders-3
On Wed, Jul 08, 2009 at 04:44:16PM -0400, Cameron Sanders wrote:

>
> On Jul 8, 2009, at 3:43 PM, Igor Stasenko wrote:
> ...
> > VMMaker is _smalltalk_ package which implements such dispatch, and
> > then translated to C & compiled to get a VM binary.
> > Look for VMMaker package at squeaksource.com
> ...
>
> Awesome, thanks for the leads!
>
> -Cam
>

The VMMaker package is really a fundamental part of the original Squeak,
but is now split out and maintained as a separate package. For background,
read the "Back to the Future" paper as well as some of Tim Rowledge's
writings (Stef's "free books" web site should have most of this, also
search the Squeak swiki).

You were mentioning Slang translation in your question - this is sort
of a "late optimization" in which the interpreter, which is written
in Smalltalk and which can be run in Smalltalk, is translated to C
and linked to external support code for performance. But the VM
itself, including the bytecode interpreter, is written in Smalltalk,
and you can run it in Smalltalk (using InterpreterSimulator), and
use the debugger to look at the actual bytecode interpretation as
it happens.

Dave
 

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: byte codes, parse-tree walking, etc.

hernanmd
In reply to this post by Cameron Sanders-3
Hi Cameron,

2009/7/8 Cameron Sanders <[hidden email]>
       2.b) And what is the name (& path) of the C module that actually
implements the VM case statement (or whatever dispatch is used)?


I think the switch you're asking for is in the files interp.c and/or gnu-interp.c, in the function interpret(void).

Cheers,

Hernán

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
12