From: Jim C. <jc...@di...> - 2002-12-27 16:52:06
|
Roland Giersig wrote: > Sorry for replying so late... No problem - thanks for responding In case its not clear (and it appears that it was clear - or at least that you understood me - I just want to be sure) Im explicitly *not* trying to debug Expect or the external program it spawns, I want to avoid the debugger in the middle problem, and was hoping that I was insufficiently clever to have understood the debugger option that would suppress the sub-process' debugger. From what youve said, it would not be enough for the forked debugger to run in non-stop mode. So, Im thinking about trying to pre-spawn the external program, then attaching to it with my (modified) perl-prog under the debugger. Do you have any quick tips or advice wrt this approach ? tia jimc > > >> When trying to debug my cruft (elided), > >> I had a consistent problem hooking up to spawned process under the > >> debugger. > > Well, debugging programs that fork is not easy, and even binary > debuggers have their problems with such a case. It gets even worse for > the perl debugger: when the perl interpreter forks, it also means that > the debugger forks, in fact you are then dealing with two independent > debuggers that don't know of each other, but continue to share their > various filedescriptors, namely STDIN. So the parent process now sees > not the child it expects to, but the child-behind-a-debugger, which > may and often does result in confusion. > > I don't think there is really a solution for that problem, apart from > "if that hurts, don't do that". > > Oh, and that's why I'm trying to discourage the use of Expect (well, > actually IO::Tty) and point to other solutions, e.g. Net::Telnet > instead of spawning a telnet client. Expect still can be used with > Net::Telnet, but without the overhead of spawning another process. > There is even a > pure-perl implementation of ssh, but unfortunately without a > filedescriptor-interface that is usable with Expect... > > This leaves the good olde, but not very powerful debug-with-print... > > Sorry that I cannot be of more help. > > Roland > > > > ------------------------------------------------------- > This sf.net email is sponsored by: > With Great Power, Comes Great Responsibility Learn to use your power > at OSDN's High Performance Computing Channel > http://hpc.devchannel.org/ > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > . > |