summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2022-10-28 11:19:34 +0300
committerArnold D. Robbins <arnold@skeeve.com>2022-10-28 11:19:34 +0300
commit46cba4567028a61212be90b0ebb192c4734c007d (patch)
treeb92ef74ee9aac6d27910b161c306cb48decaa3f8
parent037b21d09f684cea35ff33c19214b5f1a7711bd3 (diff)
downloadgawk-46cba4567028a61212be90b0ebb192c4734c007d.tar.gz
Improve debuggability, mainly for maintainers.
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in3
-rwxr-xr-xconfigure14
-rw-r--r--configure.ac14
-rw-r--r--extension/ChangeLog8
-rw-r--r--extension/Makefile.am3
-rw-r--r--extension/Makefile.in3
-rwxr-xr-xextension/configure4
-rw-r--r--extension/configure.ac4
-rw-r--r--support/ChangeLog4
-rw-r--r--support/Makefile.am3
-rw-r--r--support/Makefile.in3
13 files changed, 66 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index cb42e91a..1db51547 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-10-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (DEBUG): New variable with debug compilation flags.
+ * configure.ac: Rework debug compilation to use DEBUG in Makefile.am
+ and to add %no-lines to grammar files. Works around GDB issue
+ with macros and #line directives. Thanks to Ulrich Drepper
+ for the help and for the suggestions.
+
2022-10-26 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Try to get macros to work in the debugger.
diff --git a/Makefile.am b/Makefile.am
index c406b2ed..99e26866 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -141,6 +141,9 @@ CP= cp
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
+# For debugging
+DEBUG = -gdwarf-4 -g3
+
# First, add a link from gawk to gawk-X.Y.Z.
#
# For GNU systems where gawk is awk, add a link to awk.
diff --git a/Makefile.in b/Makefile.in
index 1ed28d30..bbaeae15 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -581,6 +581,9 @@ CP = cp
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
+
+# For debugging
+DEBUG = -gdwarf-4 -g3
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/configure b/configure
index 931df5d9..85d85429 100755
--- a/configure
+++ b/configure
@@ -7101,7 +7101,7 @@ then
# enable debugging using macros also
if test "$GCC" = yes
then
- CFLAGS="$CFLAGS -Wall -fno-builtin -gdwarf-4 -g3"
+ CFLAGS="$CFLAGS -Wall -fno-builtin"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@@ -15581,9 +15581,19 @@ if test "$GCC" = yes &&
test -f $srcdir/.developing &&
grep -i debug $srcdir/.developing > /dev/null
then
+ for i in awkgram command
+ do
+ rm -f $i.c
+ ed - $i.y << \EOF
+/^%}/a
+%no-lines
+.
+w
+EOF
+ done
for i in . support
do
- sed '/-O2/s///' $i/Makefile > foo
+ sed -e '/-O2/s///' -e '/^CFLAGS = /s//&${DEBUG} /' $i/Makefile > foo
mv foo $i/Makefile
done
fi
diff --git a/configure.ac b/configure.ac
index fdc17c62..1b87be89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,7 +136,7 @@ then
# enable debugging using macros also
if test "$GCC" = yes
then
- CFLAGS="$CFLAGS -Wall -fno-builtin -gdwarf-4 -g3"
+ CFLAGS="$CFLAGS -Wall -fno-builtin"
fi
AC_MSG_RESULT([yes])
else
@@ -502,9 +502,19 @@ if test "$GCC" = yes &&
test -f $srcdir/.developing &&
grep -i debug $srcdir/.developing > /dev/null
then
+ for i in awkgram command
+ do
+ rm -f $i.c
+ ed - $i.y << \EOF
+/^%}/a
+%no-lines
+.
+w
+EOF
+ done
for i in . support
do
- sed '/-O2/s///' $i/Makefile > foo
+ sed -e '/-O2/s///' -e '/^CFLAGS = /s//&${DEBUG} /' $i/Makefile > foo
mv foo $i/Makefile
done
fi
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 4caf864e..04d6b35c 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,11 @@
+2022-10-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (DEBUG): New variable with debug compilation flags.
+ * configure.ac: Rework debug compilation to use DEBUG in Makefile.am
+ and to add %no-lines to grammar files. Works around GDB issue
+ with macros and #line directives. Thanks to Ulrich Drepper
+ for the help and for the suggestions.
+
2022-10-26 Arnold D. Robbins <arnold@skeeve.com>
* configure.ac: Try to get macros to work in the debugger.
diff --git a/extension/Makefile.am b/extension/Makefile.am
index 736fa1ef..28208c5a 100644
--- a/extension/Makefile.am
+++ b/extension/Makefile.am
@@ -152,5 +152,8 @@ dist_man_MANS = \
# gettext requires this
SUBDIRS = po
+# For debugging
+DEBUG = -gdwarf-4 -g3
+
distclean-local:
rm -fr .deps
diff --git a/extension/Makefile.in b/extension/Makefile.in
index 7cf10cee..6c8937c0 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -665,6 +665,9 @@ dist_man_MANS = \
# gettext requires this
SUBDIRS = po
+
+# For debugging
+DEBUG = -gdwarf-4 -g3
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/extension/configure b/extension/configure
index 387f8391..477aa0ed 100755
--- a/extension/configure
+++ b/extension/configure
@@ -17132,7 +17132,7 @@ if test -f $srcdir/../.developing
then
if test "$GCC" = yes
then
- CFLAGS="$CFLAGS -Wall -fno-builtin -gdwarf-4 -g3"
+ CFLAGS="$CFLAGS -Wall -fno-builtin"
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
@@ -20229,7 +20229,7 @@ if test "$GCC" = yes &&
test -f $srcdir/../.developing &&
grep -i debug $srcdir/../.developing > /dev/null
then
- sed '/-O2/s///' Makefile > foo
+ sed -e '/-O2/s///' -e '/^CFLAGS = /s//&${DEBUG} /' Makefile > foo
mv foo Makefile
fi
diff --git a/extension/configure.ac b/extension/configure.ac
index 2f598305..412db25c 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -93,7 +93,7 @@ if test -f $srcdir/../.developing
then
if test "$GCC" = yes
then
- CFLAGS="$CFLAGS -Wall -fno-builtin -gdwarf-4 -g3"
+ CFLAGS="$CFLAGS -Wall -fno-builtin"
fi
AC_MSG_RESULT([yes])
else
@@ -140,6 +140,6 @@ if test "$GCC" = yes &&
test -f $srcdir/../.developing &&
grep -i debug $srcdir/../.developing > /dev/null
then
- sed '/-O2/s///' Makefile > foo
+ sed -e '/-O2/s///' -e '/^CFLAGS = /s//&${DEBUG} /' Makefile > foo
mv foo Makefile
fi
diff --git a/support/ChangeLog b/support/ChangeLog
index 1b557d0c..06e05fcf 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,7 @@
+2022-10-28 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (DEBUG): New variable with debug compilation flags.
+
2022-10-20 Paul Eggert <eggert@cs.ucla.edu>
Port to current Gnulib
diff --git a/support/Makefile.am b/support/Makefile.am
index a2ed128c..1f2a4aab 100644
--- a/support/Makefile.am
+++ b/support/Makefile.am
@@ -81,6 +81,9 @@ endif
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
+# For debugging
+DEBUG = -gdwarf-4 -g3
+
DEFS = -DGAWK -DHAVE_CONFIG_H -I"$(srcdir)/.."
distclean-local:
diff --git a/support/Makefile.in b/support/Makefile.in
index 01c3aed0..3d46aa1e 100644
--- a/support/Makefile.in
+++ b/support/Makefile.in
@@ -390,6 +390,9 @@ libsupport_a_SOURCES = attribute.h cdefs.h dfa.c dfa.h dynarray.h \
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
+
+# For debugging
+DEBUG = -gdwarf-4 -g3
all: all-am
.SUFFIXES: