diff -r 000000000000 -r 6474c204b198 js/src/gdb/tests/test-Root.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/gdb/tests/test-Root.cpp Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,34 @@ +#include "gdb-tests.h" +#include "jsapi.h" + +FRAGMENT(Root, null) { + JS::Rooted null(cx, nullptr); + + breakpoint(); + + (void) null; +} + +void callee(JS::Handle obj, JS::MutableHandle mutableObj) +{ + // Prevent the linker from unifying this function with others that are + // equivalent in machine code but not type. + fprintf(stderr, "Called " __FILE__ ":callee\n"); + breakpoint(); +} + +FRAGMENT(Root, handle) { + JS::Rooted global(cx, JS::CurrentGlobalOrNull(cx)); + callee(global, &global); + (void) global; +} + +FRAGMENT(Root, HeapSlot) { + JS::Rooted plinth(cx, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, "plinth"))); + JS::Rooted array(cx, JS_NewArrayObject(cx, plinth)); + + breakpoint(); + + (void) plinth; + (void) array; +}