Cosmetic fixes & comments
This commit is contained in:
parent
70a79a9e05
commit
ebc6474668
4 changed files with 19 additions and 11 deletions
|
|
@ -97,10 +97,14 @@ extern {}
|
|||
extern "C" {
|
||||
// iOS on armv7 uses SjLj exceptions and requires to link
|
||||
// agains corresponding routine (..._SjLj_...)
|
||||
// So here we just skip linking for iOS
|
||||
#[cfg(not(target_os = "ios", target_arch = "arm"))]
|
||||
pub fn _Unwind_RaiseException(exception: *_Unwind_Exception)
|
||||
-> _Unwind_Reason_Code;
|
||||
-> _Unwind_Reason_Code;
|
||||
|
||||
#[cfg(target_os = "ios", target_arch = "arm")]
|
||||
fn _Unwind_SjLj_RaiseException(e: *_Unwind_Exception)
|
||||
-> _Unwind_Reason_Code;
|
||||
|
||||
pub fn _Unwind_DeleteException(exception: *_Unwind_Exception);
|
||||
}
|
||||
|
||||
|
|
@ -111,9 +115,5 @@ extern "C" {
|
|||
#[inline(always)]
|
||||
pub unsafe fn _Unwind_RaiseException(exc: *_Unwind_Exception)
|
||||
-> _Unwind_Reason_Code {
|
||||
extern "C" {
|
||||
fn _Unwind_SjLj_RaiseException(e: *_Unwind_Exception)
|
||||
-> _Unwind_Reason_Code; }
|
||||
|
||||
_Unwind_SjLj_RaiseException(exc)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,7 +303,6 @@ pub mod eabi {
|
|||
use libc::c_int;
|
||||
|
||||
extern "C" {
|
||||
#[cfg(target_os = "ios", target_arch = "arm")]
|
||||
fn __gcc_personality_sj0(version: c_int,
|
||||
actions: uw::_Unwind_Action,
|
||||
exception_class: uw::_Unwind_Exception_Class,
|
||||
|
|
|
|||
|
|
@ -248,6 +248,11 @@ mod imp {
|
|||
/// _Unwind_Backtrace is even not available there. Still,
|
||||
/// backtraces could be extracted using a backtrace function,
|
||||
/// which thanks god is public
|
||||
///
|
||||
/// As mentioned in a huge comment block above, backtrace doesn't
|
||||
/// play well with green threads, so while it is extremely nice
|
||||
/// and simple to use it should be used only on iOS devices as the
|
||||
/// only viable option.
|
||||
#[cfg(target_os = "ios", target_arch = "arm")]
|
||||
#[inline(never)]
|
||||
pub fn write(w: &mut Writer) -> IoResult<()> {
|
||||
|
|
@ -267,9 +272,9 @@ mod imp {
|
|||
|
||||
try!(writeln!(w, "stack backtrace:"));
|
||||
// 100 lines should be enough
|
||||
static size: libc::c_int = 100;
|
||||
let mut buf: [*libc::c_void, ..size] = unsafe {mem::zeroed()};
|
||||
let cnt = unsafe { backtrace(buf.as_mut_ptr(), size) as uint};
|
||||
static SIZE: libc::c_int = 100;
|
||||
let mut buf: [*libc::c_void, ..SIZE] = unsafe {mem::zeroed()};
|
||||
let cnt = unsafe { backtrace(buf.as_mut_ptr(), SIZE) as uint};
|
||||
|
||||
// skipping the first one as it is write itself
|
||||
result::fold_(range(1, cnt).map(|i| {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
// Do not compile anything here for iOS
|
||||
// Do not compile anything here for iOS because split stacks
|
||||
// are disabled at all and do not need any runtime support.
|
||||
//
|
||||
// See also comments in librustrt/stack.rs about why it was
|
||||
// disabled and how it could be implemented in case of need.
|
||||
#if !defined(__APPLE__)
|
||||
// Mark stack as non-executable
|
||||
#if defined(__linux__) && defined(__ELF__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue