Last active
August 29, 2015 13:57
-
-
Save derwolfe/9883237 to your computer and use it in GitHub Desktop.
gdb/rust symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) set verbose | |
(gdb) b main | |
Breakpoint 1 at 0x100000e70 | |
(gdb) r foo.rs --out-dir ./bar/baz | |
Starting program: /Users/chris/Code/rust/x86_64-apple-darwin/stage1/bin/rustc foo.rs --out-dir ./bar/baz | |
warning: platform-specific solib_create_inferior_hook did not load initial shared libraries. | |
# this is on os x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gdb commands -- run from ~/Code/rust | |
# the rlib for rustc located at /.x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/librustc.... | |
# has been untarred into /.x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/test | |
(gdb) exec-file ./x86_64-apple-darwin/stage1/bin/rustc | |
(gdb) symbol-file /.x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/test/rustc.o | |
(gdb) run ./src/test/run-make/com_test/foo.rs --out-dir ./bar/baz | |
# when this is run I'm able to set breakpoints on the using the symbols from rustc.o, however, | |
#it looks like gdb can't actually use them, e.g. | |
(gdb) b rustc::back::link::WriteOutputFile | |
Cannot access memory at address 0x6d2af0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/15871885/how-to-debug-rust-programs