Backed out changeset 8c9117de1e7f (bug 1300152)
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
function run_test()
|
||||
{
|
||||
// Try crashing with a Rust panic
|
||||
do_crash(function() {
|
||||
Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).rustPanic("OH NO");
|
||||
},
|
||||
function(mdump, extra) {
|
||||
//TODO: check some extra things?
|
||||
},
|
||||
// process will exit with a zero exit status
|
||||
true);
|
||||
}
|
||||
@@ -9,8 +9,6 @@ support-files =
|
||||
[test_crash_moz_crash.js]
|
||||
[test_crash_purevirtual.js]
|
||||
[test_crash_runtimeabort.js]
|
||||
[test_crash_rust_panic.js]
|
||||
skip-if = !rust
|
||||
[test_crash_after_js_oom_reported.js]
|
||||
[test_crash_after_js_oom_recovered.js]
|
||||
[test_crash_after_js_oom_reported_2.js]
|
||||
|
||||
@@ -3,12 +3,3 @@
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
extern crate mp4parse_capi;
|
||||
|
||||
use std::ffi::CStr;
|
||||
use std::os::raw::c_char;
|
||||
|
||||
/// Used to implement `nsIDebug2::RustPanic` for testing purposes.
|
||||
#[no_mangle]
|
||||
pub extern fn intentional_panic(message: *const c_char) {
|
||||
panic!("{}", unsafe { CStr::from_ptr(message) }.to_string_lossy());
|
||||
}
|
||||
|
||||
@@ -157,6 +157,3 @@ LOCAL_INCLUDES += [
|
||||
|
||||
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
|
||||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||
|
||||
if CONFIG['MOZ_RUST']:
|
||||
DEFINES['MOZ_RUST'] = True
|
||||
|
||||
@@ -147,22 +147,6 @@ nsDebugImpl::Abort(const char* aFile, int32_t aLine)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_RUST
|
||||
// From toolkit/library/rust/lib.rs
|
||||
extern "C" void intentional_panic(const char* message);
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDebugImpl::RustPanic(const char* aMessage)
|
||||
{
|
||||
#ifdef MOZ_RUST
|
||||
intentional_panic(aMessage);
|
||||
return NS_OK;
|
||||
#else
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDebugImpl::GetIsDebugBuild(bool* aResult)
|
||||
{
|
||||
|
||||
@@ -79,11 +79,4 @@ interface nsIDebug2 : nsISupports
|
||||
*/
|
||||
void abort(in string aFile,
|
||||
in long aLine);
|
||||
|
||||
/**
|
||||
* Request the process to trigger a fatal panic!() from Rust code.
|
||||
*
|
||||
* @param aMessage the string to pass to panic!().
|
||||
*/
|
||||
void rustPanic(in string aMessage);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user