Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
python to x86 compiler
Python C

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
clib
doc
junk
p0tests
p1tests
p2tests
p3tests
pylib
sandbox
.gitignore
BADTEST
LICENSE
README.md
analyze_test.py
makefile
pyc
pyc-dbg
pyc_asm_list.py
pyc_asm_nodes.py
pyc_astvisitor.py
pyc_closure.py
pyc_color.py
pyc_constants.py
pyc_dbg.py
pyc_dbg_data.py
pyc_dbg_elf.py
pyc_declassify.py
pyc_gen_name.py
pyc_heapify.py
pyc_ir.py
pyc_ir_nodes.py
pyc_lineage.py
pyc_localize.py
pyc_log.py
pyc_parser.py
pyc_ply_parser.py
pyc_reg_allocator.py
pyc_sir.py
pyc_sir_to_py.py
pyc_symtable.py
pyc_util.py
pyc_validator.py
pyc_var_analyzer.py
pyc_vis.py
run.sh
test-ir-line.sh
test-ir.sh
test.sh

README.md

pyc

a python -> x86 compiler written in python (with a supporting runtime c library)

intro

pyc was implemented following the design by CU EE/CS instructor Jeremy Siek (detailed in doc/notes.pdf) during my enrollment in Siek's compiler design class at CU. the runtime c library and pN/grader_tests/* regression tests were provided by Siek.

the pyc_dbg*.py and pyc-dbg files implement debugging functionality for binaries compiled with pyc/gcc using the python GDB extensions, the pyelftools package, and the distorm package.

building
  • to compile c library on 64 bit, get the proper headers/libraries.
    on ubuntu:
    sudo apt-get install gcc-multilib libc6-i386 libc6-dev-i386

python packages needed for debugging:

  • pyelftools: pip install pyelftools
  • distorm: pip install distorm3
the debugger

for the details on the debugger implementation, see pyc-dbg.pdf and pyc-dbg_presentation-full.pdf in the ./doc directory.

Something went wrong with that request. Please try again.