qiling
qiling copied to clipboard
Pwndbg context won't work with gdb remote debugging
Describe the bug
Maybe this bug is pwndbg related and not qiling fault, but still worth to ask, when i use the remote gdb debugging with qiling and I connect with pwmdbg, the debugger works but the context is fucked up like in the screenshot:

Sample Code
from qiling import *
from qiling.arch.arch import QL_ARCH
if __name__ == "__main__":
ql = Qiling(["rootfs/hello.arm"], "rootfs")
ql.debugger = "gdb:127.0.0.1:9999"
ql.run()
Expected behavior Pwndbg should just work fine
Additional context The infinite loop seems to happen when pwndbg looks for binary memory mappings
There is a fix here https://github.com/qilingframework/qiling/pull/1148#issuecomment-1120480972
Looks like it’s left out with that PR? Would have a look tomorrow.
Tried that fix and seems to work but still can't show context now i have this error:

maybe this is something you already solved
This issue is related to pwndbg.regs.cpsr not being set and thus being None, if you tell me what I should look i can try to fix it
I'm on fixing this however it somehow involves a deeper refactor so the fix might be a bit late.
This issue is related to pwndbg.regs.cpsr not being set and thus being None, if you tell me what I should look i can try to fix it
I can't reproduce this.
Close for now.
We updated the codebase for Qiling and Unicorn since this issue being posted.
Feel free to try the latest version.