This is especially useful when we need to know the pid of an instance of jsc in the foreground that we're trying to attach a debugger to while the JSC tests are running in the background with a gazillion other jsc processes live at the same time.
Created attachment 291730 [details] proposed patch.
Comment on attachment 291730 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=291730&action=review Test that it returns a non-0 and non-1 integer? > Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp:416 > + return JSValue::encode(JSValue(getpid())); Does that work on Windows? Docs say deprecated, but I don't see why they'd remove it.
(In reply to comment #2) > Comment on attachment 291730 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=291730&action=review > > Test that it returns a non-0 and non-1 integer? I don't think it matters. This is just a debugging tool, and we just want whatever int value getpid() returns. > > Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp:416 > > + return JSValue::encode(JSValue(getpid())); > > Does that work on Windows? Docs say deprecated, but I don't see why they'd > remove it. Good catch. Let me fix.
Created attachment 291731 [details] proposed patch.
(In reply to comment #3) > (In reply to comment #2) > > Comment on attachment 291730 [details] > > proposed patch. > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=291730&action=review > > > > Test that it returns a non-0 and non-1 integer? > > I don't think it matters. This is just a debugging tool, and we just want > whatever int value getpid() returns. Yeah but broken debugging is worst debugging. Unlikely to fail given the posix spec, but getting just 0 is really annoying. I don't care much about it, just seems weird, so lgtm either way.
Comment on attachment 291731 [details] proposed patch. r=me
Comment on attachment 291731 [details] proposed patch. Clearing flags on attachment: 291731 Committed r207387: <http://trac.webkit.org/changeset/207387>
All reviewed patches have been landed. Closing bug.