本文整理汇总了Python中pudb._get_debugger函数的典型用法代码示例。如果您正苦于以下问题:Python _get_debugger函数的具体用法?Python _get_debugger怎么用?Python _get_debugger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_get_debugger函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: set_trace
def set_trace():
import sys
dbg = _get_debugger()
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back)
开发者ID:inducer,项目名称:pudb,代码行数:7,代码来源:__init__.py
示例2: go
def go(self):
import sys
dbg = _get_debugger()
import threading
if isinstance(threading.current_thread(), threading._MainThread):
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back, paused=False)
开发者ID:asmeurer,项目名称:PuDB,代码行数:8,代码来源:__init__.py
示例3: db
def db(self):
capman = config.pluginmanager.getplugin("capturemanager")
out, err = capman.suspendcapture()
import sys
import pudb
dbg = pudb._get_debugger()
dbg.set_trace(sys._getframe().f_back)
开发者ID:kidaa,项目名称:tree-of-life,代码行数:9,代码来源:conftest.py
示例4: post_mortem
def post_mortem(exc_info=None):
if exc_info is None:
import sys
exc_info = sys.exc_info()
tb = exc_info[2]
while tb.tb_next is not None:
tb = tb.tb_next
dbg = _get_debugger()
dbg.reset()
dbg.interaction(tb.tb_frame, exc_info)
开发者ID:sanga,项目名称:pudb,代码行数:12,代码来源:__init__.py
示例5: post_mortem
def post_mortem(tb=None, e_type=None, e_value=None):
if tb is None:
import sys
exc_info = sys.exc_info()
else:
exc_info = (e_type, e_value, tb)
tb = exc_info[2]
while tb.tb_next is not None:
tb = tb.tb_next
dbg = _get_debugger()
dbg.reset()
dbg.interaction(tb.tb_frame, exc_info)
开发者ID:flupke,项目名称:pudb,代码行数:14,代码来源:__init__.py
示例6: set_trace
def set_trace(paused=True):
"""
Start the debugger
If paused=False (the default is True), the debugger will not stop here
(same as immediately pressing 'c' to continue).
"""
import sys
dbg = _get_debugger()
import threading
if isinstance(threading.current_thread(), threading._MainThread):
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back, paused=paused)
开发者ID:asmeurer,项目名称:PuDB,代码行数:15,代码来源:__init__.py
示例7: runscript
def runscript(mainpyfile, args=None, pre_run="", steal_output=False):
dbg = _get_debugger(steal_output=steal_output)
# Note on saving/restoring sys.argv: it's a good idea when sys.argv was
# modified by the script being debugged. It's a bad idea when it was
# changed by the user from the command line. The best approach would be to
# have a "restart" command which would allow explicit specification of
# command line arguments.
import sys
if args is not None:
prev_sys_argv = sys.argv[:]
sys.argv = [mainpyfile] + args
# replace pudb's dir with script's dir in front of module search path.
from os.path import dirname
prev_sys_path = sys.path[:]
sys.path[0] = dirname(mainpyfile)
while True:
if pre_run:
from subprocess import call
retcode = call(pre_run, close_fds=True, shell=True)
if retcode:
print("*** WARNING: pre-run process exited with code %d." % retcode)
raw_input("[Hit Enter]")
status_msg = ""
try:
dbg._runscript(mainpyfile)
except SystemExit:
se = sys.exc_info()[1]
status_msg = "The debuggee exited normally with " \
"status code %s.\n\n" % se.code
except:
dbg.post_mortem = True
dbg.interaction(None, sys.exc_info())
while True:
import urwid
pre_run_edit = urwid.Edit("", pre_run)
result = dbg.ui.call_with_ui(dbg.ui.dialog,
urwid.ListBox([urwid.Text(
"Your PuDB session has ended.\n\n%s"
"Would you like to quit PuDB or restart your program?\n"
"You may hit 'q' to quit."
% status_msg),
urwid.Text("\n\nIf you decide to restart, this command "
"will be run prior to actually restarting:"),
urwid.AttrMap(pre_run_edit, "value")
]),
[
("Restart", "restart"),
("Examine", "examine"),
("Quit", "quit"),
],
focus_buttons=True,
bind_enter_esc=False,
title="Finished",
extra_bindings=[
("q", "quit"),
("esc", "examine"),
])
if result == "quit":
return
if result == "examine":
dbg.post_mortem = True
dbg.interaction(None, sys.exc_info(), show_exc_dialog=False)
if result == "restart":
break
pre_run = pre_run_edit.get_edit_text()
dbg.restart()
if args is not None:
sys.argv = prev_sys_argv
sys.path = prev_sys_path
开发者ID:flupke,项目名称:pudb,代码行数:84,代码来源:__init__.py
示例8: _interrupt_handler
def _interrupt_handler(signum, frame):
from pudb import _get_debugger
_get_debugger().set_trace(frame)
开发者ID:flupke,项目名称:pudb,代码行数:3,代码来源:__init__.py
示例9: runcall
def runcall(*args, **kwds):
return _get_debugger().runcall(*args, **kwds)
开发者ID:flupke,项目名称:pudb,代码行数:2,代码来源:__init__.py
示例10: runeval
def runeval(expression, globals=None, locals=None):
return _get_debugger().runeval(expression, globals, locals)
开发者ID:flupke,项目名称:pudb,代码行数:2,代码来源:__init__.py
示例11: runstatement
def runstatement(statement, globals=None, locals=None):
_get_debugger().run(statement, globals, locals)
开发者ID:flupke,项目名称:pudb,代码行数:2,代码来源:__init__.py
示例12: _interrupt_handler
def _interrupt_handler(signum, frame):
from pudb import _get_debugger
_get_debugger().set_trace(frame, as_breakpoint=False)
开发者ID:Janteby1,项目名称:bloggy,代码行数:3,代码来源:__init__.py
示例13: post_mortem
def post_mortem(tb, excinfo):
dbg = pudb._get_debugger()
stack, i = dbg.get_stack(None, tb)
dbg.reset()
i = _find_last_non_hidden_frame(stack)
dbg.interaction(stack[i][0], excinfo._excinfo)
开发者ID:wronglink,项目名称:pytest-pudb,代码行数:6,代码来源:pytest_pudb.py
注:本文中的pudb._get_debugger函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论