This is the mail archive of the gdb@sourceware.cygnus.com 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]

Insight remote output doesn't output to console window immediately


[ Sent to gdb and insight lists since ]

I've found a problem in insight that is surprisingly old - I can't imagine
how it's lived so long actually: output from a remote target doesn't get
sent to the console window as it arrives. Instead it is buffered up.

I believe the problem is because of Cagney's change to remote.c on July 2nd
1999 which changed remote_console_output to operate on the gdb_stdtarg
stream rather than gdb_stdout. But, in main.c, gdb_stdtarg is #defined to
gdb_stderr. Which means that it matches the following code in
gdbtk/generic/gdbtk-hooks.c in gdbtk_fputs():


  if (result_ptr != NULL)
    {
      if (result_ptr->flags & GDBTK_TO_RESULT)
...
      else if (stream == gdb_stderr || result_ptr->flags &
GDBTK_ERROR_ONLY)
        {
          if (result_ptr->flags & GDBTK_ERROR_STARTED)
            Tcl_AppendToObj (result_ptr->obj_ptr, (char *) ptr, -1);
          else
            {
              Tcl_SetStringObj (result_ptr->obj_ptr, (char *) ptr, -1);
              result_ptr->flags |= GDBTK_ERROR_STARTED;
            }

i.e. it is appended to result_ptr, rather than calling gdbtk_tcl_fputs to
display it in the console window.

The only thing I'm wondering about is the fix. We could #define gdb_stdtarg
to gdb_stdout instead. Or we could add a hook with set_ui_file_flush() so
that the "gdb_flush (gdb_stdtarg);" at the end of remote_console_output()
would do the right thing. I simply don't know which is the more correct fix
before I implement it, although I suspect the latter.

Let me know - I'd like to sort this out soon because it affects Insight 5
(?) as well. Ta,

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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