This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug gdb/16152] New: buggy cygwin detection


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.


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