Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Avoid error/prompt reversal for mingw
@ 2008-03-31 15:29 Pierre Muller
  2008-03-31 15:57 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Muller @ 2008-03-31 15:29 UTC (permalink / raw)
  To: gdb-patches

   I am currently trying to 
run the testsuite of mingw target...
It is almost working now...

One trouble I found when testing this
is that gdb errors
are often misplaced after the return prompt for
the mingw built gdb.

  I don't know if this is really a mingw specific bug
or if it can happen for other targets,
but I found a very easy way to avoid this:
I simply added a gdb_flush (file) 
after the exception test is printed out.

  Is there a reason not to do this?
Or this is patch OK?

Pierre Muller
Pascal language support maintainer for GDB

ChangeLog entry:

2008-03-31  Pierre Muller  <muller@ics.u-strasbg.fr>

	* exceptions.c (print_exception): force flush of file
	after printing of exception message.



$ cvs diff -up gdb/exceptions.c
Index: gdb/exceptions.c
===================================================================
RCS file: /cvs/src/src/gdb/exceptions.c,v
retrieving revision 1.28
diff -u -p -r1.28 exceptions.c
--- gdb/exceptions.c    14 Mar 2008 18:57:43 -0000      1.28
+++ gdb/exceptions.c    31 Mar 2008 15:05:39 -0000
@@ -310,7 +310,7 @@ print_exception (struct ui_file *file, s
        }
     }
   fprintf_filtered (file, "\n");
-
+  gdb_flush (file);
   /* Now append the annotation.  */
   switch (e.reason)
     {







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

* Re: [RFA] Avoid error/prompt reversal for mingw
  2008-03-31 15:29 [RFA] Avoid error/prompt reversal for mingw Pierre Muller
@ 2008-03-31 15:57 ` Daniel Jacobowitz
  2008-03-31 16:04   ` Pierre Muller
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2008-03-31 15:57 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

On Mon, Mar 31, 2008 at 05:16:50PM +0200, Pierre Muller wrote:
>    I am currently trying to 
> run the testsuite of mingw target...
> It is almost working now...

We have spent a lot of time over the last few months getting the
testsuite to run on mingw.  A mingw-built GDB does not work well
with a Cygwin expect.  The flush is actually a symptom of a larger
problem: isatty returns false when running in expect, but the
testsuite is written as if it runs on a terminal.

We've got a couple of patches.  Some of them we can submit because
they're only moderately ugly, but others are just horrible.  Can you
test a Cygwin-built GDB instead?  It's a lot easier, it works a lot
better, and it tests more or less the same code.

I can try to separate out the postable patches later this week if
you'd like.

-- 
Daniel Jacobowitz
CodeSourcery


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

* RE: [RFA] Avoid error/prompt reversal for mingw
  2008-03-31 15:57 ` Daniel Jacobowitz
@ 2008-03-31 16:04   ` Pierre Muller
  2008-03-31 17:34     ` 'Daniel Jacobowitz'
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Muller @ 2008-03-31 16:04 UTC (permalink / raw)
  To: 'Daniel Jacobowitz'; +Cc: gdb-patches

> We have spent a lot of time over the last few months getting the
> testsuite to run on mingw.  A mingw-built GDB does not work well
> with a Cygwin expect.  The flush is actually a symptom of a larger
> problem: isatty returns false when running in expect, but the
> testsuite is written as if it runs on a terminal.

  But this problem arises both for cygwin and mingw,
and nevertheless, I never saw the output reversed in Cygwin GDB.
  Cygwin tests are not very reliable either :(
I often get freezes while running the testsuite.
I could not get a single testsuite to complete on
a windows 2000 machine, while Windows XP
only freezes when I try to run several testsuite 
with different patches...

> We've got a couple of patches.  Some of them we can submit because
> they're only moderately ugly, but others are just horrible.  Can you
> test a Cygwin-built GDB instead?  It's a lot easier, it works a lot
> better, and it tests more or less the same code.

  I would really be interested in getting the mingw version
to work as well as the Cygwin, on reason being that I
would really prefer to be able to use a GDB library without 
cygwin DLL to integrate into my Free Pascal IDE...
  I would also like to be able to test the DJGPP version...
(I have a predilection for old stuff...)

> I can try to separate out the postable patches later this week if
> you'd like.

  Other that the one mentioned here, I have mainly :

1) a patch that uses cygpath to translate cygwin pathes into 
something that Mingw GDB understands, 
2)a "one line" patch to swallow the "cYg" warnings
in win32-nat.c 
3) added
set CC_FOR_TARGET "gcc -mno-cygwin"
to site.exp file in gdb/testsuite

 One other really annoying thing after is the
Dos/Unix line ending stuff...
Only a small part of the testsuite
copes correctly with that...

Should I conclude from your remarks that
my patch is not likely to get an approval?


Pierre Muller
Pascal language support maintainer for GDB






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

* Re: [RFA] Avoid error/prompt reversal for mingw
  2008-03-31 16:04   ` Pierre Muller
@ 2008-03-31 17:34     ` 'Daniel Jacobowitz'
  0 siblings, 0 replies; 4+ messages in thread
From: 'Daniel Jacobowitz' @ 2008-03-31 17:34 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

On Mon, Mar 31, 2008 at 05:57:15PM +0200, Pierre Muller wrote:
> > We have spent a lot of time over the last few months getting the
> > testsuite to run on mingw.  A mingw-built GDB does not work well
> > with a Cygwin expect.  The flush is actually a symptom of a larger
> > problem: isatty returns false when running in expect, but the
> > testsuite is written as if it runs on a terminal.
> 
>   But this problem arises both for cygwin and mingw,
> and nevertheless, I never saw the output reversed in Cygwin GDB.

No, isatty works fine in expect if you build a Cygwin GDB.  It's only
if you use MSVCRT's isatty that there's a problem.

> > We've got a couple of patches.  Some of them we can submit because
> > they're only moderately ugly, but others are just horrible.  Can you
> > test a Cygwin-built GDB instead?  It's a lot easier, it works a lot
> > better, and it tests more or less the same code.
> 
>   I would really be interested in getting the mingw version
> to work as well as the Cygwin, on reason being that I
> would really prefer to be able to use a GDB library without 
> cygwin DLL to integrate into my Free Pascal IDE...
>   I would also like to be able to test the DJGPP version...
> (I have a predilection for old stuff...)

The mingw version works well.  It's only when you try to use it in
combination with Cygwin programs (like expect) that there's trouble.
There are problems with terminal handling, C-c, isatty, and pathnames
when you mix a Cygwin environment with a non-Cygwin GDB.  Basically,
I recommend not doing it.

> 1) a patch that uses cygpath to translate cygwin pathes into 
> something that Mingw GDB understands, 

Interesting, we've done something similar (but it's pretty ugly; I
wasn't planning to submit it).

> 2)a "one line" patch to swallow the "cYg" warnings
> in win32-nat.c 

No opinion on this.

>  One other really annoying thing after is the
> Dos/Unix line ending stuff...
> Only a small part of the testsuite
> copes correctly with that...

We've got a patch for this one too; that's one I was planning to post.

> Should I conclude from your remarks that
> my patch is not likely to get an approval?

I don't think it's the right solution; that's another patch I could post.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2008-03-31 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-31 15:29 [RFA] Avoid error/prompt reversal for mingw Pierre Muller
2008-03-31 15:57 ` Daniel Jacobowitz
2008-03-31 16:04   ` Pierre Muller
2008-03-31 17:34     ` 'Daniel Jacobowitz'

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox