[PATCH 1/3] Detect GDB is in cygwin

Yao Qi yao@codesourcery.com
Tue Aug 13 08:12:00 GMT 2013


On 08/08/2013 03:28 PM, Pierre Muller wrote:
>    Without mintty (running Cygwin bash directly), I do get a FILE_TYPE_CHAR,
> and a second check by calling GetConsoleMode with the same handle
> allows to verify that it is indeed a Windows OS Console handle.
>
>    I think that there is indeed no good way to know if we are using
> a non-interactive pipe...
>    As the primary purpose of the patch was to allow better results for the
> testsuite
> for mingw builds, I think that the idea
> of adding a
>   "maint set testsuite-mode on/off"
> command that could be
> automatically added to
> INTERNAL_GDBFLAGS as "-iex {maint set testsuite-mode on}"
> would be a simpler approach.
>    It would guaranty that we do not change existing behavior for
> interactive GDB use and should solve the problem about ^M^M patterns that
> lead to lots of failures when testing mingw builds.
>    As I explained earlier, this changes are also required if you want
> to run the testsuite on msys terminal.
>
>    Should I prepare a RFC?
>

Pierre,
Yes, I think so, but before you post it, we have to coordinate on this. 
  Two people (you and I) post the similar-but-different patches may 
confuse maintainers and doesn't help on review and approval on any
of them.  There are some issues related to mingw and cygwin, and we
(you and I) are working on some of them, with different focus.  If you
don't mind, I'll post my patches again, a fresh version, V4, and
hopefully maintainers can approve them this time.  In the review of V3,
all the questions were addressed, AFAIK, but no one approved it
explicitly.

Then, you can prepare your RFC, and I am happy to help (review and 
test).  Is it OK to you?

>    One question about this new command that I had in mind
> was about the scope of this command.
>    Should I put it inside mingw-hdep.c code and restrict it to
> mingw builds, or should I introduce that command globally,
> the posix-tdep.c version would be an empty function for now,
> but could be useful (?) later.

I prefer the former one.

>    The advantage of the second approach is that we could add
> the "-iex {maint set testsuite-mode on}" unconditionally in gdb.exp,
> but that might seem like a weak argument...

You can modify your board file or build_dir/gdb/testsuite/site.exp to 
append the option to GDBFLAGS.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list