GDB不会在断点处停止

时间:2012-05-05 20:42:57

标签: c

我用

编译了两个
gcc -Wall -gdwarf-2 -g3 -g ws.c socklib.c web-time.c varlib.c -o ws

gcc -Wall -gdwarf-2 -g3 ws.c socklib.c web-time.c varlib.c -o ws

并且程序不会在我设置的断点处停止。

./ws

gdb>b splitline
gdb>b 1019
gdb>b 1020

断点已成功安装。第1019行是while语句。下面的打印消息确实执行。

char ** splitline(char *line, int*has_query)

{
//char *newstr();
logg("In splitline\n");
char **args;
int spots = 0; /* spots in table    */
int bufspace = 0; /* bytes in table */
int argnum = 0; /* slots used       */
char *cp = line; /* pos in string   */
char *start;
int len;

if (line == NULL) /* handle special case    */
    return NULL;

args = emalloc(BUFSIZ); /* initialize array */
bufspace = BUFSIZ;
spots = BUFSIZ / sizeof(char *);

int query_reached = 0; //Flag to specify that the first '?' was reached
while (*cp != '\0') {
    logg("*cp=");
    fprintf(stderr,"%c",*cp);

...

0 个答案:

没有答案