I have a function that pretty prints a data structure, its function prototype is:
void print_mode(FILE *fp, Mode *mode);
the FILE* allows you to redirect the output to anywhere you want, e.g. stdout, stderr, a file etc. Mode is the data structure
I am trying to call this function from within gdb and want the output to be directed to the gdb console window, stdout?
I have tried:
(gdb) p print_mode(STDOUT,fragment_mode)
No symbol "STDOUT" in current context.
(gdb) p print_mode(stdout,fragment_mode)
$17 = void
neither of which work
any ideas how i can get the output of the function to display in the gdb console?
should add - I am using gdb within emacs 24.2.1 under linux
info terminal,run > redirect-fileandtty device-name. There will be device names that are the equivalent of stdin, stdout, ala /dev/ttycall print_mode(stdout,fragment_mode)instead ofp print_mode(stdout,fragment_mode)?STDOUTbe a macro? Find out to what it expands.printandcallshouldn't make any difference.call fprintf(stdout, "test %d\n", 5)within gdb produce output?