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

Function test_maps_for_binary_only_python_exec

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

Source from the content-addressed store, hash-verified

294
295
296def test_maps_for_binary_only_python_exec():
297 # GIVEN
298
299 python = VirtualMap(
300 start=140728765599744,
301 end=140728765603840,
302 filesize=4096,
303 offset=0,
304 device="00:00",
305 flags="r-xp",
306 inode=0,
307 path=Path("the_executable"),
308 )
309
310 maps = [
311 python,
312 VirtualMap(
313 start=18446744073699065856,
314 end=18446744073699069952,
315 filesize=4096,
316 offset=0,
317 device="00:00",
318 flags="--xp",
319 inode=0,
320 path=Path("/usr/lib/libc-2.31.so"),
321 ),
322 ]
323
324 # WHEN
325
326 mapinfo = parse_maps_file_for_binary(Path("the_executable"), maps)
327
328 # THEN
329
330 assert mapinfo.python == python
331 assert mapinfo.libpython is None
332 assert mapinfo.bss is None
333 assert mapinfo.heap is None
334
335
336def test_maps_for_binary_with_heap():

Callers

nothing calls this directly

Calls 2

VirtualMapClass · 0.90

Tested by

no test coverage detected