Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当涉及格式字符串时,printf不打印到Xcode调试器(在插件环境中)_Xcode_String_Debugging_Format_Printf - Fatal编程技术网

当涉及格式字符串时,printf不打印到Xcode调试器(在插件环境中)

当涉及格式字符串时,printf不打印到Xcode调试器(在插件环境中),xcode,string,debugging,format,printf,Xcode,String,Debugging,Format,Printf,我这里有一个相当模糊的问题。我正在使用Xcode编写一个photoshop插件(用于mac) 我使用printf语句进行简单的调试。没有格式字符串的printf可以正常工作,但是,如果我使用格式字符串尝试打印出一个值,它不会显示在xcode的调试器控制台中 #include <stdio.h> DLLExport MACPASCAL void PluginMain(const int16 selector, FilterRec

我这里有一个相当模糊的问题。我正在使用Xcode编写一个photoshop插件(用于mac)

我使用printf语句进行简单的调试。没有格式字符串的printf可以正常工作,但是,如果我使用格式字符串尝试打印出一个值,它不会显示在xcode的调试器控制台中

#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
            ....
    }
#包括
DLLExport MACPASCAL void PluginMain(常数int16选择器,
FilterRecordPtr filterRecord,
intptr_t*数据,
int16*结果){
printf(“hello world\n”);//显示在控制台中
printf(“高编号%i\n”,5);//未显示在控制台中
....
}
我通过让Xcode启动photoshop进行调试,然后从photoshop的菜单运行插件。如果我直接从终端执行“gdb Photoshop”,格式字符串printf的工作就很好。此外,我还用Xcode编写了一个简单的独立hello world程序,格式字符串也可以很好地工作。所以很明显,它与插件的一部分有关,但很奇怪,普通printf的工作,而格式字符串printf的工作,却没有


有什么线索吗?

如果启用了LLDB进行调试,请尝试从LLDB切换到GDB。如果启用了LLDB进行调试,请尝试从LLDB切换到GDB。