Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How To activate command line history in debugger?

Reply
Thread Tools

How To activate command line history in debugger?

 
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      09-08-2003
Hi all,


does anybody know how to enable the command line history in the debugger?

Under Suse 8.2 is it already active. Not under Knoppix 3.1/3.2.

I am a newbie in perl and don't understand the explanation in "man
perldeb" to install Term::ReadKey and Term::Readline. I tried to create
the file .perldb in ~ with the content
use Term::ReadKey;
use Term::Readline;
but this does not enable the history feature. BTW in the perl lib dirs
is a ReadLine.pm but no a ReadKey.

Any hints are appreciated.

Regards, Kurt

 
Reply With Quote
 
 
 
 
Daniel Pfeiffer
Guest
Posts: n/a
 
      09-09-2003
Saluton, Moin,

Kurt Kronschnabl <k.kronschnabl_nospm_@ica-intercom-akademie.de> skribis:

> does anybody know how to enable the command line history in the debugger?
>
> Under Suse 8.2 is it already active. Not under Knoppix 3.1/3.2.
>
> I am a newbie in perl and don't understand the explanation in "man
> perldeb" to install Term::ReadKey and Term::Readline.


Versuch's stattdessen mit Emacs M-x shell (M- heißt normalerweise Alt-Taste). Das gibt Dir eine Art Terminal in einem Emacs Puffer. Wenn Du auf der letzten Zeile nach dem Prompt Return, M-p oder M-n benutzt ist das, das was Du brauchst. Du hast aber auch die ganze Interaktion im Puffer, und kannst von dort Befehle nochmal abschicken oder das ganze sogar editieren

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
------
-- My other stuff here too, make.pl, sawfish...: --
------
-- http://dapfy.bei.t-online.de/ --
 
Reply With Quote
 
 
 
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      09-09-2003


Daniel Pfeiffer schrieb:
> Versuch's stattdessen mit Emacs M-x shell (M- heißt normalerweise Alt-Taste). Das gibt Dir eine Art Terminal in einem Emacs Puffer. Wenn Du auf der letzten Zeile nach dem Prompt Return, M-p oder M-n benutzt ist das, das was Du brauchst. Du hast aber auch die ganze Interaktion im Puffer, und kannst von dort Befehle nochmal abschicken oder das ganze sogar editieren


Sounds good, but please give me a hint how to activate this? Do I need
to create a .perldb file?

Regards, Kurt

 
Reply With Quote
 
Daniel Pfeiffer
Guest
Posts: n/a
 
      09-09-2003
Saluton, Moin,

Kurt Kronschnabl <kurt.kronschnabl-> skribis:

> Daniel Pfeiffer schrieb:
> > Versuch's stattdessen mit Emacs M-x shell (M- heißt normalerweise Alt-Taste). Das gibt Dir eine Art Terminal in einem Emacs Puffer. Wenn Du auf der letzten Zeile nach dem Prompt Return, M-p oder M-n benutzt ist das, das was Du brauchst. Du hast aber auch die ganze Interaktion im Puffer, undkannst von dort Befehle nochmal abschicken oder das ganze sogar editieren

>
> Sounds good, but please give me a hint how to activate this? Do I need
> to create a .perldb file?


M-x shell
$ perl -d /tmp/randloop

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main:/tmp/randloop:3): while( sleep 1 ) {
DB<1> s
main:/tmp/randloop:4): print ':', rand(), "\n";
DB<1> s
:0.530385083825426
main:/tmp/randloop:3): while( sleep 1 ) {
DB<1> s
main:/tmp/randloop:4): print ':', rand(), "\n";
DB<1> s
:0.668097208810167
main:/tmp/randloop:3): while( sleep 1 ) {
DB<1> q
$

(with highlighting for the prompts When you hit Return at the end of buffer, everything after the prompt gets sent. On Return elsewhere, the command on that line first gets copied to the end.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- GPL 3: take the wind out of Palladium's sails! --
------
-- My other stuff here too, make.pl, sawfish...: --
------
-- http://dapfy.bei.t-online.de/ --
 
Reply With Quote
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      09-10-2003

Daniel Pfeiffer schrieb:

Hi Daniel,

> M-x shell


Sorry "I am standing on the hose" :=) What do you mean with this line
and the Debug session?

> (with highlighting for the prompts
> When you hit Return at the end of buffer,
> everything after the prompt gets sent.
> On Return elsewhere,
> the command on that line first gets copied to the end.


This sounds good again, but again: How to do?

Regards, Kurt

 
Reply With Quote
 
Peter Scott
Guest
Posts: n/a
 
      09-15-2003
In article <bjhde7$g22$07$>,
Kurt Kronschnabl <k.kronschnabl_nospm_@ica-intercom-akademie.de> writes:
>does anybody know how to enable the command line history in the debugger?
>
>Under Suse 8.2 is it already active. Not under Knoppix 3.1/3.2.
>
>I am a newbie in perl and don't understand the explanation in "man
>perldeb" to install Term::ReadKey and Term::Readline. I tried to create
>the file .perldb in ~ with the content
>use Term::ReadKey;
>use Term::Readline;
>but this does not enable the history feature. BTW in the perl lib dirs
>is a ReadLine.pm but no a ReadKey.


You need to install the missing module. Become root and type

perl -MCPAN -e 'install Term::ReadKey'

If you have never run CPAN.pm before there will be a slew of questions
to answer that should be self explanatory.

Without this module Perl has no mechanism to intercept the arrow key
presses and interpret them as requests to traverse the command line history.

--
Peter Scott
http://www.perldebugged.com
 
Reply With Quote
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      09-30-2003
Peter Scott wrote:

> perl -MCPAN -e 'install Term::ReadKey'
>
> If you have never run CPAN.pm before there will be a slew of questions
> to answer that should be self explanatory.
>
> Without this module Perl has no mechanism to intercept the arrow key
> presses and interpret them as requests to traverse the command line history.
>


Hi Peter,

yet today I visited the NG after longer time again. Thank you very much!
That's it what I have searched for!!

Best regards, Kurt

 
Reply With Quote
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      09-30-2003
Peter Scott wrote:
> You need to install the missing module. Become root and type
>
> perl -MCPAN -e 'install Term::ReadKey'


Hello Peter,

I am afraid I have to install more then ReadKey. What I get is:

knoppix@p01kno:~$ perl -MCPAN -e 'install Term::ReadKey'
Can't locate object method "install" via package "Term::ReadKey" at -e
line 1.

Could you please give me an idea what is missing?

The Output of perl -V is as follows:

knoppix@p01kno:~$ perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.19, archname=i386-linux-thread-multi
uname='linux cyberhq 2.4.19 #1 smp sun aug 4 11:30:45 pdt 2002 i686
unknown unknown gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN
-Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr
-Dprivlib=/usr/share/perl/5.8.0 -Darchlib=/usr/lib/perl/5.8.0
-Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5
-Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local
-Dsitelib=/usr/local/share/perl/5.8.0
-Dsitearch=/usr/local/lib/perl/5.8.0 -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl
-Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm
-Duseshrplib -Dlibperl=libperl.so.5.8.0 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O3',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing'
ccversion='', gccversion='3.2.2', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.3.1.so, so=so, useshrplib=true,
libperl=libperl.so.5.8.0
gnulibc_version='2.3.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Feb 17 2003 12:38:57
@INC:
/etc/perl
/usr/local/lib/perl/5.8.0
/usr/local/share/perl/5.8.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8.0
/usr/share/perl/5.8.0
/usr/local/lib/site_perl

The onliest pm is /usr/share/perl/5.8.0/Term/ReadLine.pm and
/usr/share/perl5/Debconf/FrontEnd/Readline.pm but no ReadKey. This is
the case as well for suse 8.2. And there the history works perfect.

I am not (yet!) so familiar with perl packages and their installation

Best regards,

Kurt

 
Reply With Quote
 
Peter Scott
Guest
Posts: n/a
 
      09-30-2003
In article <blbt34$si7$03$>,
Kurt Kronschnabl <kurt.kronschnabl-> writes:
>Peter Scott wrote:
>> You need to install the missing module. Become root and type
>>
>> perl -MCPAN -e 'install Term::ReadKey'

>
>Hello Peter,
>
>I am afraid I have to install more then ReadKey. What I get is:
>
>knoppix@p01kno:~$ perl -MCPAN -e 'install Term::ReadKey'
>Can't locate object method "install" via package "Term::ReadKey" at -e
>line 1.
>
>Could you please give me an idea what is missing?


That's odd. That means that Term::ReadKey is already installed.
(You could get around that error to update it via CPAN.pm with
perl -MCPAN -e shell
install Term::ReadKey
but that is not the point.)

Let's make certain whether you have that module or not. Send the output of:

perl -MTerm::ReadKey -e 0
perl -dle 'print $INC{"Term/ReadKey.pm"}' # Then type 'c'
perl -MCPAN -le 'print $INC{"Term/ReadKey.pm"}'

I am having a hard time seeing how the same perl as gave you the debugger
problem can give you that output. Are you sure that root doesn't have a
different path causing it to run a different perl?

>The Output of perl -V is as follows:

[snip]
>
>The onliest pm is /usr/share/perl/5.8.0/Term/ReadLine.pm and
>/usr/share/perl5/Debconf/FrontEnd/Readline.pm but no ReadKey. This is
>the case as well for suse 8.2. And there the history works perfect.



--
Peter Scott
http://www.perldebugged.com
 
Reply With Quote
 
Kurt Kronschnabl
Guest
Posts: n/a
 
      10-01-2003
Hello Peter.

As already told, there is no "ReadKey.pm" in a Knoppix and Suse 8.2
installation. ReadLine is available in both distries. But only under
Suse it works.

Here the results for ReadKey:

knoppix@p01kno:~$ perl -MTERM::ReadKey -e 0
Can't locate TERM/ReadKey.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8.0 /usr/share/perl/5.8.0
/usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.

knoppix@p01kno:~$ perl -dle 'print $INC{"Term/ReadKey.pm"}'

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main:-e:1): print $INC{"Term/ReadKey.pm"}
DB<1> c

Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1>

knoppix@p01kno:~$ perl -MCPAN -le 'print $INC{"Term/ReadKey.pm"}'

knoppix@p01kno:~$

> Are you sure that root doesn't have a
> different path causing it to run a different perl?


Yes, very shure. Under root it is the same effect.

And here the results for ReadLine:

knoppix@p01kno:~$ perl -dle 'print $INC{"Term/ReadKey.pm"}'

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main:-e:1): print $INC{"Term/ReadKey.pm"}
DB<1> c

Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1> q
knoppix@p01kno:~$ perl -MCPAN -le 'print $INC{"Term/ReadKey.pm"}'

knoppix@p01kno:~$ perl -MTERM::ReadLine -e 0
Can't locate TERM/ReadLine.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8.0 /usr/share/perl/5.8.0
/usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.
knoppix@p01kno:~$ perl -dle 'print $INC{"Term/ReadLine.pm"}'

Loading DB routines from perl5db.pl version 1.19
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main:-e:1): print $INC{"Term/ReadLine.pm"}
DB<1> c
/usr/share/perl/5.8.0/Term/ReadLine.pm
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1> q
knoppix@p01kno:~$ perl -MCPAN -le 'print $INC{"Term/ReadLine.pm"}'

knoppix@p01kno:~$

Hope this tells you more than me :=)

Best Regards, Kurt

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
what does this error mean `activate': can't activate activesupport (=3.0.1, runtime) for ["activerecord-3.0.1"] Junkone Ruby 2 10-27-2010 09:13 AM
linux console command line history kaklis@gmail.com Python 4 07-21-2010 08:03 AM
command line to delete ie browsing history John Grandy ASP .Net 6 05-13-2007 08:37 AM
Newbie Question: Pre-populating the Command Line History Buffer CJ Morton Cisco 3 11-03-2003 11:00 PM



Advertisments