5

I want to set a break point, and only stop at it, when one pointer called rc is NULL.

I did like that

      b task.c:190 if rc==NULL

but gdb says, NULL would be unrecognized, so I changed to

      b task.c:190 if(!rc)

which seems worked.

But I am not very sure, correct me if I am doing wrong.

4

2 回答 2

8

try to re-compile your project with CFLAG -ggdb3, then set the break point.Or use (void *)0 instead of NULL

于 2014-05-20T07:22:16.310 回答
1

NULL is a C macro whose value is set to 0 Probably the gdb is not able to resolve the macro value.

于 2014-05-20T07:18:19.120 回答