Bug 626994. Improve debug logging. r=ehsan,a=b
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 09 Feb 2011 10:32:13 -0500
changeset 62252 d4ebf3b5162f753e3bb7fd0a81e0406dcb8ad83b
parent 62251 37e773ecc66f6a75b0e230149a5fb33297a4963b
child 62253 f03a3f52ea03efd4000f2f54cbb14bc4f03e9196
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersehsan, b
bugs626994
milestone2.0b12pre
Bug 626994. Improve debug logging. r=ehsan,a=b This fixes the type problem and adds a bit more debugging info.
gfx/cairo/cairo/src/cairo-spline.c
widget/src/xpwidgets/GfxInfoBase.cpp
--- a/gfx/cairo/cairo/src/cairo-spline.c
+++ b/gfx/cairo/cairo/src/cairo-spline.c
@@ -178,30 +178,33 @@ static double
     berr = bdx * bdx + bdy * bdy;
     cerr = cdx * cdx + cdy * cdy;
     if (berr > cerr)
 	return berr;
     else
 	return cerr;
 }
 
-void StoreSpline(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy);
-void CrashSpline();
+void StoreSpline(int ax, int ay, int bx, int by, int cx, double cy, int dx, int dy);
+void CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
 
 static cairo_status_t
 _cairo_spline_decompose_into (cairo_spline_knots_t *s1, double tolerance_squared, cairo_spline_t *result)
 {
     static int depth;
     cairo_spline_knots_t s2;
     cairo_status_t status;
 
     depth++;
 #ifdef MOZ_ENABLE_LIBXUL
     if (depth == 200) {
-        CrashSpline();
+        CrashSpline(tolerance_squared, s1->a.x, s1->a.y,
+                s1->b.x, s1->b.y,
+                s1->c.x, s1->c.y,
+                s1->d.x, s1->d.y);
     }
 #endif
 
     if (_cairo_spline_error_squared (s1) < tolerance_squared) {
         depth--;
 	return _cairo_spline_add_point (result, &s1->a);
     }
 
--- a/widget/src/xpwidgets/GfxInfoBase.cpp
+++ b/widget/src/xpwidgets/GfxInfoBase.cpp
@@ -57,66 +57,67 @@
 #include "nsIDOMNodeList.h"
 #include "nsTArray.h"
 
 #if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
 #include "nsExceptionHandler.h"
 #endif
 
 extern "C" {
-  void StoreSpline(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy);
-  void CrashSpline();
+  void StoreSpline(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
+  void CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
 }
 
-static double crash_ax;
-static double crash_ay;
-static double crash_bx;
-static double crash_by;
-static double crash_cx;
-static double crash_cy;
-static double crash_dx;
-static double crash_dy;
+static int crash_ax;
+static int crash_ay;
+static int crash_bx;
+static int crash_by;
+static int crash_cx;
+static int crash_cy;
+static int crash_dx;
+static int crash_dy;
 
 void
-StoreSpline(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) {
+StoreSpline(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
     crash_ax = ax;
     crash_ay = ay;
     crash_bx = bx;
     crash_by = by;
     crash_cx = cx;
     crash_cy = cy;
     crash_dx = dx;
     crash_dy = dy;
 }
 
 void
-CrashSpline() {
+CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
 #if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
   static bool annotated;
 
   if (!annotated) {
     nsCAutoString note;
 
     note.AppendPrintf("curve ");
-    note.AppendPrintf("%llx ", crash_ax);
-    note.AppendPrintf("%llx, ", crash_ay);
-    note.AppendPrintf("%llx ", crash_bx);
-    note.AppendPrintf("%llx, ", crash_by);
-    note.AppendPrintf("%llx ", crash_cx);
-    note.AppendPrintf("%llx, ", crash_cy);
-    note.AppendPrintf("%llx ", crash_dx);
-    note.AppendPrintf("%llx\n", crash_dy);
-    note.AppendPrintf("crv-f: %f ", crash_ax);
-    note.AppendPrintf("%f, ", crash_ay);
-    note.AppendPrintf("%f ", crash_bx);
-    note.AppendPrintf("%f, ", crash_by);
-    note.AppendPrintf("%f ", crash_cx);
-    note.AppendPrintf("%f, ", crash_cy);
-    note.AppendPrintf("%f ", crash_dx);
-    note.AppendPrintf("%f\n", crash_dy);
+    note.AppendPrintf("%x ", crash_ax);
+    note.AppendPrintf("%x, ", crash_ay);
+    note.AppendPrintf("%x ", crash_bx);
+    note.AppendPrintf("%x, ", crash_by);
+    note.AppendPrintf("%x ", crash_cx);
+    note.AppendPrintf("%x, ", crash_cy);
+    note.AppendPrintf("%x ", crash_dx);
+    note.AppendPrintf("%x\n", crash_dy);
+    note.AppendPrintf("crv-crash(%f): ", tolerance);
+    note.AppendPrintf("%x ", ax);
+    note.AppendPrintf("%x, ", ay);
+    note.AppendPrintf("%x ", bx);
+    note.AppendPrintf("%x, ", by);
+    note.AppendPrintf("%x ", cx);
+    note.AppendPrintf("%x, ", cy);
+    note.AppendPrintf("%x ", dx);
+    note.AppendPrintf("%x\n", dy);
 
     CrashReporter::AppendAppNotesToCrashReport(note);
     annotated = true;
   }
 #endif
 }