Skip to content

Add debug info for boxes, vectors, and strings - #5824

Closed
bleibig wants to merge 7 commits into
rust-lang:incomingfrom
bleibig:debuginfo
Closed

Add debug info for boxes, vectors, and strings#5824
bleibig wants to merge 7 commits into
rust-lang:incomingfrom
bleibig:debuginfo

Conversation

@bleibig

Copy link
Copy Markdown
Contributor

This adds debugging symbol generation for boxes, bare functions, vectors, and strings, along with a tests for boxes and vectors.

Note that gdb will see them as their actual compiled representation with the refcount, tydesc, etc. fields, so if b refers to box, b->boxed will refer to its value. Also, since you seem to use the C struct hack for dynamic vectors, you won't be able to print out the whole vector at once, only one element at a time by indexing specific elements.

@brson

Copy link
Copy Markdown
Contributor

I don't know much about this area but r+ed this to see what happens. I'm guessing it will bounce off the bots after the llvm upgrade. @jdm are you ok with merging this despite your previous comment?

@jdm

jdm commented Apr 17, 2013

Copy link
Copy Markdown
Contributor

Sure. We can file a follow up about filling out the tests.

@brson

Copy link
Copy Markdown
Contributor

Ah, I didn't read closely enough that there were missing tests (even though that's exactly what you said). Would be good to have them.

bors added a commit that referenced this pull request Apr 19, 2013
This adds debugging symbol generation for boxes, bare functions, vectors, and strings, along with a tests for boxes and vectors.
Note that gdb will see them as their actual compiled representation with the refcount, tydesc, etc. fields, so if `b` refers to box, `b->boxed` will refer to its value. Also, since you seem to use the [C struct hack](http://c-faq.com/struct/structhack.html) for dynamic vectors, you won't be able to print out the whole vector at once, only one element at a time by indexing specific elements.
@borsbors closed this Apr 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 26, 2020
…arth
Ignore not really redundant clones of ManuallyDrop
"Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of
invoking the clone, without running the drop implementation of the inner type.
In other words, they aren't really redundant. For example, futures-rs crate:
```rust
#[allow(clippy::redundant_clone)] // The clone here isn't actually redundant.
unsafe fn increase_refcount<T: ArcWake>(data: *const ()) {
// Retain Arc, but don't touch refcount by wrapping in ManuallyDrop
let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T));
// Now increase refcount, but don't drop new refcount either
let _arc_clone: mem::ManuallyDrop<_> = arc.clone();
}
```
changelog: Ignore redundant clone lint for ManuallyDrop.
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
5824: Optimize reference search
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@bleibig@brson@jdm@bors