| 21 | |
| 22 | |
| 23 | class SmallVectorImplWorker_size(gdb.xmethod.XMethodWorker): |
| 24 | def __init__(self, t): |
| 25 | self.t = t |
| 26 | |
| 27 | def get_arg_types(self): |
| 28 | return None |
| 29 | |
| 30 | def get_result_type(self, *args): |
| 31 | return gdb.lookup_type("int") |
| 32 | |
| 33 | def __call__(self, obj): |
| 34 | return obj["m_end_ptr"].cast(self.t.pointer()) - obj["m_begin_ptr"].cast( |
| 35 | self.t.pointer() |
| 36 | ) |
| 37 | |
| 38 | |
| 39 | class SmallVectorImplMatcher(gdb.xmethod.XMethodMatcher): |