-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Parameterized struct doesn't get debug symbols for any of its methods #22226
Comments
Does |
This is on OS X, actually. gdb version is 7.8.1. |
Any suggestions on how to run dwarfdump on an rlib? Looks like I may also need to build the corresponding llvm-dwarfdump to the version Rust is using, too. |
Actually, the stock OS X dwarfdump shows a lot of output on the object file I was able to extract from the rlib using |
That's the function I was trying to break in. Maybe it's a problem due to the parameterization of Constellation? http://mxr.mozilla.org/servo/source/components/compositing/constellation.rs#344 |
Yeah, the space in the linkage name looks like trouble. But it's still strange that you can't break anywhere. |
It appears that every method of Constellation has no corresponding subprogram, and it's only when trying to set breakpoints inside of them that gdb claims that constellation.rs isn't recognised. Setting breakpoints inside functions that are known (like the NavigationContext ones) works fine. |
Oh, wait, these are all generic methods then, right? Is there any chance that you are trying to break in an inlined version of such a method, i.e. the concrete method body got instantiated in another crate? |
http://mxr.mozilla.org/servo/source/components/compositing/constellation.rs#804 looks big enough that I wouldn't expect it to be inlined. Additionally, the method is only generic over the enclosing struct types; it doesn't have any of its own type parameters. |
The question is: Where is the method called from? If it's called from another crate then this would be a duplicate of #19228. That the type parameters are on the |
It's called from Constellation::handle_request, which is called from Constellation::run, which is called from Constellation::start, which is called from the |
That seems consistent with my theory: The Constellation methods will only be instantiated in the servo crate, where span information on them is not available anymore. PR #22235 will hopefully fix this. |
…oerister This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, positions of line-beginnings, etc. but not the actual source code itself. Crate metadata size is increased by this change because spans in the encoded ASTs take up space now: ``` BEFORE AFTER libcore 36 MiB 39.6 MiB +10% libsyntax 51.1 MiB 60.5 MiB +18.4% libcollections 11.2 MiB 12.8 MiB +14.3% ``` This only affects binaries containing metadata (rlibs and dylibs), executables should not be affected in size. Fixes #19228 and probably #22226.
Please give this another try, now that #22235 has landed. |
I've set breakpoints in these methods since the fix landed, so I claim this works now :) |
Sorry, the best testcase I have right now is Servo master. If you run the binary under gdb and try to break anywhere in the
compositing
crate, the symbols just don't exist. You can't break by filename either. You can break on mangled symbols, but there are no source positions. Other crates (likescript
, for example) work perfectly fine.The text was updated successfully, but these errors were encountered: