pwndbg.gdb.regs type fixes (#1508)

pull/1509/head
Gulshan Singh 3 years ago committed by GitHub
parent 10228899e6
commit 3a45e3c669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,10 +1,13 @@
# The `arch` module can be accessed with `from pwndbg.gdblib.arch import arch_mod`,
# while `pwndbg.gdblib.arch` will represent the `Arch` object
from pwndbg.gdblib import arch as arch_mod
from pwndbg.gdblib import config as config_mod
from pwndbg.gdblib.arch import arch
from pwndbg.gdblib.config import config
regs = None
__all__ = ["ctypes", "memory", "typeinfo"]
@ -25,7 +28,12 @@ def load_gdblib() -> None:
import pwndbg.gdblib.kernel
import pwndbg.gdblib.memory
import pwndbg.gdblib.prompt
import pwndbg.gdblib.regs
import pwndbg.gdblib.regs as regs_mod
import pwndbg.gdblib.symbol
import pwndbg.gdblib.typeinfo
import pwndbg.gdblib.vmmap
# This is necessary so that mypy understands the actual type of the regs module
regs_: regs_mod.module = regs_mod
global regs
regs = regs_

@ -230,7 +230,7 @@ sys.modules[__name__] = module(__name__, "")
@pwndbg.gdblib.events.cont
@pwndbg.gdblib.events.stop
def update_last() -> None:
M = sys.modules[__name__]
M: module = sys.modules[__name__]
M.previous = M.last
M.last = {k: M[k] for k in M.common}
if pwndbg.gdblib.config.show_retaddr_reg:

@ -20,8 +20,6 @@ disable_error_code = [
"misc",
# Lots of dynamic attribute access
"attr-defined",
# Issues with indexing Module
"index",
# https://github.com/python/mypy/issues/6232
"assignment",
# Issues with @property

Loading…
Cancel
Save