Britton Kerin
Britton Kerin

Reputation: 477

how to run perl debugger as a plain STDIN/STDOUT REPL without readline/decorations/tty manipulation etc.?

I'd like to do something in bash like:

 coproc myPerlDebuggerServer { perl -d -e 42; }

then talk to that co-process via shell functions to get my own interactive interface to the debugger.

Of course this doesn't work as is because perl -d -e 42 uses decorations/readlin/terminal/etc.

I found Devel::REPL but it had a build failure with cpanm, and anyway I'd like to keep the familiar commands from perl -d. I just need it to print a distinctive-enough prompt so when I know it's done responding :)

Suggestions?

Upvotes: 1

Views: 103

Answers (1)

LanX
LanX

Reputation: 498

Suggestions?

you can communicate to perl5db.pl via sockets, that's how the debugger integration is done in IDEs. Hence you can build any frontend you want.

See https://perldoc.perl.org/perl5db.pl#SOCKET-HANDLING

Also Devel::ptkdb (https://metacpan.org/pod/Devel::ptkdb) an example for a TkGUI interfacing to the debugger.

FWIW: Your question is quite fuzzy and I think it's a XY problem, but well you asked for this.

Upvotes: 2

Related Questions