Commit 3f97ccef authored by Peter DeLong's avatar Peter DeLong Committed by Facebook Github Bot

Allow fiber to be called on both type Fiber and Fiber*

Summary: The fiber command can now be run on a value of type folly::fibers::Fiber or a value of type folly::fibers::Fiber*

Reviewed By: andriigrynenko

Differential Revision: D5393491

fbshipit-source-id: 1f48e08288f75c59852c939062db616eb06cea73
parent 6e904443
...@@ -246,13 +246,14 @@ class FiberUnwinder(gdb.unwinder.Unwinder): ...@@ -246,13 +246,14 @@ class FiberUnwinder(gdb.unwinder.Unwinder):
return unwind_info return unwind_info
def fiber_activate(fiber_ptr): def fiber_activate(fiber):
fiber_type = gdb.lookup_type("folly::fibers::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(): if not FiberPrinter(fiber).backtrace_available():
return "Can not activate a non-waiting fiber." return "Can not activate a non-waiting fiber."
FiberUnwinder.set_fiber(fiber) 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(): def fiber_deactivate():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment