From f63f7f308a1bd0a8491daf13df56fafe3f2b3708 Mon Sep 17 00:00:00 2001 From: hakril Date: Sun, 29 Mar 2020 21:41:48 +0200 Subject: [PATCH] Some quick and dirty fix for debugger/breakpoint in python3 --- windows/debug/breakpoints.py | 16 +++++++++++----- windows/debug/debugger.py | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/windows/debug/breakpoints.py b/windows/debug/breakpoints.py index de78bd5..7b144aa 100644 --- a/windows/debug/breakpoints.py +++ b/windows/debug/breakpoints.py @@ -108,11 +108,17 @@ class FunctionParamDumpBPAbstract(object): t = rt(value, cproc) else: t = rt(value) - if not hasattr(t, "contents"): - try: - t = t.value - except AttributeError: - pass + # Will fail in py3.. + content = None + try: + content = t.contents + except Exception as e: + # contents will fail on basic type + # Not really an expected behavior + # But it works for now.. (and since a while) + pass + if content is None: + t = t.value res[name[1]] = t return res diff --git a/windows/debug/debugger.py b/windows/debug/debugger.py index 593fc1b..9df225a 100644 --- a/windows/debug/debugger.py +++ b/windows/debug/debugger.py @@ -924,7 +924,7 @@ class Debugger(object): self.add_pending_breakpoint(bp, None) elif target is not None: # Check that targets are accepted - if target not in self.processes.values() + self.threads.values(): + if target not in list(self.processes.values()) + list(self.threads.values()): # if target == self.target: # Original target (that have not been lauched yet) return self.add_pending_breakpoint(bp, target) # else: