Add std.dbg.trap(str msg) for help debugging.
This commit is contained in:
parent
065542378c
commit
c0d4e88428
@ -18,6 +18,7 @@ native "rust" mod rustrt {
|
||||
fn debug_obj[T](&T x, uint nmethods, uint nbytes);
|
||||
fn debug_fn[T](&T x);
|
||||
fn debug_ptrcast[T, U](@T x) -> @U;
|
||||
fn debug_trap(str msg);
|
||||
}
|
||||
|
||||
fn debug_vec[T](vec[T] v) {
|
||||
@ -61,6 +62,10 @@ fn ptr_cast[T, U](@T x) -> @U {
|
||||
ret rustrt.debug_ptrcast[T, U](x);
|
||||
}
|
||||
|
||||
fn trap(str s) {
|
||||
rustrt.debug_trap(s);
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// mode: rust;
|
||||
// fill-column: 78;
|
||||
|
@ -363,6 +363,14 @@ debug_ptrcast(rust_task *task,
|
||||
return ptr;
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
debug_trap(rust_task *task, rust_str *s)
|
||||
{
|
||||
task->log(rust_log::STDLIB, "trapping: %s", s->data);
|
||||
// FIXME: x86-ism.
|
||||
__asm__("int3");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Local Variables:
|
||||
|
Loading…
Reference in New Issue
Block a user