context in attached process gives TypeError: argument of type 'NoneType' is not iterable
See original GitHub issueDescription
When running context
in an attached process I get the following error:
Traceback (most recent call last):
File "/usr/share/pwndbg/pwndbg/commands/__init__.py", line 130, in __call__
return self.function(*args, **kwargs)
File "/usr/share/pwndbg/pwndbg/commands/__init__.py", line 221, in _OnlyWhenRunning
return function(*a, **kw)
File "/usr/share/pwndbg/pwndbg/commands/context.py", line 334, in context
result[target].extend(func(target=out,
File "/usr/share/pwndbg/pwndbg/commands/context.py", line 408, in context_regs
regs = get_regs()
File "/usr/share/pwndbg/pwndbg/commands/context.py", line 457, in get_regs
m = ' ' * len(change_marker) if reg not in changed else C.register_changed(change_marker)
TypeError: argument of type 'NoneType' is not iterable
Steps to reproduce
Create a process and attach to it:
$ sleep 10000 &
[2] 282936
$ gdb -p 282936
Then the error from above will occur.
Possible fix
to
changed = pwndbg.regs.changed or []
seems to fix the problem for me.
My setup
Platform: Linux-5.9.13-arch1-1-x86_64-with-glibc2.32 Gdb: 10.1 Python: 3.9.0 (default, Oct 7 2020, 23:09:01) [GCC 10.2.0] Pwndbg: 1.1.0 Capstone: 4.0.1024 Unicorn: 1.0.1 This GDB was configured as follows: configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu –with-auto-load-dir=$debugdir:$datadir/auto-load –with-auto-load-safe-path=$debugdir:$datadir/auto-load –with-expat –with-gdb-datadir=/usr/share/gdb (relocatable) –with-jit-reader-dir=/usr/lib/gdb (relocatable) –without-libunwind-ia64 –with-lzma –without-babeltrace –without-intel-pt –with-mpfr –without-xxhash –with-python=/usr (relocatable) –with-python-libdir=/usr/lib (relocatable) –with-debuginfod –with-guile –enable-source-highlight –with-separate-debug-dir=/usr/lib/debug (relocatable) –with-system-gdbinit=/etc/gdb/gdbinit
(“Relocatable” means the directory can be moved with the GDB installation tree, and GDB will still find it.)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
@disconnect3d
Yes. Even with fix applied
I have similar error
'NoneType' is not iterable
but I do not remember the placeI can’t reproduce the described bug with the fix above; please let me know if it still triggers for you.