[RFC] fix win32-nat failure

Pedro Alves pedro@codesourcery.com
Thu Oct 2 12:12:00 GMT 2008


On Thursday 02 October 2008 09:39:32, Pierre Muller wrote:

>   Well, in fact, I don't understand this statement,
> after reading it, I suspected that this had to do with the fact that
> I use a lot the 'set new-console on' option,
> but even without this I still get the same assertion failed message,
> so I don't understand why you did not also get it.

Sorry for being vague.  I just meant that this crashes:

 $ ./gdb --quiet ./test.exe
 (gdb) start
 Temporary breakpoint 1 at 0x40107a: file test.c, line 3.
 Starting program: /home/pedro/gdb/baseline/build/gdb/test.exe
 ../../src/gdb/inferior.c:41: internal-error: current_inferior: Assertion `inf' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n)

But this doesn't:

 $ gdb --args ./gdb ./test.exe
 GNU gdb 6.8.0.20080328-cvs (cygwin-special)
 (top-gdb) run
 Starting program: /home/pedro/gdb/baseline/build/gdb/gdb.exe ./test.exe
...
 (gdb) start
 Temporary breakpoint 1 at 0x40107a: file test.c, line 3.
 Starting program: /home/pedro/gdb/baseline/build/gdb/test.exe
 [New Thread 2196.0x2e0]
 [New Thread 2196.0xbe8]
 
 Temporary breakpoint 1, main () at test.c:3
 3         return 0;
 (gdb)

Because:

 (gdb) i
 (top-gdb) p gdb_has_a_terminal()
 $1 = 0

hence, the crash site is skipped (inflow.c):

 178     void
 179     terminal_init_inferior_with_pgrp (int pgrp)
 180     {
 181       if (gdb_has_a_terminal ())
 182         {

 234     void
 235     terminal_inferior (void)
 236     {
 237       if (gdb_has_a_terminal () && terminal_is_ours
 238           && inferior_ttystate != NULL
 239           && inferior_thisrun_terminal == 0)
 240         {

> OK, let me try this simpler patch out,
> I will send a RFA if that works OK for me.

Thanks!

-- 
Pedro Alves



More information about the Gdb-patches mailing list