From f792f00081046826490c6b658e833e5baea1b935 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Thu, 13 Oct 2022 13:57:56 -0700 Subject: [PATCH] Move example strings to comments --- pwndbg/vmmap.py | 65 +++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/pwndbg/vmmap.py b/pwndbg/vmmap.py index 0c5c3eb0f..5363226a8 100644 --- a/pwndbg/vmmap.py +++ b/pwndbg/vmmap.py @@ -469,23 +469,22 @@ def info_sharedlibrary(): A list of pwndbg.lib.memory.Page objects. """ - exmaple_info_sharedlibrary_freebsd = """ - From To Syms Read Shared Object Library - 0x280fbea0 0x2810e570 Yes (*) /libexec/ld-elf.so.1 - 0x281260a0 0x281495c0 Yes (*) /lib/libncurses.so.8 - 0x28158390 0x2815dcf0 Yes (*) /usr/local/lib/libintl.so.9 - 0x28188b00 0x2828e060 Yes (*) /lib/libc.so.7 - (*): Shared library is missing debugging information. - """ + # Example of `info sharedlibrary` on FreeBSD + # From To Syms Read Shared Object Library + # 0x280fbea0 0x2810e570 Yes (*) /libexec/ld-elf.so.1 + # 0x281260a0 0x281495c0 Yes (*) /lib/libncurses.so.8 + # 0x28158390 0x2815dcf0 Yes (*) /usr/local/lib/libintl.so.9 + # 0x28188b00 0x2828e060 Yes (*) /lib/libc.so.7 + # (*): Shared library is missing debugging information. + + # Example of `info sharedlibrary` on Linux + # From To Syms Read Shared Object Library + # 0x00007ffff7ddaae0 0x00007ffff7df54e0 Yes /lib64/ld-linux-x86-64.so.2 + # 0x00007ffff7bbd3d0 0x00007ffff7bc9028 Yes (*) /lib/x86_64-linux-gnu/libtinfo.so.5 + # 0x00007ffff79aded0 0x00007ffff79ae9ce Yes /lib/x86_64-linux-gnu/libdl.so.2 + # 0x00007ffff76064a0 0x00007ffff774c113 Yes /lib/x86_64-linux-gnu/libc.so.6 + # (*): Shared library is missing debugging information. - exmaple_info_sharedlibrary_linux = """ - From To Syms Read Shared Object Library - 0x00007ffff7ddaae0 0x00007ffff7df54e0 Yes /lib64/ld-linux-x86-64.so.2 - 0x00007ffff7bbd3d0 0x00007ffff7bc9028 Yes (*) /lib/x86_64-linux-gnu/libtinfo.so.5 - 0x00007ffff79aded0 0x00007ffff79ae9ce Yes /lib/x86_64-linux-gnu/libdl.so.2 - 0x00007ffff76064a0 0x00007ffff774c113 Yes /lib/x86_64-linux-gnu/libc.so.6 - (*): Shared library is missing debugging information. - """ pages = [] for line in gdb.execute("info sharedlibrary", to_string=True).splitlines(): @@ -503,24 +502,22 @@ def info_sharedlibrary(): @pwndbg.lib.memoize.reset_on_stop def info_files(): - - example_info_files_linues = """ - Symbols from "/bin/bash". - Unix child process: - Using the running image of child process 5903. - While running this, GDB does not access memory from... - Local exec file: - `/bin/bash', file type elf64-x86-64. - Entry point: 0x42020b - 0x0000000000400238 - 0x0000000000400254 is .interp - 0x0000000000400254 - 0x0000000000400274 is .note.ABI-tag - ... - 0x00000000006f06c0 - 0x00000000006f8ca8 is .data - 0x00000000006f8cc0 - 0x00000000006fe898 is .bss - 0x00007ffff7dda1c8 - 0x00007ffff7dda1ec is .note.gnu.build-id in /lib64/ld-linux-x86-64.so.2 - 0x00007ffff7dda1f0 - 0x00007ffff7dda2ac is .hash in /lib64/ld-linux-x86-64.so.2 - 0x00007ffff7dda2b0 - 0x00007ffff7dda38c is .gnu.hash in /lib64/ld-linux-x86-64.so.2 - """ + # Example of `info files` output: + # Symbols from "/bin/bash". + # Unix child process: + # Using the running image of child process 5903. + # While running this, GDB does not access memory from... + # Local exec file: + # `/bin/bash', file type elf64-x86-64. + # Entry point: 0x42020b + # 0x0000000000400238 - 0x0000000000400254 is .interp + # 0x0000000000400254 - 0x0000000000400274 is .note.ABI-tag + # ... + # 0x00000000006f06c0 - 0x00000000006f8ca8 is .data + # 0x00000000006f8cc0 - 0x00000000006fe898 is .bss + # 0x00007ffff7dda1c8 - 0x00007ffff7dda1ec is .note.gnu.build-id in /lib64/ld-linux-x86-64.so.2 + # 0x00007ffff7dda1f0 - 0x00007ffff7dda2ac is .hash in /lib64/ld-linux-x86-64.so.2 + # 0x00007ffff7dda2b0 - 0x00007ffff7dda38c is .gnu.hash in /lib64/ld-linux-x86-64.so.2 seen_files = set() pages = list()