1

I have a debugging macro defined in .gdbinit says:

define printinfo
  pinfo(stdout, $arg0)
end

however when I run gdb and use printinfo somedata, the gdb throws me:

No symbol "stdout" in current context.

As I know stdout is a standard file descriptor in c. But it failed to find it here.

Need your help!

4

1 に答える 1

1

No symbol "stdout" in current context

You are likely using a libc version which uses #define stdout to something else. Preprocess a file containing this:

 #include <stdio.h>
 ----before----
 stdout
 ----after----

then look at what stdout expanded to. Chances are it's not stdout anymore after preprocessing.

于 2013-01-09T03:14:00.383 に答える