MCPcopy Create free account
hub / github.com/apache/brpc / BthreadMetaCmd

Class BthreadMetaCmd

tools/gdb_bthread_stack.py:209–227  ·  view source on GitHub ↗

bthread_meta , print task meta by id

Source from the content-addressed store, hash-verified

207 print("rip: 0x{:x}\nrsp: 0x{:x}\nrbp: 0x{:x}\nrbx: 0x{:x}\nr15: 0x{:x}\nr14: 0x{:x}\nr13: 0x{:x}\nr12: 0x{:x}".format(rip, rsp, rbp, rbx, r15, r14, r13, r12))
208
209class BthreadMetaCmd(gdb.Command):
210 """bthread_meta <id>, print task meta by id"""
211 def __init__(self):
212 gdb.Command.__init__(self, "bthread_meta", gdb.COMMAND_STACK, gdb.COMPLETE_NONE)
213
214 def invoke(self, arg, tty):
215 global status
216 global bthreads
217 if not status:
218 print("Not in bthread debug mode")
219 return
220 if not arg:
221 print("bthread_meta <id>, see 'bthread_list'")
222 return
223 bthread_id = int(arg)
224 if bthread_id >= len(bthreads):
225 print("id {} exceeds max bthread nums {}".format(bthread_id, len(bthreads)))
226 return
227 print(bthreads[bthread_id])
228
229class BthreadBeginCmd(gdb.Command):
230 """enter bthread debug mode"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected