pub struct Scope {
pub parent: Option<usize>,
pub over: Vec<Reach>,
}Expand description
One inner scope of a function, which is a { ... } the program declared something in.
A function’s own body is not one of these. It is the subprogram, and a local written straight into it is a child of the subprogram, so the scopes are the ones written inside that.
What they are for is the question of which i a debugger means. A function with two blocks that
each declare one has two variables of that name, and with every local a child of the subprogram
a reader has no way to tell which of them is in scope at the address it stopped at. Nesting the
entries and saying which addresses each nest covers is the answer DWARF has for that, and it is
the only thing here that is about a scope rather than about a variable.
Fields§
§parent: Option<usize>Which scope this one is written inside, and None for one written directly in the body of
the function.
Always an earlier entry than this one, since a scope is opened before anything written in it is reached, which is what lets a reader build the tree in one pass.
over: Vec<Reach>The stretches of the function’s addresses the code written inside it ended up at.
Empty for a scope whose code all went away, which is a scope that still says which names it held and says nothing about where they were.
Trait Implementations§
impl Eq for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.