()
| 334 | |
| 335 | |
| 336 | def test_maps_for_binary_with_heap(): |
| 337 | # GIVEN |
| 338 | |
| 339 | python = VirtualMap( |
| 340 | start=140728765599744, |
| 341 | end=140728765603840, |
| 342 | filesize=4096, |
| 343 | offset=0, |
| 344 | device="00:00", |
| 345 | flags="r-xp", |
| 346 | inode=0, |
| 347 | path=Path("the_executable"), |
| 348 | ) |
| 349 | |
| 350 | heap = VirtualMap( |
| 351 | start=140728765587456, |
| 352 | end=140728765599744, |
| 353 | filesize=12288, |
| 354 | offset=0, |
| 355 | device="00:00", |
| 356 | flags="r--p", |
| 357 | inode=0, |
| 358 | path=Path("[heap]"), |
| 359 | ) |
| 360 | |
| 361 | maps = [ |
| 362 | python, |
| 363 | VirtualMap( |
| 364 | start=18446744073699065856, |
| 365 | end=18446744073699069952, |
| 366 | filesize=4096, |
| 367 | offset=0, |
| 368 | device="00:00", |
| 369 | flags="--xp", |
| 370 | inode=0, |
| 371 | path=Path("/usr/lib/libc-2.31.so"), |
| 372 | ), |
| 373 | heap, |
| 374 | ] |
| 375 | |
| 376 | # WHEN |
| 377 | |
| 378 | mapinfo = parse_maps_file_for_binary(Path("the_executable"), maps) |
| 379 | |
| 380 | # THEN |
| 381 | |
| 382 | assert mapinfo.python == python |
| 383 | assert mapinfo.libpython is None |
| 384 | assert mapinfo.bss is None |
| 385 | assert mapinfo.heap == heap |
| 386 | |
| 387 | |
| 388 | def test_maps_for_binary_with_libpython(): |
nothing calls this directly
no test coverage detected