public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Output of printf command
@ 2002-01-28  9:37 David Mc Kenna
  2002-01-28 10:59 ` Tom Tromey
  0 siblings, 1 reply; 8+ messages in thread
From: David Mc Kenna @ 2002-01-28  9:37 UTC (permalink / raw)
  To: Tom Tromey, mckennad, insight

At present I'm running Cygwin, with Win98.

Thanks,
Dave
--
http://www.iol.ie

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
  2002-01-28  9:37 Output of printf command David Mc Kenna
@ 2002-01-28 10:59 ` Tom Tromey
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2002-01-28 10:59 UTC (permalink / raw)
  To: mckennad; +Cc: insight

>>>>> "David" == David Mc Kenna <mckennad@esatclear.ie> writes:

David> At present I'm running Cygwin, with Win98.

Thanks.  Then, unfortunately, what I said doesn't apply.
I haven't used Insight on Windows in years.  Someone else will have to
answer your question.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
  2002-02-12 20:37 ` Keith Seitz
@ 2002-02-13  3:55   ` Kai Ruottu
  0 siblings, 0 replies; 8+ messages in thread
From: Kai Ruottu @ 2002-02-13  3:55 UTC (permalink / raw)
  Cc: Insight Maling List

Keith Seitz wrote:
> 
> On Thu, 7 Feb 2002, Keith Seitz wrote:
> 
> > On Thu, 7 Feb 2002, David Mc Kenna wrote:
> >
> > > This GDB was configured as "--host=i686-pc-cygwin --target=arm-elf".
> >
> > Ok, that's starting to make some sense. Cygwin hosts obviously don't have
> > xterms (even those with XFree86, as far as Insight is concerned).
> >
> > I will check into this and get back to you.
> 
> Ok, I've checked into this, and it is a simulator problem. The ARM
> simulator (sim/arm) doesn't use the gdb/sim callback interface for os-like
> functions. It just does printf/fprintf and ignores that there might be a
> ui on the other side.
> 
> I've modified src/sim/arm/armos.c to use the callback interface, and it
> works for me for my simple testcase.
> 
> I've contacted some sim folks, and I'll send a note when/if this is fixed.
> I don't know how this has gone unnoticed for so long.

 All the other sims could also be checked, the japanese targets used to output
to the GDB-console ("Console Window") as default, while some like the PowerPC
'psim' use 'write(1,...)' directly, this forces the output to the 'system console',
to the xterm or to the Win32-console. This has been compatible with the native
Insights (this far). Outputting to the GDB-console has been seen uncompatible
by me, but it has been the only possibility on systems without a 'system console'
like Win32s.  Here is a clip taken from my 'sim/ppc/emul-unix.c':

----------------------- clip ----------------------
static void
do_unix_write(os_emul_data *emul,
	      unsigned call,
	      const int arg0,
	      cpu *processor,
	      unsigned_word cia)
{
  void *scratch_buffer = NULL;
  int d = (int)cpu_registers(processor)->gpr[arg0];
  unsigned_word buf = cpu_registers(processor)->gpr[arg0+1];
  int nbytes = cpu_registers(processor)->gpr[arg0+2];
  int status;

  if (WITH_TRACE && ppc_trace[trace_os_emul])
    printf_filtered ("%d, 0x%lx, %d", d, (long)buf, nbytes);

  /* get a tempoary bufer */
  scratch_buffer = zalloc(nbytes); /* FIXME - nbytes == 0 */

  /* copy in */
  emul_read_buffer(scratch_buffer, buf, nbytes,
		   processor, cia);

  /* write */
#ifdef __WIN32S__
  status = ppc_callback->write(ppc_callback, d, scratch_buffer, nbytes);
#else
  status = write(d, scratch_buffer, nbytes);
#endif
  emul_write_status(processor, status, errno);
  zfree(scratch_buffer);

  flush_stdoutput();
}
----------------------- clip ----------------------

 The GDB-console has been the only available place for the 'callback-writes'
AFAIK... Is there something else available now?
 
 This far ('...5.0') the direct 'write()'s have however worked on Unix and
Win32, but is there now some change in '5.1.x' ?  The last sources I have
tried are from the sad day '20010911' and a little later and then the output
to the system console still worked... But I may have some local patches added,
to continue to use the 'system console' just as earlier, which I have now
forgotten. Anyway with the Autumn-2001 snapshots the following happens on
Win32 when I click a '<prefix>-gdb' icon:

 1. The black Win32 console, the 'system console' for the 'stdout' from the
    debugged program opens

 2. After a while the empty Source Window, ie. the Insight-GUI opens

 If the 1. doesn't happen, there is some essential difference between my
(patched) and the plain vanilla Insight sources... Or the user is still
using Win3.1x/Win32s ;-)

 I use Mingw as the Win32-host, not Cygwin... Neither I build the Win32-
binaries under Windoze, but under Linux (using Linux-x-Mingw tools), but
this should make any difference (than making the builds much easier and
quicker...)

Cheers, Kai

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
       [not found] <Pine.GSO.4.33.0202070834120.10197-100000@makita.cygnus.com>
@ 2002-02-12 20:37 ` Keith Seitz
  2002-02-13  3:55   ` Kai Ruottu
  0 siblings, 1 reply; 8+ messages in thread
From: Keith Seitz @ 2002-02-12 20:37 UTC (permalink / raw)
  To: David Mc Kenna; +Cc: Insight Maling List

On Thu, 7 Feb 2002, Keith Seitz wrote:

> On Thu, 7 Feb 2002, David Mc Kenna wrote:
>
> > This GDB was configured as "--host=i686-pc-cygwin --target=arm-elf".
>
> Ok, that's starting to make some sense. Cygwin hosts obviously don't have
> xterms (even those with XFree86, as far as Insight is concerned).
>
> I will check into this and get back to you.

Ok, I've checked into this, and it is a simulator problem. The ARM
simulator (sim/arm) doesn't use the gdb/sim callback interface for os-like
functions. It just does printf/fprintf and ignores that there might be a
ui on the other side.

I've modified src/sim/arm/armos.c to use the callback interface, and it
works for me for my simple testcase.

I've contacted some sim folks, and I'll send a note when/if this is fixed.
I don't know how this has gone unnoticed for so long.

Keith


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
@ 2002-02-07  8:30 David Mc Kenna
  0 siblings, 0 replies; 8+ messages in thread
From: David Mc Kenna @ 2002-02-07  8:30 UTC (permalink / raw)
  To: Keith Seitz, David Mc Kenna, insight


The output is as follows :

GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.

This GDB was configured as "--host=i686-pc-cygwin --target=arm-elf".

But when I select "use xterm as inferrior" I still get no visible output.

Thanks,
Dave

>On Mon, 28 Jan 2002, David Mc Kenna wrote:
>
>> Having compiled Insight/GDB 5.1.1 I am experiencing a problem.
>>
>> When I try to run GDB, Insight with -nw , and executed a simple hello world

>> program, Hello world gets printed in the GDB console. When I run Insight
GUI
>> with the same program, the output does not get printed. Could this be because

>> when I launch Insight that no "hooks" are left in my console window, i.e.
I
>> can execute new commands in my bash shell. If so how do I fix this? When
I run
>> the program I get a message in the console window of Insight ( View/Console)

>> that the program has exited normally.
>
>What does gdb -v say? (Need to know host and target)
>
>In general, if you are using Insight on unix, all terminal i/o will go to
>the controlling terminal (and yes, you must have one, so you cannot
>background Insight in this case). Alternatively, you could use the Run
>button and File->Target Settings... to select "Use xterm as inferior's
>tty". Then you should be able to use Insight without a cntrolling
>terminal.
>
>On Windows, you'll get the command shell when you your application, so
>that will behave the same as the "use xterm for inferior's tty" case for
>unix. (I think! ;-)
>
>Keith
>


--
http://www.iol.ie

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
  2002-01-28  8:08 David Mc Kenna
  2002-01-28  9:30 ` Tom Tromey
@ 2002-02-05 14:28 ` Keith Seitz
  1 sibling, 0 replies; 8+ messages in thread
From: Keith Seitz @ 2002-02-05 14:28 UTC (permalink / raw)
  To: David Mc Kenna; +Cc: insight

On Mon, 28 Jan 2002, David Mc Kenna wrote:

> Having compiled Insight/GDB 5.1.1 I am experiencing a problem.
>
> When I try to run GDB, Insight with -nw , and executed a simple hello world
> program, Hello world gets printed in the GDB console. When I run Insight GUI
> with the same program, the output does not get printed. Could this be because
> when I launch Insight that no "hooks" are left in my console window, i.e. I
> can execute new commands in my bash shell. If so how do I fix this? When I run
> the program I get a message in the console window of Insight ( View/Console)
> that the program has exited normally.

What does gdb -v say? (Need to know host and target)

In general, if you are using Insight on unix, all terminal i/o will go to
the controlling terminal (and yes, you must have one, so you cannot
background Insight in this case). Alternatively, you could use the Run
button and File->Target Settings... to select "Use xterm as inferior's
tty". Then you should be able to use Insight without a cntrolling
terminal.

On Windows, you'll get the command shell when you your application, so
that will behave the same as the "use xterm for inferior's tty" case for
unix. (I think! ;-)

Keith


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Output of printf command
  2002-01-28  8:08 David Mc Kenna
@ 2002-01-28  9:30 ` Tom Tromey
  2002-02-05 14:28 ` Keith Seitz
  1 sibling, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2002-01-28  9:30 UTC (permalink / raw)
  To: mckennad; +Cc: insight

>>>>> "David" == David Mc Kenna <mckennad@esatclear.ie> writes:

David> When I try to run GDB, Insight with -nw , and executed a simple
David> hello world program, Hello world gets printed in the GDB
David> console. When I run Insight GUI with the same program, the
David> output does not get printed. Could this be because when I
David> launch Insight that no "hooks" are left in my console window,
David> i.e. I can execute new commands in my bash shell. If so how do
David> I fix this? When I run the program I get a message in the
David> console window of Insight ( View/Console) that the program has
David> exited normally.

You don't mention what platform you're on.

On Unix platforms you can ask Insight to run your program using an
xterm.  In this mode, Insight will start a new xterm to serve as your
program's tty.

I have a partial patch to let the inferior's output show up in the
Insight console window, but I haven't yet polished it sufficiently for
inclusion into Insight.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Output of printf command
@ 2002-01-28  8:08 David Mc Kenna
  2002-01-28  9:30 ` Tom Tromey
  2002-02-05 14:28 ` Keith Seitz
  0 siblings, 2 replies; 8+ messages in thread
From: David Mc Kenna @ 2002-01-28  8:08 UTC (permalink / raw)
  To: insight

Hi,

Having compiled Insight/GDB 5.1.1 I am experiencing a problem.

When I try to run GDB, Insight with -nw , and executed a simple hello world
program, Hello world gets printed in the GDB console. When I run Insight GUI
with the same program, the output does not get printed. Could this be because
when I launch Insight that no "hooks" are left in my console window, i.e. I
can execute new commands in my bash shell. If so how do I fix this? When I run
the program I get a message in the console window of Insight ( View/Console)
that the program has exited normally.

Thanks,
Dave Mc Kenna



--
http://www.iol.ie

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-02-13 11:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-28  9:37 Output of printf command David Mc Kenna
2002-01-28 10:59 ` Tom Tromey
     [not found] <Pine.GSO.4.33.0202070834120.10197-100000@makita.cygnus.com>
2002-02-12 20:37 ` Keith Seitz
2002-02-13  3:55   ` Kai Ruottu
  -- strict thread matches above, loose matches on Subject: below --
2002-02-07  8:30 David Mc Kenna
2002-01-28  8:08 David Mc Kenna
2002-01-28  9:30 ` Tom Tromey
2002-02-05 14:28 ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).