当前位置: 首页>>代码示例>>Python>>正文


Python gdb.selected_frame方法代码示例

本文整理汇总了Python中gdb.selected_frame方法的典型用法代码示例。如果您正苦于以下问题:Python gdb.selected_frame方法的具体用法?Python gdb.selected_frame怎么用?Python gdb.selected_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gdb的用法示例。


在下文中一共展示了gdb.selected_frame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_contents

# 需要导入模块: import gdb [as 别名]
# 或者: from gdb import selected_frame [as 别名]
def get_contents(self):
        str = ''

        str += Strongdb.border_header('Backtrace')

        frame = gdb.selected_frame()
        while frame != None:
            str += '\t%s -> %s()\n' % (Strongdb.colorize(hex(frame.pc())[:-1], Colors.address_color),
                                       frame.name() if frame.name() != None else '??')

            older_frm = frame.older()
            if older_frm == None:
                str += Strongdb.colorize('\t' + gdb.frame_stop_reason_string(frame.unwind_stop_reason()),
                                         Colors.address_color)

            frame = older_frm

        str += Strongdb.border_footer()
        return str 
开发者ID:cx9527,项目名称:strongdb,代码行数:21,代码来源:strongdb.py

示例2: stop

# 需要导入模块: import gdb [as 别名]
# 或者: from gdb import selected_frame [as 别名]
def stop(self):
    rdi = gdb.selected_frame().read_register('rdi') #XXX
    return False
    if rdi == 0 or rdi == ZERO_SIZE_PTR or rdi == 0x40000000: #XXX
      return False

    cache = rdi.cast(gdb.lookup_type('struct kmem_cache').pointer()).dereference()
    cache = cache['name'].string()

    name, pid = get_task_info()

    if apply_filter(name, cache):
      trace_info = 'kfree is freeing an object from cache ' + cache  + ' on behalf of process "' + name + '", pid ' + str(pid)
      salt_print(trace_info)
      history.append(('kfree', cache, name, pid))
    return False 
开发者ID:PaoloMonti42,项目名称:salt,代码行数:18,代码来源:salt.py

示例3: get_selected_frame

# 需要导入模块: import gdb [as 别名]
# 或者: from gdb import selected_frame [as 别名]
def get_selected_frame(cls):
        _gdbframe = gdb.selected_frame()
        if _gdbframe:
            return Frame(_gdbframe)
        return None 
开发者ID:google,项目名称:pyringe,代码行数:7,代码来源:libpython.py

示例4: invoke

# 需要导入模块: import gdb [as 别名]
# 或者: from gdb import selected_frame [as 别名]
def invoke(self, arg, from_tty):
        print ("\n********************************************************************************")
        print ("Displaying blocking threads using 'blocked' command")
        threads = {}
        for process in gdb.inferiors():
            for thread in process.threads():
                trd = Thread()
                trd.threadId = thread.ptid[1] #[1] - threadId; [0] - process pid
                #print ("Thread: {0}".format(threads[-1].threadId))
                thread.switch()
                frame = gdb.selected_frame()
                while frame:
                    frame.select()
                    #print("   {0}".format(frame.name()))
                    if "pthread_mutex_lock" in frame.name():
                        trd.waitOnThread = int(gdb.execute("print mutex.__data.__owner", to_string=True).split()[2])
                        #print(threads[-1].waitOnThread)
                    trd.frames.append(frame.name())
                    frame = frame.older()
                threads[trd.threadId] = trd

        for (tid,thread) in threads.items():
            if thread.waitOnThread:
                deadlockedText = "" if not threads[thread.waitOnThread].waitOnThread == thread.threadId else "AND DEADLOCKED"
                print ("Thread: {0} waits for thread: {1} {2}".format(thread.threadId, thread.waitOnThread, deadlockedText))
        print ("********************************************************************************") 
开发者ID:DamZiobro,项目名称:gdb-automatic-deadlock-detector,代码行数:28,代码来源:gdbDisplayLockedThreads.py


注:本文中的gdb.selected_frame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。