[rust-dev] Debugging (rust 0.9) in Ubuntu via GDB

Artella Coding artella.coding at googlemail.com
Sun Jan 12 15:13:53 PST 2014


Suppose I have the following program :

**********************************************
//prog1.rs
use std::rand::{task_rng, Rng};

fn main() {
    let names = ["Alice", "Bob", "Carol"];
    for name in names.iter() {
        let v = task_rng().shuffle(~[1,2,3]);
        for num in v.iter() {
            println!("{:s} says: {:d}", *name, *num);
        }
    }
}
**********************************************

In previous versions of rust it was possible to put
a breakpoint on "shuffle"  e.g.

One would first compile via :

rustc -Z debug-info prog1.rs

and then one could proceed to put a breakpoint on "shuffle" :

gdb ./prog1
(gdb) break shuffle
(gdb) run

However now it doesn't seem possible to put a breakpoint on shuffle. Why is
this? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140112/ecade730/attachment-0001.html>


More information about the Rust-dev mailing list