久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='fDZkk'><style id='fDZkk'><dir id='fDZkk'><q id='fDZkk'></q></dir></style></legend>

    <small id='fDZkk'></small><noframes id='fDZkk'>

      <bdo id='fDZkk'></bdo><ul id='fDZkk'></ul>
  • <tfoot id='fDZkk'></tfoot>

  • <i id='fDZkk'><tr id='fDZkk'><dt id='fDZkk'><q id='fDZkk'><span id='fDZkk'><b id='fDZkk'><form id='fDZkk'><ins id='fDZkk'></ins><ul id='fDZkk'></ul><sub id='fDZkk'></sub></form><legend id='fDZkk'></legend><bdo id='fDZkk'><pre id='fDZkk'><center id='fDZkk'></center></pre></bdo></b><th id='fDZkk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fDZkk'><tfoot id='fDZkk'></tfoot><dl id='fDZkk'><fieldset id='fDZkk'></fieldset></dl></div>

        使用 gdb 7 對(duì)調(diào)試 Python 程序的支持需要什么?

        What is needed to use gdb 7#39;s support for debugging Python programs?(使用 gdb 7 對(duì)調(diào)試 Python 程序的支持需要什么?)
      1. <i id='uVUjF'><tr id='uVUjF'><dt id='uVUjF'><q id='uVUjF'><span id='uVUjF'><b id='uVUjF'><form id='uVUjF'><ins id='uVUjF'></ins><ul id='uVUjF'></ul><sub id='uVUjF'></sub></form><legend id='uVUjF'></legend><bdo id='uVUjF'><pre id='uVUjF'><center id='uVUjF'></center></pre></bdo></b><th id='uVUjF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uVUjF'><tfoot id='uVUjF'></tfoot><dl id='uVUjF'><fieldset id='uVUjF'></fieldset></dl></div>

                <tbody id='uVUjF'></tbody>
            • <tfoot id='uVUjF'></tfoot>
              1. <small id='uVUjF'></small><noframes id='uVUjF'>

                  <bdo id='uVUjF'></bdo><ul id='uVUjF'></ul>
                  <legend id='uVUjF'><style id='uVUjF'><dir id='uVUjF'><q id='uVUjF'></q></dir></style></legend>
                • 本文介紹了使用 gdb 7 對(duì)調(diào)試 Python 程序的支持需要什么?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想使用 gdb 7 的支持來調(diào)試 Python劣質(zhì)進(jìn)程".

                  我需要什么才能做到這一點(diǎn)?

                  例如:

                  • 運(yùn)行劣質(zhì) Python 的配置腳本需要使用哪些標(biāo)志?

                  • 低級(jí) Python 進(jìn)程是否必須是 Python 2.7 或更高版本(我看到那是 Python 源代碼樹中的 gdb 支持的部分提交的時(shí)候)?還是只有 gdb 進(jìn)程本身需要 Python 2.7?

                  • 需要安裝哪些文件可能不會(huì)被所有發(fā)行版打包?例如,在 packages.ubuntu.com 上我沒有得到任何關(guān)于 python-gdb.py 的點(diǎn)擊,我認(rèn)為這是需要的.

                  了解特定發(fā)行版的需求會(huì)非常方便.我對(duì) Ubuntu 和 Centos 的需求特別感興趣.

                  解決方案

                  Python好像需要用--with-pydebug編譯(在Ubuntu 12.04上,包python-dbg 包含一個(gè)合適的 Python 可執(zhí)行文件,它本身稱為 python-dbg).劣質(zhì)的 Python 不需要是 Python 2.7 -- 2.6 可以成功加載 2.7 gdb 擴(kuò)展(請(qǐng)參閱下面的調(diào)試會(huì)話).至少在 Ubuntu 12.04 上,安裝的定義 gdb 擴(kuò)展的文件稱為 libpython.py,而不是 python-gdb.py(出于某種原因,構(gòu)建 Python 會(huì)產(chǎn)生包含這兩個(gè)文件的構(gòu)建目錄——它們是相同的).

                  但是,我認(rèn)為目前無法使用生產(chǎn)核心文件進(jìn)行調(diào)試:看起來 Python 劣等進(jìn)程的 gdb 擴(kuò)展試圖獲取在生產(chǎn)二進(jìn)制文件中得到優(yōu)化的變量(例如,fPyEval_EvalFrameEx 中的變量).似乎 Linux/gdb 和 Python 尚未達(dá)到在 Illumos 上實(shí)現(xiàn) JavaScript 的出色水平,Bryan Cantrill 在這里報(bào)告說能夠以這種方式調(diào)試生產(chǎn)核心轉(zhuǎn)儲(chǔ):

                  http://www.infoq.com/presentations/Debugging-Production-Systemsp>

                  這是 Ubuntu 12.04 上的調(diào)試會(huì)話,顯示 gdb 使用 Python 2.7 的 gdb 擴(kuò)展運(yùn)行 Python 2.6 次等進(jìn)程來調(diào)試段錯(cuò)誤.首先是導(dǎo)致段錯(cuò)誤的代碼:

                  ~/Downloads/Python-2.6.4$ cat ~/bin/dumpcore.pyFoo類:定義欄(自我):從 ctypes 導(dǎo)入 string_atstring_at(0xDEADBEEF) # 此代碼將導(dǎo)致 Python 出現(xiàn)段錯(cuò)誤定義主():f = Foo()f.someattr = 42f.someotherattr = {'one':1, 'two':2L, 'three':[(), (None,), (None, None)]}f.bar()如果 __name__ == "__main__":主要的()

                  和調(diào)試會(huì)話:

                  ~/Downloads/Python-2.6.4$ gdb --args ./python ~/bin/dumpcore.pyGNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04版權(quán)所有 (C) 2012 Free Software Foundation, Inc.許可證 GPLv3+:GNU GPL 版本 3 或更高版本 <http://gnu.org/licenses/gpl.html>這是免費(fèi)軟件:您可以自由更改和重新分發(fā)它.在法律允許的范圍內(nèi),不提供任何保證.輸入顯示復(fù)制"和顯示保修"了解詳情.此 GDB 配置為x86_64-linux-gnu".有關(guān)錯(cuò)誤報(bào)告說明,請(qǐng)參閱:<http://bugs.launchpad.net/gdb-linaro/>...從/home/john/Downloads/Python-2.6.4/python...讀取符號(hào)...完成.(gdb) 運(yùn)行啟動(dòng)程序:/home/john/Downloads/Python-2.6.4/python/home/john/bin/dumpcore.py[啟用使用 libthread_db 進(jìn)行線程調(diào)試]使用主機(jī) libthread_db 庫(kù)/lib/x86_64-linux-gnu/libthread_db.so.1".程序收到信號(hào) SIGSEGV,分段錯(cuò)誤.0x0000000000468d67 in PyString_FromString (str=0xdeadbeef <Address 0xdeadbeef out of bounds>) at Objects/stringobject.c:116116 大小 = strlen(str);(gdb) py-bt未定義的命令:py-bt".試試幫助".(gdb) 蟒蛇>導(dǎo)入系統(tǒng)>sys.path.insert(0, "/home/john/Downloads/Python-2.7/Tools/gdb")>導(dǎo)入 libpython>(gdb) py-bt#10 幀 0x8f0f90,用于文件/home/john/Downloads/Python-2.6.4/Lib/ctypes/__init__.py,第 496 行,在 string_at 中(ptr=3735928559,size=-1)返回 _string_at(ptr, 大小)#14 幀 0x8ebf90,用于文件/home/john/bin/dumpcore.py,第 5 行,in bar (self=<Foo(someattr=42, someotherattr={'three': [(), (None,),(None, None)], 'two': 2L, 'one': 1}) 在遠(yuǎn)程 0x7ffff6e03240>, string_at=)string_at(0xDEADBEEF) # 此代碼將導(dǎo)致 Python 出現(xiàn)段錯(cuò)誤#17 幀 0x8ebd80,用于文件/home/john/bin/dumpcore.py,第 12 行,在 main (f=<Foo(someattr=42, someotherattr={'three': [(), (None,),(None, None)], 'two': 2L, 'one': 1}) 在遠(yuǎn)程 0x7ffff6e03240>)f.bar()#20 幀 0x8eb680,用于文件/home/john/bin/dumpcore.py,第 16 行,在 <module>()主要的()(gdb)

                  I'd like to use gdb 7's support for debugging Python "inferior processes".

                  What do I need to be able to do that?

                  For example:

                  • What flags does the inferior Python's configure script need to have been run with?

                  • Does the inferior Python process have to be Python 2.7 or newer (I see that's when the part of the gdb support for this that's in Python source tree was committed)? Or is Python 2.7 only needed by the gdb process itself?

                  • What files need to have been installed that might not be packaged by all distributions? For example, on packages.ubuntu.com I don't get any hits for python-gdb.py, which I believe is needed.

                  It would be very handy to know what's needed on particular distributions. I am particularly interested in what's needed for Ubuntu and Centos.

                  解決方案

                  Python seems to need to have been compiled with --with-pydebug (on Ubuntu 12.04, package python-dbg contains a suitable Python executable, itself called python-dbg). The inferior Python does not need to be Python 2.7 -- 2.6 loads the 2.7 gdb extensions successfully (see the debugging session below). At least on Ubuntu 12.04, the file that gets installed that defines the gdb extensions is called libpython.py, not python-gdb.py (for some reason, building Python yields a build directory containing both those files -- they are identical).

                  However, I don't think it's currently possible to debug using production core files: it looks like the gdb extensions for Python inferior processes try to get hold of variables that get optimized away in a production binary (for example, the f variable in PyEval_EvalFrameEx). It seems Linux / gdb, and Python has yet to reach the level of awesomeness achieved for JavaScript on Illumos which Bryan Cantrill reports here is able to debug production core dumps in this way:

                  http://www.infoq.com/presentations/Debugging-Production-Systems

                  Here's the debug session on Ubuntu 12.04 showing gdb running a Python 2.6 inferior process to debug a segfault, using Python 2.7's gdb extensions. First the code to cause the segfault:

                  ~/Downloads/Python-2.6.4$ cat ~/bin/dumpcore.py
                  class Foo:
                  
                      def bar(self):
                          from ctypes import string_at
                          string_at(0xDEADBEEF) # this code will cause Python to segfault
                  
                  
                  def main():
                      f = Foo()
                      f.someattr = 42
                      f.someotherattr = {'one':1, 'two':2L, 'three':[(), (None,), (None, None)]}
                      f.bar()
                  
                  
                  if __name__ == "__main__":
                      main()
                  

                  and the debugging session:

                  ~/Downloads/Python-2.6.4$ gdb --args ./python ~/bin/dumpcore.py
                  GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
                  Copyright (C) 2012 Free Software Foundation, Inc.
                  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                  This is free software: you are free to change and redistribute it.
                  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
                  and "show warranty" for details.
                  This GDB was configured as "x86_64-linux-gnu".
                  For bug reporting instructions, please see:
                  <http://bugs.launchpad.net/gdb-linaro/>...
                  Reading symbols from /home/john/Downloads/Python-2.6.4/python...done.
                  (gdb) run
                  Starting program: /home/john/Downloads/Python-2.6.4/python /home/john/bin/dumpcore.py
                  [Thread debugging using libthread_db enabled]
                  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
                  
                  Program received signal SIGSEGV, Segmentation fault.
                  0x0000000000468d67 in PyString_FromString (str=0xdeadbeef <Address 0xdeadbeef out of bounds>) at Objects/stringobject.c:116
                  116             size = strlen(str);
                  (gdb) py-bt
                  Undefined command: "py-bt".  Try "help".
                  (gdb) python
                  >import sys
                  >sys.path.insert(0, "/home/john/Downloads/Python-2.7/Tools/gdb")
                  >import libpython
                  >(gdb) py-bt
                  #10 Frame 0x8f0f90, for file /home/john/Downloads/Python-2.6.4/Lib/ctypes/__init__.py, line 496, in string_at (ptr=3735928559, size=-1)
                      return _string_at(ptr, size)
                  #14 Frame 0x8ebf90, for file /home/john/bin/dumpcore.py, line 5, in bar (self=<Foo(someattr=42, someotherattr={'three': [(), (None,), (None, None)], 'two': 2L, 'one': 1}) at remote 0x7ffff6e03240>, string_at=<function at remote 0x7ffff6e1c990>)
                          string_at(0xDEADBEEF) # this code will cause Python to segfault
                  #17 Frame 0x8ebd80, for file /home/john/bin/dumpcore.py, line 12, in main (f=<Foo(someattr=42, someotherattr={'three': [(), (None,), (None, None)], 'two': 2L, 'one': 1}) at remote 0x7ffff6e03240>)
                      f.bar()
                  #20 Frame 0x8eb680, for file /home/john/bin/dumpcore.py, line 16, in <module> ()
                      main()
                  (gdb) 
                  

                  這篇關(guān)于使用 gdb 7 對(duì)調(diào)試 Python 程序的支持需要什么?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個(gè)模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點(diǎn)包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復(fù)導(dǎo)入頂級(jí)名稱的情況下構(gòu)造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發(fā)帶有已編譯動(dòng)態(tài)共享庫(kù)的 Python 包)
                    <tbody id='CblCs'></tbody>

                  <small id='CblCs'></small><noframes id='CblCs'>

                  1. <tfoot id='CblCs'></tfoot>

                      <legend id='CblCs'><style id='CblCs'><dir id='CblCs'><q id='CblCs'></q></dir></style></legend>
                      • <i id='CblCs'><tr id='CblCs'><dt id='CblCs'><q id='CblCs'><span id='CblCs'><b id='CblCs'><form id='CblCs'><ins id='CblCs'></ins><ul id='CblCs'></ul><sub id='CblCs'></sub></form><legend id='CblCs'></legend><bdo id='CblCs'><pre id='CblCs'><center id='CblCs'></center></pre></bdo></b><th id='CblCs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CblCs'><tfoot id='CblCs'></tfoot><dl id='CblCs'><fieldset id='CblCs'></fieldset></dl></div>

                            <bdo id='CblCs'></bdo><ul id='CblCs'></ul>
                            主站蜘蛛池模板: 污书屋| 国产精品99 | 国产激情福利 | 毛片一区二区三区 | 91嫩草精品 | 亚洲精品一区二区另类图片 | 欧美中文字幕一区二区三区亚洲 | a免费观看 | 国产农村一级国产农村 | 久久久久国产一区二区三区 | 久久最新精品 | 日韩欧美中文字幕在线观看 | 久久成人av电影 | 国产亚洲一区二区三区 | 在线一区视频 | 欧美日韩网站 | 久久999| 精品国产一区二区久久 | 韩日一区| 一区不卡在线观看 | 久久精品久久久 | 国产精品中文字幕在线 | 午夜丰满少妇一级毛片 | 又爽又黄axxx片免费观看 | 91国内产香蕉 | 亚洲一区二区视频 | 黄色大片免费看 | 精品国产青草久久久久96 | 伊人网站| 国产丝袜一区二区三区免费视频 | 一区二区在线不卡 | 国产精品毛片 | 成人精品免费视频 | 日本不卡高字幕在线2019 | 国产亚洲精品久久久久久豆腐 | 中文字幕精品一区久久久久 | 亚洲v日韩v综合v精品v | 国产一区欧美 | 国产这里只有精品 | 91中文在线观看 | 成人欧美一区二区 |