Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source viewer problem #90

Open
peter7891 opened this issue Aug 8, 2023 · 5 comments
Open

source viewer problem #90

peter7891 opened this issue Aug 8, 2023 · 5 comments

Comments

@peter7891
Copy link

peter7891 commented Aug 8, 2023

Hello,

I have the problem where the source viewer only works for main.rs and any other code is unavailable.

1.36 s   99.8%	0 s	 	           foo_rs::main::he70bb0403010c57b
1.36 s   99.4%	540.00 ms	 	          vm::VM::run::h17ad8734cf0cc68c
1.00 ms    0.0%	1.00 ms	 	          _$LT$vm..Object$u20$as$u20$core..clone..Clone$GT$::clone::h54aee501194c726f
1.00 ms    0.0%	1.00 ms	 	          core::option::Option$LT$T$GT$::expect::hbe2c0641a3e2d7e0
1.00 ms    0.0%	1.00 ms	 	          core::slice::_$LT$impl$u20$$u5b$T$u5d$$GT$::get::h5d5c173e759664a6
1.00 ms    0.0%	1.00 ms	 	          alloc::vec::Vec$LT$T$C$A$GT$::push::hf5b5c1b6053794b4
1.00 ms    0.0%	1.00 ms	 	          core::option::Option$LT$T$GT$::expect::h21b34825060683ed

The error is can't find source code for selected symbol

@peter7891
Copy link
Author

I tried this with one of my other projects, it works for the other project but not this one.
This is very weird.

@peter7891
Copy link
Author

The only difference between the 2 projects is, the one that is not working is a workspace with multiple crates.

@cmyr
Copy link
Owner

cmyr commented Sep 12, 2023

to be honest I'm really not sure how this feature works; I imagine that the debug symbols for the binary include a source map, and maybe the paths are wrong in the context of a workspace?

@evmar
Copy link

evmar commented Oct 3, 2024

This thread on the same problem has a comment from 2018 saying "It appears the AT_decl_file entries for C++ code have absolute pathnames while the entries for Rust have relative pathnames."

Someone more recently said that running dsymutil fixed it, but it didn't for me.

@evmar
Copy link

evmar commented Oct 3, 2024

After running dsymutil, in Instruments picking File -> Symbols, then Add Symbols (in the top middle of the window) -> Individual symbols, then the dsym file found at like target/release/mybinary.dSYM made the source show!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants