Skip to content

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

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

Closed
wants to merge 7 commits into from
Closed

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

wants to merge 7 commits into from

Conversation

bleibig
Copy link
Contributor

@bleibig bleibig commented Apr 10, 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 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
Contributor

brson commented Apr 16, 2013

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
Copy link
Contributor

jdm commented Apr 17, 2013

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

@brson
Copy link
Contributor

brson commented Apr 18, 2013

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.
@bors bors 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.
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

Successfully merging this pull request may close these issues.

4 participants