[wingide-users] Breakpoints with actions and auto-continue

Luc Bourhis luc_j_bourhis at mac.com
Tue Feb 9 08:47:16 MST 2010

On 8 Feb 2010, at 23:26, Wing IDE Support wrote:

> Did you try using conditional BPs for this, as in:
> [...]
> def debuglogvalue(a):
>  print a
>  return False
> and set the condition to "debuglogvalue(self.someAttribute)"
> should also work.

A better solution, in my humble opinion, would then to put

def log(stop=False, **kwds):
  for k,v in kwds.iteritems():
    print "%s = %s" % (k,v)
  return stop

in some readily accessible module and then to write the breakpoint condition as

	some_condition and log(some_variable=some_variable, ....)

if one wants a watchpoint (i.e. the debugger will log but not stop) or 

	some_condition and log(stop=True, some_variable=some_variable, ...)

if one wants the debugger to log and to stop.

This is actually very acceptable a solution since that function 'log' can be written once and for all and there is no harm leaving an import of the module featuring it.

Thanks for pointing me into the right direction!!

That said, it does also mean it would not be very difficult for you to implement this feature into Wing!

Luc Bourhis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3681 bytes
Desc: not available
Url : /pipermail/wingide-users/attachments/20100209/34d51ad7/smime.bin

More information about the wingide-users mailing list