New submission from John Ehresman <j...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue5654>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to