(self, val)
| 461 | """ |
| 462 | |
| 463 | def __init__(self, val): |
| 464 | self.val = val |
| 465 | try: |
| 466 | # libstdc++ internals |
| 467 | self._data = val['_M_dataplus']['_M_p'] |
| 468 | self._size = val['_M_string_length'] |
| 469 | except gdb.error: |
| 470 | # fallback for other C++ standard libraries |
| 471 | self._data = gdb.parse_and_eval(f"{for_evaluation(val)}.c_str()") |
| 472 | self._size = gdb.parse_and_eval(f"{for_evaluation(val)}.size()") |
| 473 | |
| 474 | def __bool__(self): |
| 475 | return self._size != 0 |
nothing calls this directly
no test coverage detected