Cleanup before unit-tests (#1293)

This commit is contained in:
Gulshan Singh 2022-10-18 03:21:58 -07:00 committed by GitHub
parent 1c06c52b47
commit 295fe29b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 28 deletions

View File

@ -5,19 +5,26 @@ import gdb
import pwndbg.color
import pwndbg.commands
import pwndbg.gdblib
from pwndbg.commands import load_commands
from pwndbg.gdblib import load_gdblib
pwndbg.commands.load_commands()
pwndbg.gdblib.load_gdblib()
load_commands()
load_gdblib()
# TODO: Convert these to gdblib modules and remove this
try:
import pwndbg.disasm
import pwndbg.disasm.arm
import pwndbg.disasm.jump
import pwndbg.disasm.mips
import pwndbg.disasm.ppc
import pwndbg.disasm.sparc
import pwndbg.disasm.x86
import pwndbg.heap
except ModuleNotFoundError:
pass
import pwndbg.disasm
import pwndbg.disasm.arm
import pwndbg.disasm.jump
import pwndbg.disasm.mips
import pwndbg.disasm.ppc
import pwndbg.disasm.sparc
import pwndbg.disasm.x86
import pwndbg.exception
import pwndbg.heap
import pwndbg.lib.version
import pwndbg.ui
@ -58,7 +65,9 @@ __all__ = [
"vmmap",
]
pwndbg.gdblib.prompt.set_prompt()
from pwndbg.gdblib import prompt
prompt.set_prompt()
pre_commands = """
set confirm off
@ -95,7 +104,9 @@ signal.signal(
)
# Reading Comment file
pwndbg.commands.comments.init()
from pwndbg.commands import comments
comments.init()
from pwndbg.gdblib import config_mod

View File

@ -1,8 +1,8 @@
import pwndbg.gdblib.config
from pwndbg.gdblib import config
def add_param(name, default, docstring):
return pwndbg.gdblib.config.add_param(name, default, docstring, "theme")
return config.add_param(name, default, docstring, "theme")
def add_color_param(name, default, docstring):

View File

@ -6,18 +6,10 @@ from typing import List
import gdb
import pwndbg.chain
import pwndbg.color
import pwndbg.color.message as message
import pwndbg.enhance
import pwndbg.exception
import pwndbg.gdblib.config
import pwndbg.gdblib.memory
import pwndbg.gdblib.regs
import pwndbg.gdblib.symbol
import pwndbg.heap
import pwndbg.hexdump
import pwndbg.ui
from pwndbg.heap.ptmalloc import SymbolUnresolvableError
commands = [] # type: List[Command]

View File

@ -5,9 +5,9 @@ import traceback
import gdb
import pwndbg.color.message as message
import pwndbg.gdblib.config
import pwndbg.lib.memoize
import pwndbg.lib.stdio
from pwndbg.gdblib import config
with pwndbg.lib.stdio.stdio:
try:
@ -15,12 +15,12 @@ with pwndbg.lib.stdio.stdio:
except ImportError:
import pdb
verbose = pwndbg.gdblib.config.add_param(
verbose = config.add_param(
"exception-verbose",
False,
"whether to print a full stacktrace for exceptions raised in Pwndbg commands",
)
debug = pwndbg.gdblib.config.add_param(
debug = config.add_param(
"exception-debugger", False, "whether to debug exceptions raised in Pwndbg commands"
)
@ -95,7 +95,7 @@ def set_trace():
pdb.set_trace = set_trace
@pwndbg.gdblib.config.trigger(verbose, debug)
@config.trigger(verbose, debug)
def update():
if verbose or debug:
command = "set python print-stack full"

View File

@ -1,10 +1,10 @@
import gdb
import pwndbg.gdblib.abi
import pwndbg.gdblib.arch
import pwndbg.gdblib.events
import pwndbg.gdblib.memory
import pwndbg.gdblib.regs
import pwndbg.lib.abi
#: Total number of arguments
argc = None

View File

@ -25,7 +25,7 @@ theme.add_param(
title_position = theme.add_param("banner-title-position", "center", "banner title position")
@pwndbg.gdblib.config.trigger(title_position)
@config.trigger(title_position)
def check_title_position():
valid_values = ["center", "left", "right"]
if title_position not in valid_values: