blob: 18880fc9a78c3b4d2d7e96f59d579d34cf1167b5 [file] [log] [blame]
# -*- coding: utf-8 -*-
# GDB debugging support, TCG status
# Copyright 2016 Linaro Ltd
# Authors:
# Alex Bennée <>
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
# 'qemu tcg-lock-status' -- display the TCG lock status across threads
import gdb
class TCGLockStatusCommand(gdb.Command):
'''Display TCG Execution Status'''
def __init__(self):
gdb.Command.__init__(self, 'qemu tcg-lock-status', gdb.COMMAND_DATA,
def invoke(self, arg, from_tty):
gdb.write("Thread, BQL (iothread_mutex), Replay, Blocked?\n")
for thread in gdb.inferiors()[0].threads():
iothread = gdb.parse_and_eval("iothread_locked")
replay = gdb.parse_and_eval("replay_locked")
frame = gdb.selected_frame()
if == "__lll_lock_wait":
mutex = gdb.parse_and_eval("mutex")
owner = gdb.parse_and_eval("mutex->__data.__owner")
blocked = ("__lll_lock_wait waiting on %s from %d" %
(mutex, owner))
blocked = "not blocked"
gdb.write("%d/%d, %s, %s, %s\n" % (thread.num, thread.ptid[1],
iothread, replay, blocked))