<br><br><div class="gmail_quote">On Sat, Nov 8, 2008 at 6:50 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d"><br>
On 7-Nov-08, at 11:48 PM, Neil Baylis wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ah well, egg on face and all that.<br>
<br>
I've uploaded a new version of my iTunes visualizer with Scheme REPL.<br>
The version I uploaded previously was accidentally linked against libgambc.dylib and required that to be in the right place to work.<br>
This version is correctly linked against libgambc.a and should work even if you don't have Gambit installed.<br>
<br>
For anyone interested, you can download scmviz.tar.gz<br>
<br>
If you download it and unpack the archive, you'll find a README file with instructions.<br>
</blockquote>
<br>
<br></div>
Great! I got the original version working by configuring with --enable-shared and doing a "make install".<br>
<br>
I also hooked up your plugin to the remote debugger I am working on with Guillaume Cartier, which will be integrated in his Jedi IDE.  The debugger and the program being debugged (the debuggee) are separate processes which communicate over TCP.  Currently the debugger is rather simplistic; it pops up a new xterm for each REPL that is created.  Conceptually each Gambit thread has its own REPL, but the actual REPL is created lazily when there is an error, a REPL output, such as with (pp 123), or an explicit call to create a REPL, such as (##repl-debug-main).<br>

<br>
The code is attached below.  To try it out you need to have Gambit v4.3.0 and X11 installed (for xterm), then do this:<br>
<br>
% cd ~<br>
% tar zxf rm.tar.gz<br>
% cd rm<br>
% gsi debugger -   # final dash is important!<br>
<br>
then start iTunes, start playing some music and the visualizer by typing clover-T and ask the plugin for a REPL by typing ctrl-R.  In that REPL type<br>
<br>
(load "~/rm/itunes")<br>
<br>
This creates 2 threads which each start a REPL (so 2 xterms will pop up).  In REPL #1 enter (top) to get a continuously update of the state of the threads.  You might want to widen the window a bit to avoid scrolling problems.  Then in REPL #2 you can evaluate expressions concurrently with the music playing.  For example (expt 3 1000000).  Note that the thread's state shows up in REPL #1 and that this does not stop iTunes from playing music or refreshing the visualizer.<br>

<br>
The debugger can also start REPLs for any other Gambit programs.  For example, in a different shell you can run<br>
<br>
% gsi ~/rm/debuggee -<br>
<br>
And an xterm will popup with the REPL of the primordial thread.  You can type (start-new-repl) to create a new thread which starts a REPL in a new xterm.<br>
<br>
It will be neat when this remote debugging system is fully integrated into Gambit and Jedi!<br><font color="#888888">
<br>
Marc<br>
<br>
<br>
</font><br><br>
<br></blockquote></div><br>Wow, that is very cool. Supposedly, apple prevents gdb from attaching to iTunes, so this is an interesting way to make plugins easier to debug.<div><br></div><div>BTW, I tried exiting from one of the popped up REPLs (by typing ctrl-d a few times). When I did so, iTunes crashed with a bus error. </div>
<div><br></div><div><br></div><div>Neil<br clear="all"><br>-- <br><a href="http://www.pixpopuli.com">http://www.pixpopuli.com</a><br>
</div>