1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
use crate::{lldb_addr_t, sys, DescriptionLevel, SBAddress, SBBreakpoint, SBStream};
use std::fmt;
pub struct SBBreakpointLocation {
    
    pub raw: sys::SBBreakpointLocationRef,
}
impl SBBreakpointLocation {
    
    pub fn maybe_wrap(raw: sys::SBBreakpointLocationRef) -> Option<SBBreakpointLocation> {
        if unsafe { sys::SBBreakpointLocationIsValid(raw) } {
            Some(SBBreakpointLocation { raw })
        } else {
            None
        }
    }
    
    pub fn is_valid(&self) -> bool {
        unsafe { sys::SBBreakpointLocationIsValid(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn id(&self) -> i32 {
        unsafe { sys::SBBreakpointLocationGetID(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn address(&self) -> Option<SBAddress> {
        SBAddress::maybe_wrap(unsafe { sys::SBBreakpointLocationGetAddress(self.raw) })
    }
    #[allow(missing_docs)]
    pub fn load_address(&self) -> lldb_addr_t {
        unsafe { sys::SBBreakpointLocationGetLoadAddress(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn is_enabled(&self) -> bool {
        unsafe { sys::SBBreakpointLocationIsEnabled(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn set_enabled(&self, enabled: bool) {
        unsafe { sys::SBBreakpointLocationSetEnabled(self.raw, enabled) }
    }
    #[allow(missing_docs)]
    pub fn hit_count(&self) -> u32 {
        unsafe { sys::SBBreakpointLocationGetHitCount(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn ignore_count(&self) -> u32 {
        unsafe { sys::SBBreakpointLocationGetIgnoreCount(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn set_ignore_count(&self, count: u32) {
        unsafe { sys::SBBreakpointLocationSetIgnoreCount(self.raw, count) }
    }
    #[allow(missing_docs)]
    pub fn is_resolved(&self) -> bool {
        unsafe { sys::SBBreakpointLocationIsResolved(self.raw) }
    }
    #[allow(missing_docs)]
    pub fn breakpoint(&self) -> SBBreakpoint {
        SBBreakpoint::from(unsafe { sys::SBBreakpointLocationGetBreakpoint(self.raw) })
    }
}
impl Clone for SBBreakpointLocation {
    fn clone(&self) -> SBBreakpointLocation {
        SBBreakpointLocation {
            raw: unsafe { sys::CloneSBBreakpointLocation(self.raw) },
        }
    }
}
impl fmt::Debug for SBBreakpointLocation {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        let stream = SBStream::new();
        unsafe {
            sys::SBBreakpointLocationGetDescription(self.raw, stream.raw, DescriptionLevel::Brief)
        };
        write!(fmt, "SBBreakpointLocation {{ {} }}", stream.data())
    }
}
impl Drop for SBBreakpointLocation {
    fn drop(&mut self) {
        unsafe { sys::DisposeSBBreakpointLocation(self.raw) };
    }
}
impl From<sys::SBBreakpointLocationRef> for SBBreakpointLocation {
    fn from(raw: sys::SBBreakpointLocationRef) -> SBBreakpointLocation {
        SBBreakpointLocation { raw }
    }
}
unsafe impl Send for SBBreakpointLocation {}
unsafe impl Sync for SBBreakpointLocation {}
#[cfg(feature = "graphql")]
graphql_object!(SBBreakpointLocation: crate::SBDebugger | &self | {
    field is_valid() -> bool {
        self.is_valid()
    }
    field id() -> i32 {
        self.id()
    }
    field address() -> Option<SBAddress> {
        self.address()
    }
    
    field load_address() -> i32 {
        self.load_address() as i32
    }
    field is_enabled() -> bool {
        self.is_enabled()
    }
    
    field ignore_count() -> i32 {
        self.ignore_count() as i32
    }
    field is_resolved() -> bool {
        self.is_resolved()
    }
    field breakpoint() -> SBBreakpoint {
        self.breakpoint()
    }
});