Skip to content

Instantly share code, notes, and snippets.

@espadrine
Created January 1, 2019 12:30
Show Gist options
  • Save espadrine/f6244e0211e3e8fbf9a44265e2b487a8 to your computer and use it in GitHub Desktop.
Save espadrine/f6244e0211e3e8fbf9a44265e2b487a8 to your computer and use it in GitHub Desktop.
Trying to use rr for debugging https://github.com/espadrine/tree-array
$ rr record cargo test
rr: Saving execution to trace directory `/home/tyl/.local/share/rr/cargo-4'.
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running target/debug/deps/bench_insert-8cb017bd9e593f1f
running 5 tests
test tests::bench_insert_list ... ok
test tests::bench_insert_vec ... ok
test tests::test_insert_list ... ok
test tests::test_insert_tree_array ... FAILED
test tests::test_insert_vec ... ok
failures:
---- tests::test_insert_tree_array stdout ----
tree: [2 size=2] left=([1 size=1] left=(nil) right=(nil)) right=(nil)
tree: [1 size=1] left=(nil) right=([2 size=0] left=(nil) right=(nil))
thread 'tests::test_insert_tree_array' panicked at 'assertion failed: `(left == right)`
left: `1`,
right: `2`', src/lib.rs:81:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failures:
tests::test_insert_tree_array
test result: FAILED. 4 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--lib'
$ rr replay
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/tyl/.local/share/rr/cargo-4/mmap_hardlink_3_cargo...done.
Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal]
Remote debugging using 127.0.0.1:19780
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.27.so...done.
done.
0x00007f5c5acb0090 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) break tree_array.rs:277
No source file named tree_array.rs.
Make breakpoint pending on future shared library load? (y or [n])
(rr) c
Continuing.
Program stopped.
0x0000000070000002 in ?? ()
(rr) p node.to_str()
A syntax error in expression, near `.to_str()'.
(rr) p node
Attempt to use a type name as an expression
(rr) p node_size
No symbol "node_size" in current context.
(rr) l
1 <built-in>: No such file or directory.
(rr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment