Commit Graph

531 Commits

Author SHA1 Message Date
ncaklovic
32c1ca10bb Update ASTree.cpp
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2024-02-28 12:34:32 +01:00
ncaklovic
28b62b6534 Update bytecode.cpp
Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2024-02-28 12:34:15 +01:00
Michael Hansen
bb342a9be7 Merge pull request #460 from TiZCrocodile/support-for-WITH_CLEANUP_START,WITH_CLEANUP_FINISH
add support for `WITH_CLEANUP_START`,`WITH_CLEANUP_FINISH`
2024-02-27 15:52:57 -08:00
Alex
035f963f3d Aligning some opcodes for Python 3.11, 3.12: LOAD_GLOBAL, LOAD_ATTR 2024-02-27 23:12:03 +02:00
MrDakik
ab80ec1d2c moved compiled tests of with stmt to xfail 2024-02-27 19:20:50 +02:00
MrDakik
e8be65b2f3 add support for WITH_CLEANUP_START,WITH_CLEANUP_FINISH 2024-02-27 10:54:07 +02:00
Michael Hansen
d361ec3e7d Merge pull request #458 from TiZCrocodile/support-for-LOAD_CLASSDEREF
Added support for `LOAD_CLASSDEREF`
2024-02-26 14:27:51 -08:00
Michael Hansen
7559b782c1 Reindent test file 2024-02-26 14:27:20 -08:00
MrDakik
00d4b02d1e Added support for LOAD_CLASSDEREF
The opcode itself is exactly the same as `LOAD_DEREF`
1) The problem is when the class is a closure (e.g. defined inside a function body) then there is a `BUILD_TUPLE` after the `LOAD_BUILD_CLASS` which makes problems.
2) There is another problem which makes the `code->name()` of the class to be part of the function locals. (e.g. `func.<locals>.my_class` instead of `my_class`) which makes the check `srcString->isEqual(code->name().cast<PycObject>())` be invalid.
2024-02-26 16:52:31 +02:00
Michael Hansen
0a50980e8f Merge pull request #437 from kako57/master
Fixes #321 for arithmetic operators
2024-02-14 21:40:58 -08:00
Michael Hansen
7929dbe6e0 Add test case for #437 2024-02-14 21:36:27 -08:00
Michael Hansen
787090e0a5 Merge github.com:kako57/pycdc 2024-02-14 21:31:17 -08:00
Nenad Čaklović
5f225caf52 LOAD_ATTR operand changes in 3.12 2024-01-05 21:32:53 +01:00
Michael Hansen
2da061fc98 Merge pull request #423 from ncaklovic/master
COMPARE_OP operand changes in 3.12
2024-01-04 15:55:09 -08:00
Nenad Čaklović
830dd13228 COMPARE_OP operand changes in 3.12 2024-01-04 23:49:07 +01:00
Michael Hansen
7560149895 Ensure there is always space after the opcode (some opcode names are longer than 30 characters now) 2023-12-06 11:38:03 -08:00
Michael Hansen
ab6aaf6da3 Convert opcode maps to C++ source with macros.
This removes the requirement to run a python script to preprocess the
input files before compiling pycdas/pycdc.
2023-12-05 14:30:33 -08:00
Michael Hansen
20ac52d801 Remove PythonBytecode.txt.
The format was somewhat awkward and often redundant.  Anything that was
previously documented in the file is now moved to relevant code comments
or tables instead.
2023-12-05 13:43:50 -08:00
Michael Hansen
0c0e3597bd Add version and parameter info to bytecode_ops.inl 2023-12-05 13:24:00 -08:00
Michael Hansen
795ad1861d Also show the first line when using --pycode-extra 2023-11-30 12:49:04 -08:00
Michael Hansen
74b8f7eec7 Move LOAD_SUPER_ATTR cases closer to other name cases 2023-11-30 12:37:29 -08:00
Michael Hansen
b424ae8fd7 Refactor disassembly operand formatting to remove single-use functions.
This also cleans up an unintentionally duplicated case, and makes it more
obvious when such duplication occurs.
2023-11-30 10:16:00 -08:00
Michael Hansen
9c00554efb Add basic support for some Instrumented opcodes which should match their
non-instrumented versions.
2023-11-18 17:59:24 -08:00
Michael Hansen
9d1e156cec Correctly decode operand types for many newer opcodes in disassembly 2023-11-18 17:45:35 -08:00
Michael Hansen
a86a6eb54f Fix a couple of incorrect instructions in Python 3.1 2023-11-18 17:44:36 -08:00
Michael Hansen
3ffbb0aa20 Fix some incorrect opcode tables from Python 1.0-1.4
The dis.py from these versions was often out-of-date from the C source.
2023-11-16 14:51:42 -08:00
Michael Hansen
4ecdd1f81b Remove unused python_NN_unmap() functions 2023-11-16 11:27:31 -08:00
Michael Hansen
0c6128a895 Add missing ACCESS_MODE opcode from Python 1.0-1.4 2023-11-16 11:16:46 -08:00
Michael Hansen
57e16d19d1 Refactor bc_next to more clearly split pre- and post-3.6 behavior 2023-11-16 11:16:46 -08:00
asas1asas200
9ab04e2c0b Fix CMP0148 warning in CMakeLists.txt (#400)
* Fix CMP0148 warning in CMakeLists.txt

* bump cmake minimum required to 3.12

* Fix var name to match  new Find module
2023-11-16 08:07:00 -08:00
Jack
5936412a6f fix #396 Unsupported Node type: 27 (#397)
* fix #396 Unsupported Node type: 27

* Add test file

* Modify a little comment

* Modify the test pyc file name

* Delete redundant pyc files

* retest

* Add newline at EOF

---------

Co-authored-by: Michael Hansen <zrax0111@gmail.com>
2023-11-11 10:22:49 -08:00
Michael Hansen
c7d3315156 Clarify prefix check on interned string type 2023-11-09 15:45:43 -08:00
Michael Hansen
21c35b2f4c Simplify PycDict key/value storage a bit 2023-11-09 15:05:55 -08:00
Michael Hansen
e27faa1e88 Remove unnecessary sequence interface on PycDict 2023-11-09 14:20:15 -08:00
Michael Hansen
9b384ad1fa Add basic bytecode and disassembly support for Python 3.12 2023-11-09 12:17:03 -08:00
TheHellTower
b32f231e33 Add GEN_START support (#392)
* Apparently should be enough ?

* Add `GEN_START` test

* Add `GEN_START` test compiled

* Add `GEN_START` test tokenized

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* Smaller test since only POP is needed.

* dos2unix
2023-10-20 13:43:14 -07:00
Michael Hansen
d62c8adf89 Merge branch '3_11-support-for-new-opcodes' of https://github.com/TiZCrocodile/pycdc 2023-08-26 10:58:37 -07:00
Michael Hansen
b1a8563126 Merge pull request #378 from LNSSPsd/master
Fix the pointer's behavior on getting buffer from `PycBuffer`
2023-08-26 10:52:26 -07:00
Ruphane
9711a4abe5 Fix the pointer's behavior on getting buffer 2023-08-25 18:00:26 -07:00
Michael Hansen
f5c1d4262b Move comment closer to where it applies, plus some formatting consistency 2023-08-19 21:24:03 -07:00
Roman Avdeenko
916103179c Fix LOAD_GLOBAL_A operand printing for versions prior to 3.11 2023-08-19 17:43:04 +03:00
MrDakik
da859f5a2b Added support for opcodes: (in DESC)
`KW_NAMES`
`POP_JUMP_FORWARD_IF_FALSE`
`POP_JUMP_FORWARD_IF_TRUE`
`LOAD_GLOBAL`
2023-07-18 18:33:03 +03:00
Michael Hansen
bb54b27cd1 Move cmake_minimum_required to the top of CMakeLists, so it correctly affects everything else below it 2023-06-20 13:28:10 -07:00
Michael Hansen
753d42d94a Simplify string object printing to reduce code duplication 2023-06-09 09:09:03 -07:00
Michael Hansen
4b4f9f8edb Fix impossible condition in pycdas Code dump 2023-06-08 14:30:09 -07:00
Michael Hansen
32a0aec535 Use raw string literals to improve readability in OutputString 2023-06-06 11:20:32 -07:00
Michael Hansen
bf3599c87a Move some output stream parameters forward.
This allows us to avoid removing parameter defaults for these functions.
2023-06-05 13:56:25 -07:00
Michael Hansen
46ea76c0e9 Clean up file handling in main()s, and remove a leak 2023-06-05 13:54:26 -07:00
Michael Hansen
8bb8386764 Fix some issues with formatted_print:
* Add a va_list version which can be correctly used by ivprintf (fixes pycdas output)
* Use a `const char*` format parameter to avoid the need for clang warning workarounds
* Make better use of return values.
2023-06-05 13:49:04 -07:00
Michael Hansen
482c32d84e Merge commit 'c4c35fc5318b904d5141a7f3c4a70d80576c30da' 2023-06-05 11:18:20 -07:00