I'd like to be able to save a javascript stack trace to a file from within Drosera. Ideally it would show me the function body as well as the function name.
<rdar://problem/5645672>
Created attachment 18857 [details] enable webkit to save javascript trace from inspector window changes are done in 1. inspector.html/inspector.js - to add the check box to toggle the functionlity 2. InspectorController.cpp/InspectorController.h - to save the log
Created attachment 18863 [details] patch that saves the JS trace to file
(In reply to comment #0) > I'd like to be able to save a javascript stack trace to a file from within > Drosera. Ideally it would show me the function body as well as the function > name. > the saving function is there in JavaScriptCore/kjs/function.cpp. Currently these changes are integrated with the Inspector window. This can also be done from Drosera.
Comment on attachment 18857 [details] enable webkit to save javascript trace from inspector window Thanks for the patch! Patches need to be marked r? in order to be reviewed. You need to explain the changes you made in your ChangeLog. You should also set the CHANGE_LOG_NAME and CHANGE_LOG_EMAIL_ADDRESS environment variables so that prepare-ChangeLog will generate a correct ChangeLog header. This patch puts a lot of CoreFoundation-specific code into a cross-platform source file, InspectorController.cpp. We should be using WebCore's cross-platform functions/types instead. We don't normally put in comments referencing the bug report that motivated the addition of the code. I think this feature would make a lot more sense in the Inspector if we had an integrated JavaScript debugger (see bug 17134). Until then it makes more sense in Drosera. We probably want to present a file picker to the user so that they can choose where to save the file instead of saving to an arbitrary file in a Mac-specific location (we want this to work on non-Mac platforms as well). Please read our code style guidelines at <http://webkit.org/coding/coding-style.html> and make sure your code conforms to them.
Comment on attachment 18863 [details] patch that saves the JS trace to file I'm not sure we want to save the stack trace for every function that's called. That seems a bit overkill. And the user of environment variables to set the location seems rather fragile.
I am not sure this is needed once we have console.trace() (bug 14354) and fast in-process debugging (bug 17134, bug 17770, bug 17778).
This also sounds like functionality a JavaScript profiler would provide. We are in the process of adding a profiler.