Where am I now, Really? A novel use of decompilation

By: Rocky Bernstein from NY.pm
Date: Wednesday, 15 August 2018 11:50
Duration: 20 minutes
Target audience: Any
Language: English
Tags: b::parsetree b:deparse debugger stack trace

How is finding out more precisely where your Perl program is when it runs like translating between Gaelic and English?

Perl was created by a language enthusiast, so it is only fitting to finish the circle and show how computer-to-human translation is like human-to-human translation. More so that I think most people have hitherto appreciated.

Decompiling is often used in conjunction with recovering lost source code, or reverse-engineering code when we do not have access to the source code. It can be optionally used in Data::Printer for code references you have stashed in your data structures.

I will describe a novel use: in tracebacks, debuggers, and similar places where accurate position reporting is desired, even in the presence of string evaluation where the source code was created at runtime.

I'll show how line numbers are vague and ambiguous.

The module B::Deparse has been around a long time for Perl. I have extended that in B::DeparseTree so that it can be used at runtime to show you where you are. I will also demo its use in a real debugger, and promised to include a reference to at least one of the great virtues of programmer espoused by Larry Wall.

See also http://blogs.perl.org/users/rockyb/2018/06/introducing-bdeparsetree-and-rewriting-bdeparse-part-1.html

Attended by: Tom Hukins, Rocky Bernstein, Gianni Ceccarelli (‎dakkar‎), Dagfinn Ilmari Mannsåker (‎ilmari‎), Dimitrios Kechagias, Choroba, Laurent Rosenfeld (‎lolo78‎), José Joaquín Atria (‎JJ‎), Moray Jones, Jean Forget, Todd Rinaldo (‎toddr‎), Dave Sherohman (‎dsheroh‎), Jan Seidl (‎JaSei‎), Jean-Baptiste Mazon, Matthew Chubb (‎mchubb‎), Johan Lindstrom, Andreas Koenig, Mischa Schwieger, Kang-min Liu (‎gugod‎), Aaron Crane (‎arc‎), cono, Dan Muey, scott, Andreas Huber, Steve Rogerson, Tom Bloor (‎TBSliver‎)

Community Sponsors

Enlightened Perl Organisation Magnum Solutions Logo Perl6 Community Perl Weekly