debug.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:SublimeAnarchyDebug 作者: AnarchyTools 项目源码 文件源码
def update_run_marker(window, lldb=None):
    if not lldb:
        for view in window.views():
            view.erase_regions("run_pointer")
        return

    with retry():
        try:
            bt = lldb.get_backtrace_for_selected_thread()
            if 'bt' not in bt:
                for view in window.views():
                    view.erase_regions("run_pointer")
                return
            for frame in bt['bt']:
                if 'file' in frame and frame['line'] != 0:
                    found = False
                    for view in window.views():
                        if view.file_name() == frame['file']:
                            location = view.line(view.text_point(frame['line'] - 1, 0))
                            view.add_regions("run_pointer", [location], "entity.name.class", "Packages/SublimeAnarchyDebug/images/stop_point.png", sublime.DRAW_NO_FILL)
                            if not view.visible_region().contains(location):
                                view.show_at_center(location)
                            if window.active_group() == 0:
                                window.focus_view(view)
                            found = True
                    if not found:
                        grp = window.active_group()
                        window.focus_group(0)
                        view = window.open_file(frame['file'] + ":" + str(frame['line']), sublime.ENCODED_POSITION)
                        window.focus_group(grp)
                        location = view.line(view.text_point(frame['line'] - 1, 0))
                        view.add_regions("run_pointer", [location], "entity.name.class", "Packages/SublimeAnarchyDebug/images/stop_point.png", sublime.DRAW_NO_FILL)
                        if not view.visible_region().contains(location):
                            view.show_at_center(location)
                    break
        except xmlrpc.client.Fault:
            for view in window.views():
                view.erase_regions("run_pointer")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号