This article covers features introduced in SpiderMonkey 1.8
Set debugging information about the next thing to be traced by a JSTracer
.
JS_SET_TRACING_DETAILS(trc, printer, arg, index)
Name | Type | Description |
---|---|---|
trc | JSTracer * | The tracer whose debugging hooks are to be set. |
printer | JSTraceNamePrinter | A callback function, described below; or NULL . |
arg | void * | See the description. |
index | size_t | See the description. |
typedef void (*JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);
Name | Type | Description |
---|---|---|
trc | JSTracer * | The tracer. |
buf | char * | Out parameter. The callback stores a string describing the reference traced in buf . |
bufsize | size_t | The size of buf , in char s. |
Set debugging information about a reference to a traceable thing to prepare for the following call to JS_CallTracer
.
When printer
is null, arg
must be const char *
or char *
C string naming the reference and index must be either (size_t)-1
indicating that the name alone describes the reference or it must be an index into some array vector that stores the reference.
When printer
is not null, the arg
and index
arguments are available to the callback as the debugPrinterArg
and debugPrintIndex
fields of trc
.
The storage for name
or callback
's arguments needs to live only until the following call to JS_CallTracer
returns.