Michael Ihde - 2012-01-09

On the PyDev FAQ there is an approach for debugging OmniORB-Py programs.  One downside is that it requires modification to the program that is being debugged.  As an alternative, I tried this and it seemed to work

class PyDB:
        ...
        def omniorb_trace(self, flag=0, wt=None):
            if flag == 0:
                pydevd_tracing.SetTrace(self.trace_dispatch)
        def run(self, file, globals=None, locals=None):
            ...
            try:
                threading.settrace(self.trace_dispatch)
            except:
                pass
            # Hack for omniORB
            try:
                from omniORB import addWThreadHook
            except ImportError:
                pass
            else:
                addWThreadHook(self.dbg_trace)
            ...

The benefit of this approach is that only pydevd.py needs to be modified.  In my testing this seems to work correctly, but I have a few questions:

1. Is there anything that might catch me that I'm not aware of currently?
2. Is there any possibility that this would be incorporated into pydevd.py so that users wouldn't have to make the modifications themselves?

Thanks,
~Michael