Skip to content

Instantly share code, notes, and snippets.

View luqmana's full-sized avatar

Luqman Aden luqmana

View GitHub Profile
-> % gdb --args x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg stage2 -O --cfg debug -Z no-debug-borrows --target=arm-linux-androideabi --android-cross-path=/scratch/laden/android-dev/standalone -D warnings --out-dir x86_64-unknown-linux-gnu/stage2/lib/rustc/arm-linux-androideabi/lib /scratch/laden/rust/src/libstd/std.rs GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/scratch/laden/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc...(no debugging symbols found)...done.
laden@corn-syrup [06:23:13] [/scratch/laden/rust/build] [issue-3678-wrappers-be-gone-2]
-> % RUST_LOG=rustc=1,rustc::middle::trans::foreign x86_64-unknown-linux-gnu/stage2/bin/rustc --cfg stage2 -O --cfg debug -Z no-debug-borrows --target=arm-linux-androideabi --android-cross-path=/scratch/laden/android-dev/standalone -D warnings --out-dir x86_64-unknown-linux-gnu/stage2/lib/rustc/arm-linux-androideabi/lib /scratch/laden/rust/src/libstd/std.rs
foo.rs:10:6: 10:7 warning: unused variable: `x` [-W unused-variable (default)]
foo.rs:10 fn mm(x: &TestNode) {}
^
rust: ~"add_clean([block 7fcfe42937b0], **{i64, *tydesc, *i8, *i8, {*{i64, *tydesc, *i8, *i8, {i64, i64, [i8 x 0]}}, *{i64, *tydesc, *i8, *i8, {i64, i64, [i8 x 0]}}, *{i64, *tydesc, *i8, *i8, {i64, i64, [{*{i64, *tydesc, *i8, *i8, {*{i64, *tydesc, *i8, *i8, {i64, i64, [i8 x 0]}}, *{i64, *tydesc, *i8, *i8, {i64, i64, [i8 x 0]}}, *{i64, *tydesc, *i8, *i8, {i64, i64, [{*{i64, *tydesc, *i8, *i8, {*{i64, *tydesc, *i8, *i8, {i64, i64, [i8 x 0]}},
~"register_foreign_item_fn(abis=\"C\", path=[cmath, c_float_utils, ceil], foreign_item.id=153330)"
~"trans_native_call(callee_ty=extern \"C\" unsafe fn(f32) -> f32, llfn=*fn(Float) -> Float, llretptr=*Float)"
~"argument 0, llarg_rust=Float, rust_indirect=false, arg_ty=Float"
~"llarg_rust=*Float (after indirection)"
~"llarg_rust=*Float (after casting)"
~"argument 0, llarg_foreign=Float"
~"llretptr=*Float"
~"llforeign_retval=Float"
~"llrust_ret_ty=Float"
~"llforeign_ret_ty=Float"
@luqmana
luqmana / rj.rs
Last active December 21, 2015 06:28
extern mod sdl;
use std::libc::{c_int, c_void};
use std::rt::comm;
use std::rt::io::extensions::*;
use std::rt::io::io_error;
use std::rt::io::net::ip::{IpAddr, Ipv4Addr, Port, SocketAddr};
use std::rt::io::net::tcp::TcpStream;
use std::task;
use std::vec;
#[simd]
struct F(f32, f32);
static A: F = F(2.0, 3.5);
fn main() {
}
@luqmana
luqmana / foo.c
Created September 19, 2013 18:58
extern int foobar __attribute__((weak));
int main(int argc, char *argv[]) {
return foobar;
}
@luqmana
luqmana / build
Last active December 24, 2015 05:09
-> % rustc foo.rs --lib -Z extra-debug-info
-> % ls
foo.c foo.rs libfoo-102129e09d96658-0.0.so
-> % gcc foo.c -g -L. -lfoo-102129e09d96658-0.0 -o foo
-> % LD_LIBRARY_PATH=. ./foo
[1] 30770 segmentation fault LD_LIBRARY_PATH=. ./foo
@luqmana
luqmana / rotl.rs
Last active December 27, 2015 21:09
#![feature(asm, macro_rules)]
use std::mem;
fn rotl(val: u64, shift: u8) -> u64 {
let sz = mem::size_of_val(&val);
(val << shift) | (val >> (sz * 8 - shift as uint))
}
// This code can be compiled in 3 modes:
// rustc --cfg find
// rustc --cfg interactive
// rustc --cfg oracle
//
// The interactive mode is based on the
// crib dragging technique described by
// Dan Crowley at:
// https://www.trustwave.com/Resources/SpiderLabs-Blog/The-Way-of-the-Cryptologist/