This is the mail archive of the gdb-patches@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]

Re: [patch] New test+use texinfo @click - @HAVE_MAKEINFO_CLICK@ [Re: doc build failure (Re: [patch 04/12] entryval#3: Virtual tail call frames)]


On Mon, 10 Oct 2011 23:56:34 +0200, Pedro Alves wrote:
> On Monday 10 October 2011 19:47:26, Jan Kratochvil wrote:
> > +  if makeinfo conftest.texinfo >&5 2>&5; then
> 
> Shouldn't this be $(MAKEINFO) instead (like in Makefile.in)?
> Though I'm not sure how to do that here.  Maybe
> AC_CHECK_PROGS(MAKEINFO, makeinfo) ?

Yes, it should, although it is more complicated.

There is IMO a bug in toplevel configure it does not pass down MAKEINFOFLAGS
and includes "--split-size=5000000" directly into MAKEINFO.  Without the
special handling of --split-size=5000000 it would be used during first
compilation but no longer used after automatic re-run of configure in gdb/
(although only if one deletes gdb/config.cache).

Therefore I added --split-size=5000000 there explicitly, which means it is
duplicated during the dirst compilation but it does not matter.

--split-size=5000000 was not used in gdb/doc/ before at all but I think it was
a bug, even gcc uses --no-split.


> It should be somethink like MAKEINFO_EXTRA_FLAGS.
> (MAKEINFOFLAGS is the moral equivalent of CFLAGS, so we should
> leave it reserved for the user.)

Done.


On Tue, 11 Oct 2011 00:18:54 +0200, Andreas Schwab wrote:
> You should not modify MAKEINFO.  If you say
> "make info MAKEINFO=/usr/local/bin/makeinfo" you lose the flags.

True, toplevel configure is already violating that but fixed it in gdb/ .


Thanks,
Jan


gdb/
2011-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix compatibility with texinfo versions older than 4.12.
	* Makefile.in (MAKEINFO): Set to @MAKEINFO@.
	(MAKEINFOFLAGS, MAKEINFO_EXTRA_FLAGS, MAKEINFO_CMD): New.
	(MAKEHTMLFLAGS): Use MAKEINFO_CMD.
	(FLAGS_TO_PASS): Add MAKEINFOFLAGS and MAKEINFO_EXTRA_FLAGS.
	* configure: Regenerate.
	* configure.ac (MAKEINFO): Find it, from libiberty/configure.ac.
	(MAKEINFOFLAGS): Pre-set it to --split-size=5000000.
	(MAKEINFO_EXTRA_FLAGS): New test for -DHAVE_MAKEINFO_CLICK.

gdb/doc/
2011-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix compatibility with texinfo versions older than 4.12.
	* Makefile.in (MAKEINFO): Set to @MAKEINFO@.
	(MAKEINFOFLAGS, MAKEINFO_EXTRA_FLAGS, MAKEINFO_CMD): New.
	(MAKEHTMLFLAGS): Use MAKEINFO_CMD.
	(gdb.info, gdbint.info, stabs.info, annotate.info): Use MAKEINFO_CMD.
	* gdb.texinfo (Tail Call Frames): Convert @arrow{} to @click, when possible.
	Make the conversion conditional on HAVE_MAKEINFO_CLICK, using variables
	CALLSEQ1A, CALLSEQ1B, CALLSEQ2A and CALLSEQ2B.

--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -109,9 +109,12 @@ FLEX = flex
 YLWRAP = $(srcdir)/../ylwrap
 
 # where to find makeinfo, preferably one designed for texinfo-2
-MAKEINFO=makeinfo
+MAKEINFO = @MAKEINFO@
+MAKEINFOFLAGS = @MAKEINFOFLAGS@
+MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
+MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
 
-MAKEHTML = $(MAKEINFO) --html
+MAKEHTML = $(MAKEINFO_CMD) --html
 MAKEHTMLFLAGS =
 
 # Set this up with gcc if you have gnu ld and the loader will print out
@@ -614,6 +617,8 @@ FLAGS_TO_PASS = \
 	"LDFLAGS=$(LDFLAGS)" \
 	"RANLIB=$(RANLIB)" \
 	"MAKEINFO=$(MAKEINFO)" \
+	"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
+	"MAKEINFO_EXTRA_FLAGS=$(MAKEINFO_EXTRA_FLAGS)" \
 	"MAKEHTML=$(MAKEHTML)" \
 	"MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
 	"INSTALL=$(INSTALL)" \
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -87,6 +87,38 @@ PACKAGE=gdb
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
 AC_SUBST(PACKAGE)
 
+# Do we have a single-tree copy of texinfo?  Even if we do, we can't
+# rely on it - libiberty is built before texinfo.
+AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
+if test "x$MAKEINFO" = "x"; then
+  AC_ERROR([makeinfo is required for compilation])
+else
+  case "$MAKEINFO" in
+    */missing\ makeinfo*)
+      AC_ERROR([makeinfo is required for compilation])
+      ;;
+  esac
+fi
+AC_SUBST(MAKEINFO)
+
+# --split-size=5000000 may be already in $MAKEINFO from parent configure.
+# Re-running configure in gdb/ would lose it so ensure it stays present.
+MAKEINFOFLAGS=${MAKEINFOFLAGS---split-size=5000000}
+AC_SUBST(MAKEINFOFLAGS)
+
+MAKEINFO_EXTRA_FLAGS=""
+AC_CACHE_CHECK([whether $MAKEINFO supports @click], gdb_cv_have_makeinfo_click,
+  [echo '@clicksequence{a @click{} b}' >conftest.texinfo
+  if eval "$MAKEINFO conftest.texinfo >&5 2>&5"; then
+    gdb_cv_have_makeinfo_click=yes
+  else
+    gdb_cv_have_makeinfo_click=no
+  fi])
+if test x"$gdb_cv_have_makeinfo_click" = xyes; then
+  MAKEINFO_EXTRA_FLAGS="$MAKEINFO_EXTRA_FLAGS -DHAVE_MAKEINFO_CLICK"
+fi
+AC_SUBST(MAKEINFO_EXTRA_FLAGS)
+
 # GDB does not use automake, but gnulib does.  This line lets us
 # generate its Makefile.in.
 AM_INIT_AUTOMAKE(gdb, UNUSED-VERSION, [no-define])
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -45,9 +45,12 @@ gdbdir = $(srcdir)/..
 TEXIDIR=${gdbdir}/../texinfo
 
 # where to find makeinfo, preferably one designed for texinfo-2
-MAKEINFO=makeinfo
+MAKEINFO = @MAKEINFO@
+MAKEINFOFLAGS = @MAKEINFOFLAGS@
+MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
+MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
 
-MAKEHTML = $(MAKEINFO) --html 
+MAKEHTML = $(MAKEINFO_CMD) --html
 MAKEHTMLFLAGS =
 
 # where to find texi2roff, ditto
@@ -365,7 +368,7 @@ gdb.pdf: ${GDB_DOC_FILES}
 
 # GDB MANUAL: info file
 gdb.info: ${GDB_DOC_FILES}
-	$(MAKEINFO) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+	$(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
 		-o gdb.info $(srcdir)/gdb.texinfo
 
 # GDB MANUAL: roff translations
@@ -464,7 +467,7 @@ gdbint.pdf: $(GDBINT_DOC_FILES)
 # GDB INTERNALS MANUAL: info file
 
 gdbint.info: $(GDBINT_DOC_FILES)
-	$(MAKEINFO) -I $(srcdir) -o gdbint.info $(srcdir)/gdbint.texinfo
+	$(MAKEINFO_CMD) -I $(srcdir) -o gdbint.info $(srcdir)/gdbint.texinfo
 
 # GDB INTERNALS MANUAL: HTML file
 
@@ -472,7 +475,7 @@ gdbint/index.html: $(GDBINT_DOC_FILES)
 	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/gdbint.texinfo
 
 stabs.info: $(STABS_DOC_FILES)
-	$(MAKEINFO) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
+	$(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
 
 # STABS DOCUMENTATION: HTML file
 
@@ -516,7 +519,7 @@ annotate.pdf: $(ANNOTATE_DOC_FILES)
 	$(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
 
 annotate.info: $(ANNOTATE_DOC_FILES)
-	$(MAKEINFO)  -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
+	$(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
 
 annotate/index.html: $(ANNOTATE_DOC_FILES)
 	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/annotate.texinfo
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -9789,11 +9789,24 @@ tailcall: reduced: 0x4004d2(a) |
 #2  0x0000000000400395 in main () at t.c:9
 @end smallexample
 
-Frames #0 and #2 are real, #1 is a virtual tail call frame.  The code can have
-possible execution paths
-@code{main@arrow{}a@arrow{}b@arrow{}c@arrow{}d@arrow{}f} or
-@code{main@arrow{}a@arrow{}b@arrow{}e@arrow{}f}, @value{GDBN} cannot find which
-one from the inferior state.
+@set CALLSEQ1A @code{main@value{ARROW}a@value{ARROW}b@value{ARROW}c@value{ARROW}d@value{ARROW}f}
+@set CALLSEQ2A @code{main@value{ARROW}a@value{ARROW}b@value{ARROW}e@value{ARROW}f}
+
+@c Convert CALLSEQ#A to CALLSEQ#B depending on HAVE_MAKEINFO_CLICK.
+@ifset HAVE_MAKEINFO_CLICK
+@set ARROW @click{}
+@set CALLSEQ1B @clicksequence{@value{CALLSEQ1A}}
+@set CALLSEQ2B @clicksequence{@value{CALLSEQ2A}}
+@end ifset
+@ifclear HAVE_MAKEINFO_CLICK
+@set ARROW ->
+@set CALLSEQ1B @value{CALLSEQ1A}
+@set CALLSEQ2B @value{CALLSEQ2A}
+@end ifclear
+
+Frames #0 and #2 are real, #1 is a virtual tail call frame.
+The code can have possible execution paths @value{CALLSEQ1B} or
+@value{CALLSEQ2B}, @value{GDBN} cannot find which one from the inferior state.
 
 @code{initial:} state shows some random possible calling sequence @value{GDBN}
 has found.  It then finds another possible calling sequcen - that one is


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