mi, new-ui and the target

Bob Rossi bob@brasko.net
Sat May 4 19:55:12 GMT 2024


Hi,

I maintain cgdb, a curses based front end to gdb.
I got a bug report here,
  https://github.com/cgdb/cgdb/issues/352
that i'm trying to resolve.

In one terminal i run
    valgrind --vgdb-error=0 ./main.

In another terminal i run
    gdb --ex "new-ui mi /dev/pts/12" --ex 'target remote | vgdb'
>From a 3rd terminal i run 'tty' to get /dev/pts/12.

Now, when i run 'monitor help' from the gdb terminal, i get this:
    (gdb) monitor help
    (gdb) 
please note the second prompt displayed by gdb.

In the third terminal, represented by /dev/pts/12, i see the proper
valgrind output. For instance,
  @"general valgrind monitor commands:\n"
  ....
  @"\n"
please note, it does not end with a (gdb) prompt or with ^done.

My issue is as follows. When i try to take the target output specified
by @ and display it in the gdb window within cgdb, gdb decides to print
to stdout it's primpt (gdb), in the middle of the target output.
So I end up with the prompt randomely in the middle of the target
output and not at the end.

Is there any way to synchronize this text properly?

Please remember the point of the new-ui feature is to allow the user to
type the commands they want, and have the front end run the commands it
wants, in these should work together in a natural way.

Thanks,
Bob Rossi


More information about the Gdb mailing list