Skip to content

Instantly share code, notes, and snippets.

@derwolfe
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derwolfe/9883237 to your computer and use it in GitHub Desktop.
Save derwolfe/9883237 to your computer and use it in GitHub Desktop.
gdb/rust symbols
(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
#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
@derwolfe
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment