This is the mail archive of the insight@sources.redhat.com mailing list for the Insight 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]

FW: [FWD] Stdout and stdin do not appear to run when running Insight an d Cygwin for the PowerPC.


Replacing the write with "sim_io_write_stdout" causes hello world to be 
displayed correctly (both puts and printf variations).

I plan on making the following changes:

1 ) Rather than replace the do_write/write with "sim_io_write_stdout"; 
I will put a switch case that uses the "sim_io_write_stderr",
"sim_io_write_stdout" or uses "write" based on the value of the internal
variable d, which appears to be the file handle.

2) Apply the same type of changes to other operations in "emul_netbsd.c";
Well, at least to the read with stdin.

3) Apply the same type of changes to emul_unix.c and emul_bugapi.c.

I'm a newbie to this environment, so let me know if this sounds ok.

A) Concerning these changes possibly breaking something, the modified files
are all in the sim/ppc directory.  The only configuration that concerns me
Is when we are trying to emulate a PPC target running PPC/Unix on another 
Target.  Since this is (sort of) what I'm doing, its safe... Right?

B) What should I do so that these changes are folded back into the main line
of 
Insight/GDB?

C) On an entirely different note.  Checking the 
"File->Target Settings->Use xterm as inferior's tty" box has no effect under
Cygwin.
I suppose that it should cause the application's I/O to show up in a
separate Window
like the Cygwin native Insight does.  Is this correct?  Any ideas about
where to look
to correct this behavior would be appreciated.

Thanks in advance,
Derek

PS. I'm sorry about sending these things directly to you.  I'd like to post
so that
anyone could respond.  I CC'd the bulletin board
(insight@sources.redhat.com) with 
the last Email but it hasn't shown up.  I assume that I am still unable to
post.
Let me know if you know of a better place for me to send these emails and/or
you just
want me to stop.


-----Original Message-----
From: Dickinson, Derek 
Sent: Monday, February 09, 2004 10:54 PM
To: 'Keith Seitz'
Cc: 'insight@sources.redhat.com'
Subject: RE: [FWD] Stdout and stdin do not appear to run when running
Insight an d Cygwin for the PowerPC.


After some digging around, I discovered that my puts("Hello World"\n) 
ends up becoming a write(...) in the function do_write of module: 

Insight-6.0\sim\ppc\emul_netbsd.c

I suppose that this should be a sim_io_write_stdout for the simulator output
to be routed correctly?  In any event, this explains why none of the
breakpoints were being hit.

Questions:

1) Do you know of a simulator that has very good behavior with
Insight/Cygwin?  
In other words, which would be the best to use as an example when I try to 
Clean up some of the output.

2) I'm clearly not running netbsd, unix or Motorola bug.  How should the OS
option be set.

Thanks in advance,
Derek

-----Original Message-----
From: Keith Seitz [mailto:keiths@redhat.com] 
Sent: Thursday, February 05, 2004 8:19 PM
To: Dickinson, Derek
Subject: Re: [FWD] Stdout and stdin do not appear to run when running
Insight an d Cygwin for the PowerPC.


Hmm. I must have made a typo with your email... It bounced. Trying again.

-----Forwarded Message-----

On Thu, 2004-02-05 at 16:42, Keith Seitz wrote:
> > > Works on Solaris , However output appears in the originating
> > > terminal window.

This is not the correct behavior. All inferior output should show up in the
console window (except when running natively). It appears that remote-sim.c
or the simulator is misbehaving. Does the UI stay alive during when the sim
is running (in a loop, e.g.)?

> > > Works on Cygwin using PowerPc simulator (using XXXX-run command).
> > > Works on Cygwin using PowerPc XXXX-gdb (target sim, load, run).

I presume you mean that you can see your program's output using command-line
gdb. Unfortunately, this is only a sanity test, since command-line gdb just
dumps output to the terminal: it doesn't have any windows to worry about!
 
> > > Fails under Cygwin using Insight.  There are no error messages,
> > > the output doesn't show up anywhere (console or originating terminal).
> > > I've observed the same behavior with a PowerPc environment I built and
one
> > > supplied by MicroCross.

If you have a few seconds to debug this.... Put a breakpoint in
gdb_os_printf_filtered, gdb_os_write_stdout, gdb_os_vfprintf_filtered, and
gdb_os_evprintf_filtered. Which one of these does the output pass through?

Here's a quick thing to try... replace the "gdb_stdout" with "gdb_stdtarg"
in gdb_os_*_filtered.  Work now?

Keith


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