MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_maps_for_binary_range

Function test_maps_for_binary_range

tests/unit/test_maps.py:718–771  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

716
717
718def test_maps_for_binary_range():
719 # GIVEN
720
721 maps = [
722 VirtualMap(
723 start=1,
724 end=2,
725 filesize=1,
726 offset=0,
727 device="00:00",
728 flags="r-xp",
729 inode=0,
730 path=Path("the_executable"),
731 ),
732 VirtualMap(
733 start=2,
734 end=3,
735 filesize=1,
736 offset=0,
737 device="08:12",
738 flags="r--p",
739 inode=8398159,
740 path=None,
741 ),
742 VirtualMap(
743 start=5,
744 end=6,
745 filesize=1,
746 offset=0,
747 device="00:00",
748 flags="r--p",
749 inode=0,
750 path=Path("/some/path/to/libpython.so"),
751 ),
752 VirtualMap(
753 start=8,
754 end=9,
755 filesize=1,
756 offset=0,
757 device="00:00",
758 flags="--xp",
759 inode=0,
760 path=None,
761 ),
762 ]
763
764 # WHEN
765
766 mapinfo = parse_maps_file_for_binary(Path("the_executable"), maps)
767
768 # THEN
769
770 assert mapinfo.memory.min_addr == 1
771 assert mapinfo.memory.max_addr == 9
772
773
774def test_maps_for_binary_range_vmaps_are_ignored():

Callers

nothing calls this directly

Calls 2

VirtualMapClass · 0.90

Tested by

no test coverage detected