From c3c8975b7a53d20dda9632e8b0615aa9e6679ee4 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Sat, 8 Oct 2022 06:43:59 -0700 Subject: [PATCH] GDB Refactor [19/N]: Move gdbutils/functions.py to gdblib (#1253) --- pwndbg/__init__.py | 1 - pwndbg/commands/ida.py | 2 +- pwndbg/gdblib/__init__.py | 1 + pwndbg/{gdbutils => gdblib}/functions.py | 0 pwndbg/gdblib/prompt.py | 6 ++---- pwndbg/gdbutils/__init__.py | 3 --- 6 files changed, 4 insertions(+), 9 deletions(-) rename pwndbg/{gdbutils => gdblib}/functions.py (100%) delete mode 100644 pwndbg/gdbutils/__init__.py diff --git a/pwndbg/__init__.py b/pwndbg/__init__.py index 7635bac82..fe048e26e 100755 --- a/pwndbg/__init__.py +++ b/pwndbg/__init__.py @@ -18,7 +18,6 @@ import pwndbg.disasm.sparc import pwndbg.disasm.x86 import pwndbg.elf import pwndbg.exception -import pwndbg.gdbutils.functions import pwndbg.heap import pwndbg.lib.version import pwndbg.ui diff --git a/pwndbg/commands/ida.py b/pwndbg/commands/ida.py index 0d8dfd612..3dce831d7 100644 --- a/pwndbg/commands/ida.py +++ b/pwndbg/commands/ida.py @@ -9,7 +9,7 @@ import pwndbg.commands import pwndbg.commands.context import pwndbg.gdblib.regs import pwndbg.ida -from pwndbg.gdbutils.functions import GdbFunction +from pwndbg.gdblib.functions import GdbFunction @pwndbg.commands.ArgparsedCommand("Synchronize IDA's cursor with GDB") diff --git a/pwndbg/gdblib/__init__.py b/pwndbg/gdblib/__init__.py index 03e644d1b..4f26b9363 100644 --- a/pwndbg/gdblib/__init__.py +++ b/pwndbg/gdblib/__init__.py @@ -17,6 +17,7 @@ def load_gdblib(): import pwndbg.gdblib.argv import pwndbg.gdblib.ctypes import pwndbg.gdblib.events + import pwndbg.gdblib.functions import pwndbg.gdblib.hooks import pwndbg.gdblib.memory import pwndbg.gdblib.prompt diff --git a/pwndbg/gdbutils/functions.py b/pwndbg/gdblib/functions.py similarity index 100% rename from pwndbg/gdbutils/functions.py rename to pwndbg/gdblib/functions.py diff --git a/pwndbg/gdblib/prompt.py b/pwndbg/gdblib/prompt.py index dcfd594cc..9fc5c8794 100644 --- a/pwndbg/gdblib/prompt.py +++ b/pwndbg/gdblib/prompt.py @@ -4,15 +4,13 @@ import gdb import pwndbg.decorators import pwndbg.gdblib.events -import pwndbg.gdbutils +import pwndbg.gdblib.functions import pwndbg.lib.memoize from pwndbg.color import disable_colors from pwndbg.color import message from pwndbg.lib.tips import get_tip_of_the_day -funcs_list_str = ", ".join( - message.notice("$" + f.name) for f in pwndbg.gdbutils.functions.functions -) +funcs_list_str = ", ".join(message.notice("$" + f.name) for f in pwndbg.gdblib.functions.functions) num_pwndbg_cmds = sum(1 for _ in filter(lambda c: not c.shell, pwndbg.commands.commands)) num_shell_cmds = sum(1 for _ in filter(lambda c: c.shell, pwndbg.commands.commands)) diff --git a/pwndbg/gdbutils/__init__.py b/pwndbg/gdbutils/__init__.py deleted file mode 100644 index fb88ab794..000000000 --- a/pwndbg/gdbutils/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -""" -Put all new things related to gdb in this module. -"""