Trepan-Debuggers/python3-trepan

Error importing deparse: <class ModuleNotFoundError'> + ....deval

Opened this issue · 4 comments

I'm running newest version of trepan3k (1.2.10) on ubuntu.20.04.

I've pip installed deparse (v0.2.0 (?)) but still getting the message:

Error importing deparse: <class ModuleNotFoundError'>
Error importing deval: <class ModuleNotFoundError'>

then the program being debugged starts, BUT 'n' command is sometimes unusably slow (takes a few minutes to complete). pdb does is very fast in contrast.

I'd like to get rid of messages above in hope this is the reason for very slow python3-trepan work

I will probably be putting out a new version of trepan3k soon. What version of Python uncompyle6, xdis, and decompyle3 an are you running?

pip show xdis uncompyle6 decompile3

will give version information.

As for "next", trepan3k tries to be more reliable that pdb has been traditionally, so it is spending a lot of cycles checking whether to stop. This code needs to be totally reworked to make it work faster.

As for the Module errors go into a Python session and run:

import trepan.processor.command.deval

and report what error that is showing.

Hallo @rocky. Thank you for the answer and pointing out good hints

$ pip show xdis uncompyle6 decompile3
WARNING: Package(s) not found: decompile3, uncompyle6
Name: xdis
Version: 6.1.0
Summary: Python cross-version byte-code library and disassembler
Home-page: https://github.com/rocky/python-xdis
Author: 
Author-email: Rocky Bernstein <rb@dustyfeet.com>
License: GPL
Location: /home/user/.virtualenvs/venv/lib/python3.8/site-packages
Requires: click, pygments, six, term-background, xdis
Required-by: pyficache, trepan3k, xdis

thanks to the above, I did following (I'm using ubuntu's 20.04 stock python, ie 3.8.10):

$ pip install git+https://github.com/rocky/python-decompile3
...
Successfully built decompyle3
Installing collected packages: decompyle3
Successfully installed decompyle3-3.9.2.dev0

Both 'ModuleNotFoundError' error messages disappeared.

I've also uninstalled deparse 0.2.0 of course and DID NOT install decompyle6.

This did not help on speed of 'next' command thoughy. The python instruction is some myapp.init() function that has a bit more to do, but it might be a quite common scenario to have such heavier parts of code on the way.
I've also set breakpoint AFTER myapp.init() function then 'c', but it didn't help on speed.

Are there any tips you do in such a case in your workflow?

to have more insight, I've also just re-tested pdb to be sure how it comes with exactly the same version of my code and it still stepped through fast enough (a few seconds).

Are there any tips you do in such a case in your workflow?

I generally insert from trepan.api import debug; debug() statements. Setting breakpoint without next is fast too.

Basically the code in trepan.lib.core needs to be rewritten or simplified to match what pdb does in Bcmd. Are you up for that?

I generally insert from trepan.api import debug; debug() statements.

I'll try this

Setting breakpoint without next is fast too.

It took longer (minutes) to reach the breakpoint, comparing to what pdb does. I'll double check.