From edf4737c910d0c488a43ba69a4abfb77ef74d43b Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Thu, 6 Apr 2017 02:24:36 +0200 Subject: [PATCH] Better exception when connecting an event (#201) --- pwndbg/events.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pwndbg/events.py b/pwndbg/events.py index 14878e6ef..5d06a2719 100644 --- a/pwndbg/events.py +++ b/pwndbg/events.py @@ -16,9 +16,11 @@ import traceback import gdb +import pwndbg.color import pwndbg.config import pwndbg.stdio + debug = pwndbg.config.Parameter('debug-events', False, 'display internal event debugging info') pause = 0 @@ -119,6 +121,9 @@ def connect(func, event_handler, name=''): try: func() except Exception as e: + msg = "Exception during func={}.{} {!r}".format(func.__module__, func.__name__, a) + msg = pwndbg.color.red(msg) + print(msg, file=sys.stderr) traceback.print_exc() raise e