<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 30, 2017 at 2:21 AM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="gmail-"><br>
On Sat, Apr 29, 2017 at 10:08:23AM -0600, Daniel Drake wrote:<br>
> Hi Dave,<br>
><br>
> On Sat, Apr 29, 2017 at 9:58 AM, David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br>
> > I don't think that the camera plugin was ever made 64-bit clean. A bug report<br>
> > is at <a href="http://bugs.squeak.org/view.php?id=7816" rel="noreferrer" target="_blank">http://bugs.squeak.org/view.<wbr>php?id=7816</a><br>
> ><br>
> > This would be a good project for an interested volunteer :-)<br>
><br>
> I'm an interested volunteer, knowledgeable of 32 vs 64 bit challenges<br>
> but with no squeak-vm experience. Can you briefly provide some<br>
> direction of where to start here?<br>
><br>
> Are there any other plugins that have previously been made 64-bit<br>
> clean? (Maybe there is a similar example in svn history and I can find<br>
> some direction from that.)<br>
<br>
<br>
</span>Hi Daniel,<br>
<br>
Great, thanks for looking into this!<br>
<br>
SoundPlugin and SqueakSLL are examples of plugins that required updates<br>
for 64-bit.<br>
<br>
The majority of issues involve storage of 64-bit pointer values in 32-bit<br>
integers. Usually this is fixed by providing correct type declarations<br>
throughout the support code, and by making sure that the translated code<br>
from the plugin class in VMMaker produces code with type declarations<br>
that match the support code.<br>
<br>
In the case of CameraPlugin, I would be inclined to start by looking at<br>
the support code in platforms/unix/plugins/<wbr>CameraPlugin/ to get an idea<br>
of what the function declarations are (or should be). Look through it<br>
for any type casts, usually these are a red flag for something you are<br>
going to need to fix.<br>
<br>
If everything looks good in platforms/[unix|win32|Moc OS|iOS] then the<br>
next thing to check will be the declarations in<br>
platforms/Cross/plugins/<wbr>CameraPlugin/CameraPlugin.h. These will probably<br>
be ok, but make sure that anything declared as int is really a 32-bit<br>
integer value.<br>
<br>
If you are statisfied that the support code is all in good order for<br>
compiling on 64-bits, then take a look at CameraPlugin in your VMMaker<br>
image, and at it sgenerated source code in src/plugins/CameraPlugin/<wbr>CameraPlugin.c.<br>
<br>
Look for places in the generated code where the support code functions<br>
are being called incorrectly, or where methods in the plugin itself<br>
use default sqInt variable declarations that should be explicitly<br>
declared as something else.<br>
<br>
I do this sort of work using an interpreter VM on a 64-bit Linux<br>
system because it lets me easily compile 64-bit VMs that run on<br>
32-bit sqInt object memories, which is the combination that most<br>
reliably finds type declaration problems.<br>
<br>
You will probably want to run your VMs under gdb to locate problems,<br>
but don't be afraid to hack some printf's into your generated plugin<br>
source in order to find problems. Do a fflush after each printf<br>
so you can see the output right before your VM crashes.<br>
<br>
Thanks and HTH,<br>
Dave<br>
<br></blockquote><div><br></div><div>Some general background info...</div><div><br></div><div>A Tour of the Squeak Object Engine<br></div><div><a href="http://coweb.cc.gatech.edu/squeakbook/uploads/rowledge.pdf">http://coweb.cc.gatech.edu/squeakbook/uploads/rowledge.pdf</a> </div><div><br></div><div>Extending the Squeak Virtual Machine<br></div><div><a href="http://sdmeta.gforge.inria.fr/FreeBooks/CollectiveNBlueBook/greenberg.pdf">http://sdmeta.gforge.inria.fr/FreeBooks/CollectiveNBlueBook/greenberg.pdf</a><br></div><div><br></div></div>cheers -ben</div></div>