title: How to make cargo enter the correct path to source files of stdlib while adding debuginfo to exectuable
body: <p>I am debugging a rust program but whenever I try to step into any standard library function, gdb (or lldb) can't find stdlib source files, giving error like this:</p>
  
  <pre><code>/rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libcore/slice/mod.rs: No such file or directory.
  </code></pre>
  
  <p>Steps to reproduce:</p>
  
  <pre><code>cargo new test
  </code></pre>
  
  <p>test/src/main.rs:</p>
  
  <pre><code>fn main() {
      let a:Vec&lt;char&gt; = Vec::new();
  }
  </code></pre>
  
  <pre><code>$ cd test
  $ cargo build
  $ rust-gdb target/debug/test
  
  ...
  
  (gdb) b main.rs:1
  Breakpoint 1 at 0x4a04: file src/main.rs, line 2.
  
  (gdb) r
  Starting program: /home/xyz/code/rust/test/target/debug/test 
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  
  Breakpoint 1, test::main () at src/main.rs:2
  2           let a: Vec&lt;i32&gt; = Vec::new();
  
  (gdb) s
  alloc::vec::Vec&lt;T&gt;::new ()
      at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/liballoc/vec.rs:318
  318     /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/liballoc/vec.rs: No such file or directory.
  
  </code></pre>