|
From: Benjamin L. <lin...@gm...> - 2009-02-22 14:36:18
|
Hello,
I tried to build a debug version of the current development sources
using mingw32.
The compiled version segfaults reproducably in mouse.c. Looking at the
code I see that the FPRINTF macro is missing stderr as target stream
diff -r cbcfbb8c12b7 src/mouse.c
--- a/src/mouse.c Sat Feb 21 18:22:30 2009 +0100
+++ b/src/mouse.c Sun Feb 22 15:28:11 2009 +0100
@@ -299,7 +299,7 @@
MousePosToGraphPosReal(int xx, int yy, double *x, double *y, double
*x2, double *y2)
{
if (!is_3d_plot) {
- FPRINTF(("POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
+ FPRINTF((stderr, "POS: plot_bounds.xleft=%i, plot_bounds.xright=%i,
plot_bounds.ybot=%i, plot_bounds.ytop=%i\n",
plot_bounds.xleft, plot_bounds.xright, plot_bounds.ybot,
plot_bounds.ytop));
if (plot_bounds.xright == plot_bounds.xleft)
@@ -314,7 +314,7 @@
*y = AXIS_MAPBACK(FIRST_Y_AXIS, yy);
*y2 = AXIS_MAPBACK(SECOND_Y_AXIS, yy);
}
- FPRINTF(("POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
+ FPRINTF((stderr, "POS: xx=%i, yy=%i => x=%g y=%g\n", xx, yy, *x, *y));
} else {
/* for 3D plots, we treat the mouse position as if it is
I also would suggest to add -DDEBUG to CFLAGS in makegile.mgw for a
debug-enabled build. Then one can issue simply
make -f config/makefile.mgw DEBUG=1
to generate a version with debugging enabled
diff -r cbcfbb8c12b7 config/makefile.mgw
--- a/config/makefile.mgw Sat Feb 21 18:22:30 2009 +0100
+++ b/config/makefile.mgw Sun Feb 22 15:28:11 2009 +0100
@@ -170,7 +170,7 @@
CP = cp -p
ifdef DEBUG
- CFLAGS += -g
+ CFLAGS += -g -DDEBUG
LDFLAGS += -g
else
CFLAGS += -O2
benjamin
|