class GetFiberXMethodMatcher(gdb.xmethod.XMethodMatcher):
def __init__(self):
- super(GetFiberXMethodMatcher, self).__init__("Fiber address method matcher")
+ super(GetFiberXMethodMatcher, self).__init__(
+ "Fiber address method matcher")
self.worker = GetFiberXMethodWorker()
def match(self, class_type, method_name):
return unwind_info
-def fiber_activate(fiber_ptr):
+def fiber_activate(fiber):
fiber_type = gdb.lookup_type("folly::fibers::Fiber")
- fiber = fiber_ptr.cast(fiber_type.pointer()).dereference()
+ if fiber.type != fiber_type:
+ fiber = fiber.cast(fiber_type.pointer()).dereference()
if not FiberPrinter(fiber).backtrace_available():
return "Can not activate a non-waiting fiber."
+ gdb.invalidate_cached_frames()
FiberUnwinder.set_fiber(fiber)
- return "Fiber " + str(fiber_ptr) + " activated. You can call 'bt' now."
+ return "Fiber 0x{:12x} activated. You can call 'bt' now.".format(int(fiber.address))
def fiber_deactivate():