Re: Unload after keybord interrupt

Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Tue, 30 Dec 1997 13:23:10 JST


Frank,

Hitting ^C pauses the program execution at the point where you press
the key so that you can continue by using '.c' command. The interpreter
does not percieve this situation as unloading safe situation.

Your fundamental request is to unconditional escaping from functaion call
stack and unloading files. Let me think our we can do this.

Workaround to this problem is to use '.return' command and hit Enter
until command prompt comes back to 'root[n]'. The '.return' command
forces the function to terminate. I hope it helps. .return command
is still premature. Let me know if you find more problem.

Fons,

About above request, I there seems to be a way of doing this easily.
With a small change, cint can break out from the function call stack upto
the top level. I'm doing this by setting global flag
G__return=G__RETURN_EXIT1. Because interpreter core can not know when
to reset G__return flag, only the top level caller of G__main() or
G__calc() can reset it, which means ROOT command prompt should reset
G__return=G__RETURN_NON after calling G__main() or G__calc().
I'd like to try this next year as soon as I get back from new year holiday.

Masaharu Goto

> Hi
>
> After sending a keybord interupt
> (^C) to a function which has been
> loaded with .L and then called it seems
> impossible to Unload or reaload the same function
> I allways get a message that the file is still busy.
> This remains even after a gROOT reset. Is there
> a more elegant way the reload the function other than
> quitting root and starting all over again ?
>
> Here a small sample session :
>
> the function is
>
> #include <iostream.h>
>
> void Test() {
>
> Int_t i = 0;
>
> while(1) { i++ ; cout << i <<'\n' ;}
> }
>
>
> root [1] .L test.C
> root [2] Test();
> 1
> 2
> 3
> 4
> 5
> :
> :
> (^C)
> *** Break *** keyboard interrupt
> Root > .U test.C
> Error: G__unloadfile() File "test.C" not loaded FILE:/scratch2/fdr/sige/root/./test.C LINE:7
> *** Interpreter error recovered ***
> root [3] .L test.C
> Function Test() busy. loaded after "/scratch2/fdr/sige/root/./test.C"
> Error: G__unloadfile() Can not unload "/scratch2/fdr/sige/root/./test.C", file busy FILE:/scratch2/fdr/sige/root/./test.C LINE:7
> root [4] gROOT->Reset();
> *** Interpreter error recovered ***
> root [5] .U test.C
> Error: G__unloadfile() File "test.C" not loaded FILE:/scratch2/fdr/sige/root/./test.C LINE:7
> *** Interpreter error recovered ***
> root [6] .L test.C
> Function Test() busy. loaded after "/scratch2/fdr/sige/root/./test.C"
> Error: G__unloadfile() Can not unload "/scratch2/fdr/sige/root/./test.C", file busy FILE:/scratch2/fdr/sige/root/./test.C LINE:7
> root [7] .q
>