unbit/uwsgi — pull request #673 by rmesser (2014-07-25 18:18:56+00:00)
Title: wrap newXS lines with CvNODEBUG_on to allow perl debugging

It is possible to user the perl debugger with a running uwsgi instance by attaching to it with gdb, then using the CPAN module Enbugger. (See Enbugger CPAN docs for details: http://search.cpan.org/~jjore/Enbugger-2.016/lib/Enbugger.pod#From_gdb.)

However, when data is POSTed, for some reason the $env->{'psgi.input'} value is mashed into a 1 when the debugger is active. It appears that for some reason the call to newXS("uwsgi::input::new") fails, or at least the return value is converted to a simple scalar. Wrapping the method call in CvNODEBUG_on works around this issue. This has no negative side effects, and basically (as I understand it) just tells the compiler to set a flag to prevent debugging into the method call. It would be pointless to try to debug into that call anyway, which is why I say there are no negative side effects of this change.

To prevent this happening elsewhere this pull requests wraps all of the "newXS" calls with CvNODEBUG_on.