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

Function test_maps_for_binary_no_executable_segment

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

Source from the content-addressed store, hash-verified

862
863
864def test_maps_for_binary_no_executable_segment():
865 # GIVEN
866
867 python = VirtualMap(
868 start=140728765599744,
869 end=140728765603840,
870 filesize=4096,
871 offset=0,
872 device="00:00",
873 flags="r--p",
874 inode=0,
875 path=Path("the_executable"),
876 )
877
878 maps = [
879 python,
880 VirtualMap(
881 start=18446744073699065856,
882 end=18446744073699069952,
883 filesize=4096,
884 offset=0,
885 device="00:00",
886 flags="--xp",
887 inode=0,
888 path=Path("/usr/lib/libc-2.31.so"),
889 ),
890 ]
891
892 # WHEN
893
894 mapinfo = parse_maps_file_for_binary(Path("the_executable"), maps)
895
896 # THEN
897
898 assert mapinfo.python == python
899 assert mapinfo.libpython is None
900 assert mapinfo.bss is None
901 assert mapinfo.heap is None
902
903
904def test_maps_for_binary_multiple_libpythons():

Callers

nothing calls this directly

Calls 2

VirtualMapClass · 0.90

Tested by

no test coverage detected