2014-11-13 2 views
0

그래서 파이썬 C 모듈에서 SIGSEGV 신호를받습니다. 이 모듈은 Windows에서 테스트/빌드되었으며 현재 Linux (Linux Mint 17 64 비트)에서 사용하려고합니다. 저는 gdb를 처음 접했지만 파이썬의 소스 코드를 보여줄 수있는 방법이 있습니까?C 모듈 용 gdb로 파이썬 소스 디버깅

Program received signal SIGSEGV, Segmentation fault. 
PyErr_SetObject (exception=0xae3818, value=0x7ffff7e229f0) at ../Python/errors.c:70 
70  ../Python/errors.c: No such file or directory. 

스택 트레이스 (필터링) : 설치된 패키지의

(gdb) bt 
#0 PyErr_SetObject (exception=0xae3818, value=0x7ffff7e229f0) at ../Python/errors.c:70 
#1 0x000000000043675f in PyErr_SetString (exception=0xae3818, string=<optimized out>) at ../Python/errors.c:147 
... 

목록 : 파일에 당신에게 코드를 보여 gdb를 원하는 경우

> dpkg-query -l |grep python3 
ii libpython3-dbg:amd64      3.4.0-0ubuntu2          amd64  debug build of the Python 3 Interpreter (version 3.4) 
ii libpython3-dev:amd64      3.4.0-0ubuntu2          amd64  header files and a static library for Python (default) 
ii libpython3-stdlib:amd64      3.4.0-0ubuntu2          amd64  interactive high-level object-oriented language (default python3 version) 
ii libpython3.4:amd64       3.4.0-2ubuntu1          amd64  Shared Python runtime library (version 3.4) 
ii libpython3.4-dbg:amd64      3.4.0-2ubuntu1          amd64  Debug Build of the Python Interpreter (version 3.4) 
ii libpython3.4-dev:amd64      3.4.0-2ubuntu1          amd64  Header files and a static library for Python (v3.4) 
ii libpython3.4-minimal:amd64     3.4.0-2ubuntu1          amd64  Minimal subset of the Python language (version 3.4) 
ii libpython3.4-stdlib:amd64     3.4.0-2ubuntu1          amd64  Interactive high-level object-oriented language (standard library, version 3.4) 
ii python3          3.4.0-0ubuntu2          amd64  interactive high-level object-oriented language (default python3 version) 
ii python3-apt         0.9.3.5           amd64  Python 3 interface to libapt-pkg 
ii python3-aptdaemon       1.1.1-1ubuntu5.1         all   Python 3 module for the server and client of aptdaemon 
ii python3-aptdaemon.gtk3widgets    1.1.1-1ubuntu5.1         all   Python 3 GTK+ 3 widgets to run an aptdaemon client 
ii python3-aptdaemon.pkcompat     1.1.1-1ubuntu5.1         all   PackageKit compatibilty for AptDaemon 
ii python3-cairo        1.10.0+dfsg-3ubuntu2        amd64  Python 3 bindings for the Cairo vector graphics library 
ii python3-chardet        2.0.1-1           all   universal encoding detector 
ii python3-commandnotfound      0.3ubuntu12          all   Python 3 bindings for command-not-found. 
ii python3-dbg         3.4.0-0ubuntu2          amd64  debug build of the Python 3 Interpreter (version 3.4) 
ii python3-dbus        1.2.0-2build2          amd64  simple interprocess messaging system (Python 3 interface) 
ii python3-dbus.mainloop.qt     4.10.4+dfsg-1ubuntu1        amd64  D-Bus Support for PyQt4 with Python 3 
ii python3-debian        0.1.21+nmu2ubuntu2         all   Python 3 modules to work with Debian-related data formats 
ii python3-defer        1.0.6-2build1          all   Small framework for asynchronous programming (Python 3) 
ii python3-dev         3.4.0-0ubuntu2          amd64  header files and a static library for Python (default) 
ii python3-gdbm:amd64       3.4.0-0ubuntu1          amd64  GNU dbm database support for Python 3.x 
ii python3-gi         3.12.0-1ubuntu1         amd64  Python 3 bindings for gobject-introspection libraries 
ii python3-gi-cairo       3.12.0-1ubuntu1         amd64  Python 3 Cairo bindings for the GObject library 
ii python3-icu         1.5-2ubuntu4          amd64  Python 3 extension wrapping the ICU C++ API 
ii python3-minimal        3.4.0-0ubuntu2          amd64  minimal subset of the Python language (default python3 version) 
ii python3-pkg-resources      3.3-1ubuntu1          all   Package Discovery and Resource Access using pkg_resources 
ii python3-problem-report      2.14.1-0ubuntu3.5         all   Python 3 library to handle problem reports 
ii python3-pyicu        1.5-2ubuntu4          amd64  dummy transitional package for PyICU Python 3 extension 
ii python3-six         1.5.2-1           all   Python 2 and 3 compatibility library (Python 3 interface) 
ii python3-xkit        0.5.0ubuntu2          all   library for the manipulation of xorg.conf files (Python 3) 
ii python3.4         3.4.0-2ubuntu1          amd64  Interactive high-level object-oriented language (version 3.4) 
ii python3.4-dbg        3.4.0-2ubuntu1          amd64  Debug Build of the Python Interpreter (version 3.4) 
ii python3.4-dev        3.4.0-2ubuntu1          amd64  Header files and a static library for Python (v3.4) 
ii python3.4-minimal       3.4.0-2ubuntu1          amd64  Minimal subset of the Python language (version 3.4) 

답변

1

, 당신이 그것을 말할 필요 파일을 찾을 위치.

이 작업은 directory 명령과 원본 파일의 경로를 사용하여 수행 할 수 있습니다.

More info here

+0

감사합니다. 나는 파이썬의 소스 타르를 다운로드하고'directory/path/to/python/source'해야했다. 내가 한 빠른 검색에서 소스를 제공하는 패키지가없는 것처럼 보입니다. 이것을 새로운 gdb 세션으로 지속시킬 수있는 방법이 있습니까? – David