File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 16
16
"""
17
17
18
18
from __future__ import annotations
19
+
20
+ import logging
19
21
from enum import IntEnum , IntFlag , auto
20
22
from typing import TypeAlias , TYPE_CHECKING
21
23
import enum_tools .documentation
22
24
25
+ from qbindiff .utils import log_once
26
+
23
27
if TYPE_CHECKING :
24
28
from qbindiff .loader .data import Data
25
29
from qbindiff .loader .structure import Structure , StructureMember
@@ -143,10 +147,11 @@ def from_capstone(cls, capstone_group: int):
143
147
try :
144
148
return InstructionGroup (capstone_group )
145
149
except ValueError :
146
- # Raise an exception if cast is not possible
147
- raise ValueError (
148
- f"Misalignment between capstone group { capstone_group } and InstructionGroup"
150
+ # Log once the unsupported
151
+ log_once ( logging . WARN ,
152
+ f"Misalignment between capstone group { capstone_group } and InstructionGroup"
149
153
)
154
+ return InstructionGroup .GRP_INVALID
150
155
151
156
152
157
@enum_tools .documentation .document_enum
You can’t perform that action at this time.
0 commit comments