Skip to content

Commit

Permalink
wrap the class name in single quotes (apache#2732)
Browse files Browse the repository at this point in the history
Co-authored-by: Dongsheng He <hds@dipeak.com>
  • Loading branch information
ehds and Dongsheng He authored Oct 11, 2024
1 parent 9680d31 commit 8d8a296
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/gdb_bthread_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@ def get_all_bthreads(total):
global bthreads
bthreads = []
count = 0
groups = int(gdb.parse_and_eval("butil::ResourcePool<bthread::TaskMeta>::_ngroup")["val"])
groups = int(gdb.parse_and_eval("(size_t)'butil::ResourcePool<bthread::TaskMeta>::_ngroup'"))
for group in range(groups):
blocks = int(gdb.parse_and_eval("(unsigned long)(*((*((('butil::static_atomic<butil::ResourcePool<bthread::TaskMeta>::BlockGroup*>' *)('butil::ResourcePool<bthread::TaskMeta>::_block_groups')) + {})).val)).nblock".format(group)))
for block in range(blocks):
items = int(gdb.parse_and_eval("(*(*((butil::ResourcePool<bthread::TaskMeta>::Block**)((*((*((('butil::static_atomic<butil::ResourcePool<bthread::TaskMeta>::BlockGroup*>' *)('butil::ResourcePool<bthread::TaskMeta>::_block_groups')) + {})).val)).blocks) + {}))).nitem".format(group, block)))
items = int(gdb.parse_and_eval("(*(*(('butil::ResourcePool<bthread::TaskMeta>::Block' **)((*((*((('butil::static_atomic<butil::ResourcePool<bthread::TaskMeta>::BlockGroup*>' *)('butil::ResourcePool<bthread::TaskMeta>::_block_groups'))+ {})).val)).blocks) + {}))).nitem".format(group, block)))
for item in range(items):
task_meta = gdb.parse_and_eval("*(('bthread::TaskMeta' *)((*(*((butil::ResourcePool<bthread::TaskMeta>::Block**)((*((*((('butil::static_atomic<butil::ResourcePool<bthread::TaskMeta>::BlockGroup*>' *)('butil::ResourcePool<bthread::TaskMeta>::_block_groups')) + {})).val)).blocks) + {}))).items) + {})".format(group, block, item))
task_meta = gdb.parse_and_eval("*(('bthread::TaskMeta' *)((*(*(('butil::ResourcePool<bthread::TaskMeta>::Block' **)((*((*((('butil::static_atomic<butil::ResourcePool<bthread::TaskMeta>::BlockGroup*>' *)('butil::ResourcePool<bthread::TaskMeta>::_block_groups')) + {})).val)).blocks) + {}))).items) + {})".format(group, block, item))
version_tid = (int(task_meta["tid"]) >> 32)
version_butex = gdb.parse_and_eval("*(uint32_t *){}".format(task_meta["version_butex"]))
version_butex = gdb.parse_and_eval(
"*(uint32_t *){}".format(task_meta["version_butex"]))
if version_tid == int(version_butex) and int(task_meta["attr"]["stack_type"]) != 0:
bthreads.append(task_meta)
count += 1
Expand Down

0 comments on commit 8d8a296

Please sign in to comment.