./devel/py-xdis, Python cross-version byte-code disassembler and marshal routines

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 6.1.0, Package name: py311-xdis-6.1.0, Maintainer: pkgsrc-users

The Python dis module allows you to disassemble bytecode from the same version
of Python that you are running on. But what about bytecode from different
versions?

That's what this package is for. It can "marshal load" Python bytecodes from
different versions of Python. The command-line routine pydisasm will show
disassembly output using Python 3.6 disassembly conventions.

Also, if you need to modfiy and write bytecode, the routines here can be of
help. There are routines to pack and unpack the read-only tuples in Python's
Code type. For interoperability between Python 2 and 3 we provide our own
versions of the Code type, and we provide routines to reduce the tedium in
writing a bytecode file.

This package also has an extensive knowledge of Python bytecode magic numbers,
including Pypy and others, and how to translate from sys.sys_info major, minor,
and release numbers to the corresponding magic value.

So If you want to write a cross-version assembler, or a bytecode-level
optimizer this package may also be useful. In addition to the kinds of
instruction categorization that dis offers, we have additional categories for
things that would be useful in such a bytecode optimizer.


Required to run:
[devel/py-setuptools] [lang/py-six] [devel/py-click] [lang/python37]

Required to build:
[pkgtools/cwrappers]

Master sites:

Filesize: 392.396 KB

Version history: (Expand)


CVS history: (Expand)


   2024-03-23 07:49:52 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-xdis: updated to 6.1.0

6.1.0 2024-03-15
=================

Lots of changes major changes. API has changed.

We now support many disassembly options:
  * classic:  disasm-like output
  * bytes: disasm-like output with bytecode
  * extended: simple interpretation of previous sequence of instructions
  * extended-bytes: same as above, but with "bytes" bytecode ouptut
  * header: show header/metadata information only

This is reflected in the `--format` (`-F`) options on `pydisasm`.
Option `--show-source` (`-S`) gives add the source text line (or part of it) \ 
before assembly instructions that implement the line.

Released Python magic numbers have been updated as of this release (up to Python \ 
3.12.2, including PyPy magic numbers.

Some support for the [GraalVM](https://www.graalvm.org/python/)
implementation of Python started.

Many bugs fixed.

A lot of Linting and coding style modernization.

typing.NameTuple used for Python versions that support this.
Additional fields "start_offset" and "tos_str" added to \ 
instruction.

Elliot Tarbet (2elli) largely provided support for Python 3.11 and 3.12 bytecode
   2023-01-16 10:26:23 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-xdis: updated to 6.0.5

6.0.5 2022-12-22
=================
* Detect versions pypy3.8.15, pypy-3.9.15
* Dectect Python 3.{7,8,9}.14 3.10.{5,6,7}
* correct 3.10+ pydisasm -F xasm label
* Revise marshal error handling
* Improve PyPy 3.7 `CALL_FUNCTION` arg interpretation
* Fix 1.5-2.x bugs in line number encoding
* Fix showing `MAKE_FUNCTION` operand
* Miscellaneous lint, black, and isort changes
   2022-05-22 21:05:00 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-xdis: updated to 6.0.4

6.0.4 2022-05-19 HF+LB-1
========================
* Detect 3.7.[7-13], 3.9.[8-13], 3.10.[1-4], PyPy 2.7.12, 3.[8-9]pypy
* Correct line-number detection on Python 1.0-1.4
* Handle SET_LINENO in older pythons
* Warn about wrong names in after RESERVE_FAST in older Pythons
* Some PyPy x-3.9.7 tolerance
* Add Pypy 3.8 support
* Better PyPy 3.6 formatting
* Correct relative jump target calculation in 3.10
   2022-01-05 16:41:32 by Thomas Klausner | Files touched by this commit (289)
Log message:
python: egg.mk: add USE_PKG_RESOURCES flag

This flag should be set for packages that import pkg_resources
and thus need setuptools after the build step.

Set this flag for packages that need it and bump PKGREVISION.
   2022-01-04 21:55:40 by Thomas Klausner | Files touched by this commit (1595)
Log message:
*: bump PKGREVISION for egg.mk users

They now have a tool dependency on py-setuptools instead of a DEPENDS
   2021-12-17 01:15:47 by Thomas Klausner | Files touched by this commit (2)
Log message:
py-xdis: does not build with python 2.7, mark it so

Also mark packages using it that way.
   2021-11-10 17:09:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-xdis: updated to 6.0.3

6.0.3
* xasm format fixes
* more Python version tuple compare conversions
* add `version_str_to_tuple()` to convert the other way. This is useful in xasm, \ 
for example.
   2021-10-31 09:40:03 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-xdis: updated to 6.0.2

6.0.2 2021-10-29
=================

* Remove str2float, sysinfo2float and magic_int2float. With Python 3.10 this is no
  longer tenable
* Reduce PYTHON_VERSION usage in xdis.
* Allow optional delimeter and start length in `version_tuple_to_str()`
* fix logic bug in setting MAGIC
* Add a little Python 3.8.5 Graal (Java VM) knowledge

6.0.1 2021-10-22
=================

* Add PyPy 3.8 opcodes and disassembly
* Accept Python 3.8.12
* Fix some small lingering bugs introduced converting Python version number \ 
floats to tuples

6.0.0 2021-10-15
=================

Reworked for Python 3.10.

We had been internally using floating point numbers for version testing.
Clearl this doesn't work to distinguish 3.1 from 3.10.
(This was a flaw known about for a while and we'd been avoiding).

* Add 3.10 opcodes.
* Add 3.9 and 3.10 testing.
* Some tolerance for running from 3.11
* Update magic numbers
* Expanding testing to include pyston and PyPy 3.7
* Improve distribution packaging, e.g. Python 3 wheels should no longer be \ 
attmpted on Python 2.x