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

Function test_maps_for_binary_with_libpython

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

Source from the content-addressed store, hash-verified

386
387
388def test_maps_for_binary_with_libpython():
389 # GIVEN
390
391 python = VirtualMap(
392 start=140728765599744,
393 end=140728765603840,
394 filesize=4096,
395 offset=0,
396 device="00:00",
397 flags="r-xp",
398 inode=0,
399 path=Path("the_executable"),
400 )
401
402 libpython = VirtualMap(
403 start=140728765587456,
404 end=140728765599744,
405 filesize=4096,
406 offset=0,
407 device="00:00",
408 flags="r--p",
409 inode=0,
410 path=Path("/some/path/to/libpython.so"),
411 )
412
413 maps = [
414 python,
415 VirtualMap(
416 start=18446744073699065856,
417 end=18446744073699069952,
418 filesize=4096,
419 offset=0,
420 device="00:00",
421 flags="--xp",
422 inode=0,
423 path=Path("/usr/lib/libc-2.31.so"),
424 ),
425 libpython,
426 ]
427
428 # WHEN
429
430 mapinfo = parse_maps_file_for_binary(Path("the_executable"), maps)
431
432 # THEN
433
434 assert mapinfo.python == python
435 assert mapinfo.libpython == libpython
436 assert mapinfo.bss is None
437 assert mapinfo.heap is None
438
439
440def test_maps_for_binary_executable_with_bss():

Callers

nothing calls this directly

Calls 2

VirtualMapClass · 0.90

Tested by

no test coverage detected