Bug 840319: Keep js/src/gdb/gdb-tests.cpp's 'breakpoint' function from being unified with other functions in SM. r=sfink
authorJim Blandy <jimb@mozilla.com>
Tue, 12 Feb 2013 11:55:00 -0800
changeset 121636 4ed4f90669b584635ff3e2aa75856f653c11e048
parent 121635 0ea5aa0db57211222b43fd625b11d39cb633c349
child 121645 d388b8073cce4ab68914382332de9700574e3802
push id22842
push userjblandy@mozilla.com
push dateTue, 12 Feb 2013 19:59:06 +0000
treeherdermozilla-inbound@4ed4f90669b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs840319
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 840319: Keep js/src/gdb/gdb-tests.cpp's 'breakpoint' function from being unified with other functions in SM. r=sfink
js/src/gdb/gdb-tests.cpp
--- a/js/src/gdb/gdb-tests.cpp
+++ b/js/src/gdb/gdb-tests.cpp
@@ -39,17 +39,23 @@ void reportError(JSContext *cx, const ch
     fprintf(stderr, "%s:%u: %s\n",
             report->filename ? report->filename : "<no filename>",
             (unsigned int) report->lineno,
             message);
 }
 
 // prolog.py sets a breakpoint on this function; test functions can call it
 // to easily return control to GDB where desired.
-void breakpoint() {}
+void breakpoint() {
+    // If we leave this function empty, the linker will unify it with other
+    // empty functions throughout SpiderMonkey. If we then set a GDB
+    // breakpoint on it, that breakpoint will hit at all sorts of random
+    // times. So make it perform a distinctive side effect.
+    fprintf(stderr, "Called " __FILE__ ":breakpoint\n");
+}
 
 GDBFragment *GDBFragment::allFragments = NULL;
 
 int
 main (int argc, const char **argv)
 {
     JSRuntime *runtime = checkPtr(JS_NewRuntime(1024 * 1024, JS_USE_HELPER_THREADS));
     JS_SetGCParameter(runtime, JSGC_MAX_BYTES, 0xffffffff);