Merge pull request #28 from gnustep/msvc-debugger-fixes

Various fixes for Windows MSVC
This commit is contained in:
Hugo Melder 2022-08-03 14:59:40 +02:00 committed by GitHub
commit 13db21b769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 22 deletions

View file

@ -40,6 +40,14 @@
id __work_around_clang_bug = @"__unused__";
#endif
/* strncpy is deprecated on Windows MSVC. Use strncpy_s instead.
*/
#if defined(_MSC_VER)
#define STRNCPY(dest, size_dest, src, size_src) strncpy_s(dest, size_dest, src, size_src);
#else
#define STRNCPY(dest, size_dest, src, size_src) strncpy(dest, src, size_dest);
#endif
/* A flag indicating that the testsuite is currently processing tests
* which are actually not expected to pass, but where we hope someone
* might have committed a bugfix.
@ -473,8 +481,9 @@ static void testStart()
BOOL _save_hopeful = testHopeful; \
unsigned _save_indentation = testIndentation; \
int _save_line = __LINE__; \
char *_save_set = (char*)malloc(strlen(setName) + 1); \
strncpy(_save_set, setName, strlen(setName) + 1); \
size_t _save_set_size = strlen(setName) + 1; \
char *_save_set = (char*)malloc(_save_set_size); \
STRNCPY(_save_set, _save_set_size, setName, _save_set_size); \
fprintf(stderr, "Start set: "); \
testIndent(); \
fprintf(stderr, "%s:%d ... %s\n", __FILE__, __LINE__, _save_set); \

View file

@ -517,14 +517,16 @@ proc_test_log ()
if test x"$GSTESTDBG" != x
then
DEBUGGER=`gnustep-config --variable=DEBUGGER`
EXT=`gnustep-config --variable=EXEEXT`
if present "$GSTESTSUM.tmp" "^Failed test:"
then
grep '^Failed test:' "$GSTESTLOG.tmp" | sed -e 's/^Failed test:[^:]*:\([0-9][0-9]*\).*/break testStart if testLineNumber==\1/' > "$GSTESTDBG"
gdb "./obj/$TESTNAME" -x "$GSTESTDBG"
$DEBUGGER "./obj/$TESTNAME"$EXT -x "$GSTESTDBG"
rm -f "$GSTESTDBG"
elif present "$GSTESTSUM.tmp" "^Failed file:"
then
gdb "./obj/$TESTNAME"
$DEBUGGER "./obj/$TESTNAME"$EXT
fi
fi

20
aclocal.m4 vendored
View file

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -12,9 +12,9 @@
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
dnl serial 11 (pkg-config-0.29.1)
dnl
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
@ -55,7 +55,7 @@ dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.1])
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@ -166,11 +166,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@ -187,7 +187,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full

73
configure vendored
View file

@ -730,6 +730,7 @@ CLANG_CC
CYGWIN
cc_bundle
cc_cppprecomp
DEBUGGER
EGREP
GREP
ac_ct_OBJCXX
@ -5388,6 +5389,62 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; }
# Search for a debugger. We try 'gdb' then 'lldb'. If
# we can't find it, we set it to 'gdb', even if that will fail later
# on.
for ac_prog in gdb lldb
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_DEBUGGER+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$DEBUGGER"; then
ac_cv_prog_DEBUGGER="$DEBUGGER" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_DEBUGGER="$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
DEBUGGER=$ac_cv_prog_DEBUGGER
if test -n "$DEBUGGER"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEBUGGER" >&5
printf "%s\n" "$DEBUGGER" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$DEBUGGER" && break
done
test -n "$DEBUGGER" || DEBUGGER="gdb"
# Used by gnustep-config to output the debugger variable and
# gnustep-tests.
#--------------------------------------------------------------------
# Check if we are using Apple cc
#--------------------------------------------------------------------
@ -7415,8 +7472,8 @@ fi
if test x"$GNUSTEP_HAS_PKGCONFIG" = x"yes" -a x"$OBJC_LIB_FLAG" = x""; then
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libobjc" >&5
printf %s "checking for libobjc... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libobjc >= 2" >&5
printf %s "checking for libobjc >= 2... " >&6; }
if test -n "$libobjc_CFLAGS"; then
pkg_cv_libobjc_CFLAGS="$libobjc_CFLAGS"
@ -7456,7 +7513,7 @@ fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -7523,7 +7580,7 @@ fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -7550,7 +7607,7 @@ Alternatively, you may set the environment variables libobjc_CFLAGS
and libobjc_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
@ -7575,7 +7632,7 @@ fi
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if test -n "$PKG_CONFIG" && \
@ -7628,7 +7685,7 @@ fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -7655,7 +7712,7 @@ Alternatively, you may set the environment variables libobjc_CFLAGS
and libobjc_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}

View file

@ -85,6 +85,15 @@ AC_PROG_OBJCXX
# We may use egrep for some tests further down below
AC_PROG_EGREP
# Search for a debugger. We try 'gdb' then 'lldb'. If
# we can't find it, we set it to 'gdb', even if that will fail later
# on.
AC_CHECK_PROGS(DEBUGGER, [gdb lldb], gdb)
# Used by gnustep-config to output the debugger variable and
# gnustep-tests.
AC_SUBST(DEBUGGER)
#--------------------------------------------------------------------
# Check if we are using Apple cc
#--------------------------------------------------------------------

View file

@ -70,6 +70,8 @@ if [ "$1" = "--help" ]; then
echo " --variable=CXX"
echo " --variable=OBJCXX"
echo " --variable=LDFLAGS"
echo " --variable=EXEEXT"
echo " --variable=DEBUGGER"
echo " --variable=GNUMAKE"
echo " --variable=GNUSTEP_MAKEFILES"
echo " --variable=GNUSTEP_USER_DEFAULTS_DIR"
@ -184,6 +186,10 @@ case "$1" in
exit 0;;
--variable=LDFLAGS) echo "@LDFLAGS@"
exit 0;;
--variable=EXEEXT) echo "@EXEEXT@"
exit 0;;
--variable=DEBUGGER) echo "@DEBUGGER@"
exit 0;;
--variable=GNUSTEP_MAKEFILES) echo "$GNUSTEP_MAKEFILES"
exit 0;;
--variable=GNUMAKE) echo "@GNUMAKE@"