Psyco works by directly emitting machine code for the processor. Typically, it will write a large number of small blocks of code, with numerous jumps from one to the other.
As you can guess, debugging this machine code with traditional tools was difficult, so I had to write helpers. They can be found in the py-utils subdirectory. You need a version of Psyco compiled in debugging mode; see section 1.4 for instructions on how to build it.
) |
Run the script httpxam.py with as argument the name of the directory which contains the psyco.dump file to examine. This script formats the data as HTML pages and presents them via a web server built on Python's standard SimpleHTTPServer. When it is running, point your browser to http://127.0.0.1:8000.
httpxam.py probably only works on Linux. It requires the programs objdump or ndisasm to disassemble the code and nm to list symbol addresses in the Python and Psyco executables.
The cross-calling code buffers are presented as cross-linked HTML pages. Bold lines show the targets of another jump. If preceeded by a blank line, a bold line shows that another code buffer jumps directly at this position. The end of the buffer is often garbage; it is not code, but data added there (typically for the promotion of a value). There are various kind of code buffers, depending (only) on why Psyco produced it: