xcode - Where does C++ stderr output go in OSX? -
i'm working objective-c++ code launches background process main app. background process has no gui, runs moment, , must run main app useful. means can't attach background process xcode or run stand-alone, need rely on output stderr.
in scenario, should looking find stderr output?
more information in case i'm asking wrong question: using old version of xcode (3.2.6) reasons related age of project i'm maintaining. i'm working on exception handling/reporting code, makes difficult step through code since gdb likes catch exceptions rather letting code it. background process launched when structured exception occurs within main app.
excerpt of results of lsof command on main app, might relevant:
command pid user fd type device size/off node name <appname> 2788 <username> 0r chr 3,2 0t0 311 /dev/null <appname> 2788 <username> 1w chr 3,2 0t473379 311 /dev/null <appname> 2788 <username> 2w chr 3,2 0x6d545f8 311 /dev/null
you can use lsof
command figure out particular file descriptor has been redirected:
lsof -a -p <your pid> -d 0,1,2
when background process launched child proccess attached same standard streams parent process. normal cocoa applications default should able see output in console.app under 'all messages' or 'console messages'.
before mountain lion view output of launchd services there, believe since launchd redirects stdout , stderr /dev/null.
this means can't attach background process xcode or run stand-alone
if can run main application xcode should able set debugger attach child processes launches.
the xcode debugger can told wait particular process launch , attach it.
Comments
Post a Comment