Work environment
| Questions |
Answers |
| System Capstone runs on OS/arch/bits |
Ubuntu x86_64 |
| Capstone module affected |
riscv |
| Source of Capstone |
pip |
| Version/git commit |
6.0.0a9 |
Expected behavior
Code using the CS_MODE_RISCVC constant in capstone 5 fails to compile against capstone 6. The constant was renamed to CS_MODE_RISCV_C in #2756
V5:
|
CS_MODE_RISCV32 = 1 << 0, ///< RISCV RV32G |
|
CS_MODE_RISCV64 = 1 << 1, ///< RISCV RV64G |
|
CS_MODE_RISCVC = 1 << 2, ///< RISCV compressed instructure mode |
V6:
|
CS_MODE_RISCV32 = 1 << 0, ///< RISCV RV32G |
|
CS_MODE_RISCV64 = 1 << 1, ///< RISCV RV64G |
|
CS_MODE_RISCV_C = 1 << 2, ///< RISCV compressed instructure mode |
There is no CAPSTONE_RISCV_COMPAT_HEADER define to bring back the old name similar to the one for Aarch64 and systemz. The code is expected to compile.
cstest has a legacy mapping for the old name
|
{ .str = "CS_MODE_RISCV32", .val = CS_MODE_RISCV32 }, |
|
{ .str = "CS_MODE_RISCV64", .val = CS_MODE_RISCV64 }, |
|
{ .str = "CS_MODE_RISCVC", .val = CS_MODE_RISCV_C }, |
|
{ .str = "CS_MODE_RISCV_A", .val = CS_MODE_RISCV_A }, |
|
{ .str = "CS_MODE_RISCV_C", .val = CS_MODE_RISCV_C }, |
Actual behavior
The CS_MODE_RISCVC name is not found, compilation aborts. Similarly in the Python bindings.
Steps to reproduce the behavior
(Testing with Python due to JonathanSalwan/ROPgadget#223)
from capstone import *
print(CS_MODE_RISCVC)
Work environment
Expected behavior
Code using the
CS_MODE_RISCVCconstant in capstone 5 fails to compile against capstone 6. The constant was renamed toCS_MODE_RISCV_Cin #2756V5:
capstone/include/capstone/capstone.h
Lines 222 to 224 in e17ee44
V6:
capstone/include/capstone/capstone.h
Lines 259 to 261 in 8b2772f
There is no
CAPSTONE_RISCV_COMPAT_HEADERdefine to bring back the old name similar to the one for Aarch64 and systemz. The code is expected to compile.cstest has a legacy mapping for the old name
capstone/suite/cstest/include/test_mapping.h
Lines 172 to 176 in 8b2772f
Actual behavior
The
CS_MODE_RISCVCname is not found, compilation aborts. Similarly in the Python bindings.Steps to reproduce the behavior
(Testing with Python due to JonathanSalwan/ROPgadget#223)