From: dpapathanasiou
Subject: Running Compiled Files: Accessing Top-Level
Date: 
Message-ID: <1139782383.698746.218490@g44g2000cwa.googlegroups.com>
I'm not sure whether or not this question relates to something common
across all implementations, but I was wondering how to gain access to
the top level of a process already running?

For example, suppose I kick-off a lisp process (using a compiled file)
to run in the background as nohup, so that it will continue to run
after I logout my session.

Then, when I login again, I can attach to that process with a lisp
top-level prompt, and have access to all of that process' memory and
variables.

I know how to do this with gdb on C++ and Java processes, so is there
an equivalent for lisp?

From: Pascal Bourguignon
Subject: Re: Running Compiled Files: Accessing Top-Level
Date: 
Message-ID: <87hd741a03.fsf@thalassa.informatimago.com>
"dpapathanasiou" <···················@gmail.com> writes:

> I'm not sure whether or not this question relates to something common
> across all implementations, but I was wondering how to gain access to
> the top level of a process already running?
>
> For example, suppose I kick-off a lisp process (using a compiled file)
> to run in the background as nohup, so that it will continue to run
> after I logout my session.
>
> Then, when I login again, I can attach to that process with a lisp
> top-level prompt, and have access to all of that process' memory and
> variables.
>
> I know how to do this with gdb on C++ and Java processes, 

Not really.


> so is there an equivalent for lisp?

If you want a strict equivalent: send a SIGINT to the lisp process, it
should break in the debugger REPL (unless otherwise programmed), and
from here, you can go back to the toplevel REPL.

Of course, you need to keep the stdin/stdout of the process at hand.
An easy way to do it is to use screen.  Some use detachtty, but I
don't know it.


But for the real thing, you can just embed a REPL server in your
application.  In addition to the normal stuff, listen on a socket, and
when receiving an incoming connection, provide a Read Eval Print Loop.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

HEALTH WARNING: Care should be taken when lifting this product,
since its mass, and thus its weight, is dependent on its velocity
relative to the user.
From: dpapathanasiou
Subject: Re: Running Compiled Files: Accessing Top-Level
Date: 
Message-ID: <1140113641.089587.137590@g43g2000cwa.googlegroups.com>
Pascal,

Many thanks for the tip on detachtty -- it was exactly what I was
looking for.

Between the instructions at http://www.cliki.net/detachtty and the
example at http://lisp.t2100cdt.kippona.net/lispy/home it was fairly
simple to set up.