public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "sledz@dresearch-fe.de" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/16152] New: buggy cygwin detection
Date: Mon, 11 Nov 2013 09:47:00 -0000	[thread overview]
Message-ID: <bug-16152-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=16152

            Bug ID: 16152
           Summary: buggy cygwin detection
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: sledz@dresearch-fe.de

Created attachment 7273
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7273&action=edit
suggested patch

Depending on specific gcc/glibc installation the cygwin detection for gdb leads
to false positives.

The detection itself generates a temporary file containing some defines and
these lines (see gdb/configure[.ac]):

#if defined (__CYGWIN__) || defined (__CYGWIN32__)
lose
#endif

This file is processed using "$CPP $CPPFLAGS". Depending on the specific
installation this may result in something like this:

# 1 "conftest.c"
# 1 "<command-line>"
# 1
"/pm/sledz/hipos-dfe/build-closed/tmp-eglibc/sysroots/qemux86-64/usr/include/stdc-predef.h"
1 3 4
# 30
"/pm/sledz/hipos-dfe/build-closed/tmp-eglibc/sysroots/qemux86-64/usr/include/stdc-predef.h"
3 4
# 1
"/pm/sledz/hipos-dfe/build-closed/tmp-eglibc/sysroots/qemux86-64/usr/include/bits/predefs.h"
1 3 4
# 31
"/pm/sledz/hipos-dfe/build-closed/tmp-eglibc/sysroots/qemux86-64/usr/include/stdc-predef.h"
2 3 4
# 1 "<command-line>" 2
# 1 "conftest.c"

In this case the path description contains the search pattern "lose". So the
check command "$EGREP" will find it. :(

I suggest to fix this by changing the check pattern from "lose" to "^lose$" to
check for the whole line (see attached patch).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


             reply	other threads:[~2013-11-11  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11  9:47 sledz@dresearch-fe.de [this message]
2013-11-27 21:32 ` [Bug gdb/16152] " tromey at redhat dot com
2013-11-28 17:32 ` cvs-commit at gcc dot gnu.org
2013-12-13 16:52 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-16152-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).