views:

165

answers:

0

Hi,

I have a pretty obscure problem here. I'm writing a photoshop plugin (for mac) using Xcode.

I use printf statements for simple debugging. A printf without a format string works fine, however, if I use a format string to try and print out a value it does not show up in xcode's debugger console.

#include <stdio.h>    
DLLExport MACPASCAL void PluginMain(const int16 selector, 
                        FilterRecordPtr filterRecord,
                        intptr_t * data,
                        int16 * result) {
        printf("hello world\n"); //shows up in console
        printf("hi number %i\n", 5);//does not show up in console
            ....
    }

I am debugging by having Xcode launch photoshop, then I run my plugin from photoshop's menu. If I do straight 'gdb Photoshop' from a terminal, the format string printf's work just fine. Also, I wrote a simple stand alone hello world program in Xcode and format strings also work just fine there. So obviously it has something to do with being part of a plugin but it's very odd that normal printf's work but format string printf's don't.

Any clues?