You are not logged in.

#1 2021-06-08 07:37:30

horades
Member
Registered: 2021-06-07
Posts: 2

gdb: no debugging symbols found in python

Hello everyone.

I would like to use `gdb` in order to debug a python script returning a `Segmentation fault`.

However, when I try to use gdb with python

gdb --args python myscript.py

it does not find debugging symbols

Reading symbols from python...
(No debugging symbols found in python)
(gdb) 

I'm using python3.9 (/usr/bin/python3.9) provided by Arch Linux.

I have tried to install python-dbg from the AUR in order to fix this issue.
But the installation failed because of conflicting files

yay -S python-dbg
(...)
(1/1) checking for file conflicts                                                                                                              [----------------------------------------------------------------------------------------] 100%
error: failed to commit transaction (conflicting files)
python-dbg: /usr/bin/2to3 exists in filesystem (owned by python)
python-dbg: /usr/bin/idle exists in filesystem (owned by python)
python-dbg: /usr/bin/idle3 exists in filesystem (owned by python)
python-dbg: /usr/bin/pydoc exists in filesystem (owned by python)
python-dbg: /usr/bin/pydoc3 exists in filesystem (owned by python)
python-dbg: /usr/bin/python exists in filesystem (owned by python)
python-dbg: /usr/bin/python-config exists in filesystem (owned by python)
python-dbg: /usr/bin/python3 exists in filesystem (owned by python)
python-dbg: /usr/bin/python3-config exists in filesystem (owned by python)
python-dbg: /usr/lib/pkgconfig/python3-embed.pc exists in filesystem (owned by python)
python-dbg: /usr/lib/pkgconfig/python3.pc exists in filesystem (owned by python)
python-dbg: /usr/share/man/man1/python3.1.gz exists in filesystem (owned by python)

I'm using gdb10.2 provided by Arch Linux

gdb --configuration
This GDB was configured as follows:
   configure --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --without-babeltrace
             --without-intel-pt
             --with-mpfr
             --without-xxhash
             --with-python=/usr (relocatable)
             --with-python-libdir=/usr/lib (relocatable)
             --with-debuginfod
             --with-guile
             --enable-source-highlight
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit

I have searched a solution to this matter on the Internet (hence, on wiki.archlinux), but I haven't found one.

Any help and explanation are welcome.

Offline

#2 2021-06-08 13:48:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,849

Re: gdb: no debugging symbols found in python

In the future, If you wish a thread moved, please ask the moderators to move it using the Report link.  Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2021-06-08 13:51:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,849

Re: gdb: no debugging symbols found in python

My suggestion would be to grab the package used to build python (https://github.com/archlinux/svntogit-p … thon/trunk) and change the PKGBUILD so as to enable debug.  Install it as if it were an AUR package.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB