1
我的程序正在经历一个无限循环,我试图找出原因。 (这不是我问的)。我通常会去GDB找出哪里出了问题,但从字面上看,在我的程序开始的时候,它一直在崩溃。GDB不断崩溃
__strcmp_ia32()在../sysdeps/i386/i686/multiarch/../strcmp.S:34
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Prototypes and linked lists here
int debugMode(int argc, char** argv)
{
if(strcmp(argv[argc-1], "-d") == 0) // GDB stops right here.
return 1;
else
return 0;
}
int main(int argc, char** argv)
{
int debug, integer;
char choice;
node *head = NULL;
node *current;
debug = debugMode(argc, argv);
// stuff here
}
记住我有一个函数原型。谢谢你的帮助。
编辑:btw我没有发送任何参数。我正在使用重定向来找出导致我的程序无限循环的原因。
我没有发送参数...抱歉,不清楚。我编辑了我的帖子。无论如何,我认为我的gdb有些问题..我评论说部分出来,现在它随机与另一部分崩溃。它不应该崩溃:\。 – juice 2013-03-18 09:40:56
你编译过哪个-g标志吗? – 2013-03-18 09:44:18
是的,我做的是那么糟糕? – juice 2013-03-18 09:44:38