[New-bugs-announce] [issue5654] Add C hook in PyDict_SetItem for debuggers

John Ehresman report at bugs.python.org
Wed Apr 1 18:55:05 CEST 2009


New submission from John Ehresman <jpe at wingware.com>:

I'm interested in adding support for debugger watchpoint's in the core.
 A watchpoint would cause the debugger to stop when a value in a
namespace changes.  This hook would be called when PyDict_SetItem &
PyDict_DelItem is invoked.  I realize that this does not cover function
local variables, but I'm more interested in instance attributes and globals.

This is a proof of concept patch; I wanted to see if it would work and
get some initial feedback.  I think the performance implications are
minimal in the case where nothing is watched, though the performance of
sample callback in _debuggerhooks can be improved.  An issue may be if
this is used outside a debugger implementation to implement an observer
pattern -- I'd like to discourage it, but worry that it will be used
since it's there, rather like how the settrace tracer gets used.

If there's interest in this, I will clean this up and add watchpoints to
pdb.

----------
components: Interpreter Core
files: dicthook.diff
keywords: patch
messages: 85051
nosy: jpe
severity: normal
status: open
title: Add C hook in PyDict_SetItem for debuggers
versions: Python 2.7
Added file: http://bugs.python.org/file13549/dicthook.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5654>
_______________________________________


More information about the New-bugs-announce mailing list