[ENH][PLUGIN] LargeIntegers plugin/module with bit logic

Stephan Rudlof sr at evolgo.de
Wed Mar 15 04:41:42 UTC 2000


"Raab, Andreas" wrote:
> 
> > > Using
> > > unresolved symbols in a library is not allowed on Windows
> > >(and on Macs as well AFAIK)
> >
> > In Linux it works:
> >       void error(char *s);
> > , declared in sq.h and defined in interp.c will be called.
> 
> I know but it's a dangerous thing to play with. [Random ObBesides: I always
> thought this kind of implicit linkage between DSOs close to being a design
> flaw. If you have several DSOs exporting 'foo()' you'll never know for sure
> which one is called from where].
> 
> Also, 'sq.h' should in general not be included in any plugin - since it can
> be compiled standalone you absolutely must go through the interpreter proxy
> and not rely on some (possibly version specific) definitions of the current
> VM. Otherwise you risk breaking the plugin with either a newer or an older
> VM.
>

Agree!

> > Questions to Andreas:
> >
> > Does stderr output work under Windows (e.g. by 'LargeIntegersPlugin
> > debug: true')?
> 
> Nope. Since Squeak is compiled as a GUI application it doesn't get an
> associated console to write stuff into. And, since implicit linkage is not
> supported, the special handling from within the VM (basically overriding
> printf() and fprintf() to redirect any such messages into a GUI window)
> doesn't take effect here. I could theoretically make this work by exporting
> printf() and fprintf() from the VM and then link the DLLs against the VM.
> But somebody has to give me A Very Good Reason to do so (it's a lot of work
> and I don't see any real use for it since for debugging

> you can always
> compile the plugin directly into the VM and then the VM overrides will take
> effect).

How to do this? Under Linux I have the implicit (but dangerous) linkage,
so I have never tried to do (but I'm interested in).

Another point:
Previously I suggested to make all not exported plugin functions
'static' as default to avoid name clashes with other modules. Now I
know, why not so many people have had this problem and suggestion
before: It's exactly because of no implicit linking at other platforms!
In spite of this I want to renew this suggestion. It leads to more
safety and avoids problems under Linux. Or is there any problem with it?

> 
> On the Mac it's actually a little different - you can see stuff written to
> stdout/stderr from a code fragment in a window popping up (it's quite
> annoying btw) but once you've switched back to Squeak it seems impossible to
> read what's been written into this window before (dunno why). So it doesn't
> make a lot of sense except for some final error message which results in
> aborting Squeak anyways (and that's what #error: does).

And how do you debug then on the Mac?
Is there a similar mechanism like under Windows (compiling directly in
the VM and redirecting to another window) available?


Stephan





More information about the Squeak-dev mailing list