This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

printfs output in wrong order in MI


Hi,
I'm seing strange behaviour of the "printf" command if used in MI:

    (gdb)
    print &i
    &"print &i\n"
    ~"$1 = (int *) 0xbfc5f484\n"
    ^done
    (gdb)
    printf "%x", &i
    &"printf \"%x\", &i\n"
    ^done
    (gdb)
    ~"bfc5f484"
    -interpreter-exec console "printf \"%x\", &i"
    ^done
    (gdb)
    ~"bfc5f484"

The output of 'print' appears before "^done", but the output of "printf"
appears *after* both "^done", and the prompt, which makes it impossible to
reliably catch the output. 

I'm trying to use 'printf' in order to obtain addresses of all local
variables in one command, without round-trips for every local variable.
This behaviour of 'printfs' seems to prevent my trick from working.

Any ideas why "printf" is so special?

- Volodya






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]