mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-22 01:03:07 +00:00
tests: make tests.elf.SHF an IntFlag
Upcoming tests will need to combine flags.
Fixes: 104a14781d
("tests: test compressed debug sections")
Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
parent
64de9ef829
commit
882d73a523
@ -58,7 +58,8 @@ from typing import Text
|
||||
)
|
||||
for type_name, constants in enums.items():
|
||||
assert constants
|
||||
f.write(f"\n\nclass {type_name}(enum.IntEnum):\n")
|
||||
enum_class = "IntFlag" if type_name == "SHF" else "IntEnum"
|
||||
f.write(f"\n\nclass {type_name}(enum.{enum_class}):\n")
|
||||
for name, value in constants:
|
||||
f.write(f" {name} = 0x{value:X}\n")
|
||||
f.write(
|
||||
|
@ -63,7 +63,7 @@ class PT(enum.IntEnum):
|
||||
return hex(value)
|
||||
|
||||
|
||||
class SHF(enum.IntEnum):
|
||||
class SHF(enum.IntFlag):
|
||||
WRITE = 0x1
|
||||
ALLOC = 0x2
|
||||
EXECINSTR = 0x4
|
||||
|
Loading…
Reference in New Issue
Block a user