You are not logged in.

#1 2017-10-11 11:39:53

EFanZh
Member
Registered: 2017-10-11
Posts: 2

What is the equivalent package of python3.6-dbg from Debian?

Debian has packages like python2.7-dbg and python3.6-dbg that extends GDB to debug Python programs. They provide GDB commands listed here.

I can’t find an equivalent package in Arch Linux, even not in AUR. Is there some packages I can use to extend GDB to support commands like “py-bt”?

Offline

#2 2017-10-11 11:47:42

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 2,533

Re: What is the equivalent package of python3.6-dbg from Debian?

Welcomre to the forums EFanZh smile

Arch doesn't provide debug packages, but you can use the ABS to build your own version with debug enabled.
https://wiki.archlinux.org/index.php/De … ing_Traces

Last edited by Slithery (2017-10-11 11:48:56)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-10-11 22:12:39

Eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 1,722

Re: What is the equivalent package of python3.6-dbg from Debian?

Well, makepkg and pacman support debug packages just fine. But it currently isn't enabled when building repository packages because no one has written the patches for dbscripts to handle special debug repositories. smile

Offline

#4 2017-10-12 01:37:30

EFanZh
Member
Registered: 2017-10-11
Posts: 2

Re: What is the equivalent package of python3.6-dbg from Debian?

I do not need a debug version Python. I just want a python script to extend GDB so that I can use “py-bt” command in GDB.

The original script can be found here, python3.6-gdb from Debian put this script at /usr/share/gdb/auto-load/usr/bin/python3.6m-gdb.py so that GDB can load it automatically.

I know I could write a PKGBUILD to make a package for Arch Linux that does the same thing, but is there some existing package I can use directly?

Offline

#5 2017-10-12 01:53:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 18,847
Website

Re: What is the equivalent package of python3.6-dbg from Debian?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2018-01-28 13:07:12

kangirigungi
Member
Registered: 2018-01-28
Posts: 1

Re: What is the equivalent package of python3.6-dbg from Debian?

I installed this package, yet I still cannot use py-bt. Is there anything else I should do?

Offline

#7 2018-01-28 20:07:07

Eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 1,722

Re: What is the equivalent package of python3.6-dbg from Debian?

Arch does not install the gdb extension for python, so naturally that won't work. I think Trilby was suggesting that if you really want to debug python code with gdb, you should just compile it into machine code that links against libpython.so -- as gdb works fine in that case.

But no one has ever asked that we add it (the gdb extension) to our Python package, and I'm not entirely sure how useful it would be anyways as our Python packages do not ship with debug symbols, which as I understand it cripples the py-bt tool.

Offline

#8 2018-02-18 12:50:21

mirh
Member
Registered: 2016-04-09
Posts: 22

Re: What is the equivalent package of python3.6-dbg from Debian?

(jesus christ, what a mess Debian rules build file is)
Anyway, a first good step into this should be

sudo pacman -S asp
asp checkout python
cd python/trunk
# go-into-that-folder and add --with-pydebug build parameter to PKGBUILD (maybe remove --enable-optimizations and --with-lto too)
# add options=(debug !strip), and optionally delete check() section to save yourself some precious hours
makepkg
sudo pacman -U ./python-3*.pkg.tar.xz
# use asp to also rebuild gdb

Then don't forget that some extensions linking to native code, will need to be recompiled with the new "debug config" to work.
I'm still not sure on how symbols should be added into to the package though.

crazy fact: years ago such a ""simple"" thing was deemed even too stupid for inclusion in the aur.

Last edited by mirh (2018-02-19 02:21:14)

Offline

#9 2018-02-18 13:50:56

Eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 1,722

Re: What is the equivalent package of python3.6-dbg from Debian?

mirh wrote:

(jesus christ, what a mess Debian rules build file is)

So, uh, don't look at them? Not really sure where you are going with this.

mirh wrote:
yaourt asp-git
pacman -S asp

Why use an AUR helper if you don't need to? Why randomly assume what AUR helper a person is using?

mirh wrote:

Then don't forget that some extensions linking to native code, will need to be recompiled with the new "debug config" to work.
I'm still not sure on how symbols should be added into to the package though.

crazy fact: years ago such a ""simple"" thing was deemed even too stupid for inclusion in the aur.

What makes you so sure that has changed? What makes you so sure that is crazy?

Consider, that adding debug symbols to a package is as a general rule a simple matter of recompiling a package with *no* changes other than adding options=(debug) to the user's makepkg.conf, which an AUR package cannot do, or adding options+=(debug) to the PKGBUILD, which is hardly notable. "Yes, this AUR package just enables makepkg's configuration option to build debug packages, it is totally worth it in the AUR".

Which apparently you didn't know as you yourself just declared you have no idea how to add debug symbols into the package.

...

Anyway, since no one cares enough to test whether the python gdb extension is useful even without debug symbols, and if so file a bugreport asking for it to be included, I'm not sure where we can go on from here.

Offline

#10 2018-02-19 02:22:39

mirh
Member
Registered: 2016-04-09
Posts: 22

Re: What is the equivalent package of python3.6-dbg from Debian?

Eschwartz wrote:

Why use an AUR helper if you don't need to?

I'd have swear asp wasn't in main packages. Sorry, fixed.

Eschwartz wrote:

What makes you so sure that has changed? What makes you so sure that is crazy?

The actual fact that it isn't really that "obvious" and "straightforward" to build said package.

Of course if you already knows that, it's a one or two liner... But it took me hours to figure this, and other stuff.

Anyway, I just finally surmounted a couple of other difficulties, and I can say that py-bt doesn't work on release builds.
I get "Python Exception <class 'ValueError'> Variable 'func_obj' not found.: Error occurred in Python command: Variable 'func_obj' not found" there.
And basically the same error (func, instead of func_obj) with debug with stripped symbols (you also need to rebuild gdb, btw)

Once every damn of these is cleared though, I do am getting the expected extensive stack trace.
Thanks for your help.

Offline

#11 2018-02-20 16:32:33

Eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 1,722

Re: What is the equivalent package of python3.6-dbg from Debian?

mirh wrote:
Eschwartz wrote:

Why use an AUR helper if you don't need to?

I'd have swear asp wasn't in main packages. Sorry, fixed.

Eschwartz wrote:

What makes you so sure that has changed? What makes you so sure that is crazy?

The actual fact that it isn't really that "obvious" and "straightforward" to build said package.

Of course if you already knows that, it's a one or two liner... But it took me hours to figure this, and other stuff.

Then that is a documentation issue, not something to be solved by uploading a package to the AUR that *only* contains overridden makepkg.conf settings (as your 2013 link discussed).

The logical progression of this would see us having one -dbg package in the AUR for each package in the repos.

mirh wrote:

Anyway, I just finally surmounted a couple of other difficulties, and I can say that py-bt doesn't work on release builds.
I get "Python Exception <class 'ValueError'> Variable 'func_obj' not found.: Error occurred in Python command: Variable 'func_obj' not found" there.
And basically the same error (func, instead of func_obj) with debug with stripped symbols (you also need to rebuild gdb, btw)

Once every damn of these is cleared though, I do am getting the expected extensive stack trace.
Thanks for your help.

I guess that makes sense. I guess as soon as Arch Linux has debug repos, this will no longer be such an issue.

Offline

Board footer

Powered by FluxBB