mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-30 06:32:43 +00:00
Expose Gpr registers enums to python
This commit is contained in:
parent
63591003f6
commit
c8ecfb600e
43
rabbitizer/RegGprN32.pyi
Normal file
43
rabbitizer/RegGprN32.pyi
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# SPDX-FileCopyrightText: © 2022 Decompollaborate
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .Enum import Enum
|
||||
|
||||
|
||||
class RegGprN32:
|
||||
zero: Enum
|
||||
at: Enum
|
||||
v0: Enum
|
||||
v1: Enum
|
||||
a0: Enum
|
||||
a1: Enum
|
||||
a2: Enum
|
||||
a3: Enum
|
||||
a4: Enum
|
||||
a5: Enum
|
||||
a6: Enum
|
||||
a7: Enum
|
||||
t0: Enum
|
||||
t1: Enum
|
||||
t2: Enum
|
||||
t3: Enum
|
||||
s0: Enum
|
||||
s1: Enum
|
||||
s2: Enum
|
||||
s3: Enum
|
||||
s4: Enum
|
||||
s5: Enum
|
||||
s6: Enum
|
||||
s7: Enum
|
||||
t8: Enum
|
||||
t9: Enum
|
||||
k0: Enum
|
||||
k1: Enum
|
||||
gp: Enum
|
||||
sp: Enum
|
||||
fp: Enum
|
||||
ra: Enum
|
43
rabbitizer/RegGprO32.pyi
Normal file
43
rabbitizer/RegGprO32.pyi
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# SPDX-FileCopyrightText: © 2022 Decompollaborate
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from .Enum import Enum
|
||||
|
||||
|
||||
class RegGprO32:
|
||||
zero: Enum
|
||||
at: Enum
|
||||
v0: Enum
|
||||
v1: Enum
|
||||
a0: Enum
|
||||
a1: Enum
|
||||
a2: Enum
|
||||
a3: Enum
|
||||
t0: Enum
|
||||
t1: Enum
|
||||
t2: Enum
|
||||
t3: Enum
|
||||
t4: Enum
|
||||
t5: Enum
|
||||
t6: Enum
|
||||
t7: Enum
|
||||
s0: Enum
|
||||
s1: Enum
|
||||
s2: Enum
|
||||
s3: Enum
|
||||
s4: Enum
|
||||
s5: Enum
|
||||
s6: Enum
|
||||
s7: Enum
|
||||
t8: Enum
|
||||
t9: Enum
|
||||
k0: Enum
|
||||
k1: Enum
|
||||
gp: Enum
|
||||
sp: Enum
|
||||
fp: Enum
|
||||
ra: Enum
|
@ -11,6 +11,9 @@ from .Enum import *
|
||||
from .InstrCategory import *
|
||||
from .InstrId import *
|
||||
|
||||
from .RegGprO32 import *
|
||||
from .RegGprN32 import *
|
||||
|
||||
from .Config import *
|
||||
|
||||
from .rabbitizer import *
|
||||
|
28
rabbitizer/enums/registers/rabbitizer_enum_GprN32.c
Normal file
28
rabbitizer/enums/registers/rabbitizer_enum_GprN32.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include "enums/enums_utils.h"
|
||||
#include "instructions/RabbitizerRegister.h"
|
||||
|
||||
|
||||
#define RABBITIZER_DEF_REG(prefix, name, numeric) \
|
||||
{ "RegGprN32", #name, RABBITIZER_REG_##prefix##_##name, false, NULL }
|
||||
|
||||
#define RABBITIZER_DEF_REG_NODOLLAR(prefix, name, numeric) \
|
||||
{ "RegGprN32", #name, RABBITIZER_REG_##prefix##_##name, false, NULL }
|
||||
|
||||
RabbitizerEnumMetadata rabbitizer_enum_RegGprN32_enumvalues[] = {
|
||||
#include "instructions/registers/RabbitizerRegister_GprN32.inc"
|
||||
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
#undef RABBITIZER_DEF_REG
|
||||
#undef RABBITIZER_DEF_REG_NODOLLAR
|
||||
|
||||
|
||||
static PyMethodDef rabbitizer_enum_RegGprN32_methods[] = {
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
DEF_ENUM(RegGprN32, "")
|
28
rabbitizer/enums/registers/rabbitizer_enum_GprO32.c
Normal file
28
rabbitizer/enums/registers/rabbitizer_enum_GprO32.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* SPDX-FileCopyrightText: © 2022 Decompollaborate */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include "enums/enums_utils.h"
|
||||
#include "instructions/RabbitizerRegister.h"
|
||||
|
||||
|
||||
#define RABBITIZER_DEF_REG(prefix, name, numeric) \
|
||||
{ "RegGprO32", #name, RABBITIZER_REG_##prefix##_##name, false, NULL }
|
||||
|
||||
#define RABBITIZER_DEF_REG_NODOLLAR(prefix, name, numeric) \
|
||||
{ "RegGprO32", #name, RABBITIZER_REG_##prefix##_##name, false, NULL }
|
||||
|
||||
RabbitizerEnumMetadata rabbitizer_enum_RegGprO32_enumvalues[] = {
|
||||
#include "instructions/registers/RabbitizerRegister_GprO32.inc"
|
||||
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
#undef RABBITIZER_DEF_REG
|
||||
#undef RABBITIZER_DEF_REG_NODOLLAR
|
||||
|
||||
|
||||
static PyMethodDef rabbitizer_enum_RegGprO32_methods[] = {
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
DEF_ENUM(RegGprO32, "")
|
@ -39,6 +39,8 @@ static ModuleAttributes rabbitizer_module_attributes[] = {
|
||||
MODULE_ATTRIBUTE_ENUM(Abi),
|
||||
MODULE_ATTRIBUTE_ENUM(InstrCategory),
|
||||
MODULE_ATTRIBUTE_ENUM(InstrId),
|
||||
MODULE_ATTRIBUTE_ENUM(RegGprO32),
|
||||
MODULE_ATTRIBUTE_ENUM(RegGprN32),
|
||||
MODULE_ATTRIBUTE_TYPE(Instruction),
|
||||
MODULE_ATTRIBUTE_TYPE(RegistersTracker),
|
||||
};
|
||||
|
@ -33,4 +33,7 @@ DECL_ENUM(Abi)
|
||||
DECL_ENUM(InstrCategory)
|
||||
DECL_ENUM(InstrId)
|
||||
|
||||
DECL_ENUM(RegGprO32)
|
||||
DECL_ENUM(RegGprN32)
|
||||
|
||||
#endif
|
||||
|
1
setup.py
1
setup.py
@ -10,6 +10,7 @@ setup(
|
||||
name="rabbitizer",
|
||||
sources=["rabbitizer/rabbitizer_module.c", "rabbitizer/rabbitizer_submodule_Utils.c", "rabbitizer/rabbitizer_type_Instruction.c", "rabbitizer/rabbitizer_global_config.c", "rabbitizer/rabbitizer_type_RegistersTracker.c",
|
||||
"rabbitizer/enums/rabbitizer_type_Enum.c", "rabbitizer/enums/enums_utils.c", "rabbitizer/enums/rabbitizer_enum_InstrCategory.c", "rabbitizer/enums/rabbitizer_enum_InstrId.c", "rabbitizer/enums/rabbitizer_enum_Abi.c",
|
||||
"rabbitizer/enums/registers/rabbitizer_enum_GprO32.c", "rabbitizer/enums/registers/rabbitizer_enum_GprN32.c",
|
||||
"src/instructions/RabbitizerInstruction/RabbitizerInstruction_Disassemble.c", "src/instructions/RabbitizerInstruction/RabbitizerInstruction_ProcessUniqueId.c", "src/instructions/RabbitizerInstruction/RabbitizerInstruction.c", "src/instructions/RabbitizerInstruction/RabbitizerInstruction_Examination.c",
|
||||
"src/instructions/RabbitizerInstructionRsp/RabbitizerInstructionRsp.c", "src/instructions/RabbitizerInstructionRsp/RabbitizerInstructionRsp_ProcessUniqueId.c",
|
||||
"src/instructions/RabbitizerInstrDescriptor.c", "src/instructions/RabbitizerInstrId.c", "src/instructions/RabbitizerRegister.c",
|
||||
|
Loading…
x
Reference in New Issue
Block a user