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
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

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
Fellow
Registered: 2014-08-08
Posts: 4,097

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


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

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: 29,449
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
Fellow
Registered: 2014-08-08
Posts: 4,097

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.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

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

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

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
Fellow
Registered: 2014-08-08
Posts: 4,097

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.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

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

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

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
Fellow
Registered: 2014-08-08
Posts: 4,097

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.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#12 2018-07-05 21:47:09

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

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

Well, that seems a thing for a very remote future atm.
I just tried to properly handle those problems (after understanding how gdb script auto-load work).
But after checking which directories Arch should actually load symbols from, I found out separate debug packaging is quite limited.

Therefore I guess I'll just do any particular tinkering like gcc already does:

install -DTm755 Tools/gdb/libpython.py "${pkgdir}"/usr/share/gdb/auto-load/usr/lib/libpython${_pybasever}dm.so.1.0-gdb.py

at the end of the pkgbuild (and you should have a flawless experience).

Offline

#13 2018-07-06 00:04:58

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

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

I have absolutely no clue what either of those referenced bugs have to do with anything.

"Well, that seems a thing for a very remote future atm."

Very remote indeed -- the latter is not even any sort of bug at all.

The former is going to be fixed in the next minor version of pacman. Not that it matters, since most users who are rebuilding the package themselves do not need to strip the symbols into a *detached* debugging package.

Last edited by eschwartz (2018-07-06 00:05:49)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2018-07-06 12:27:52

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

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

Having no straightforward way to work with the debug pkgdir contents, is quite a downer.
And it seemed quite dirty to create the whole /usr/lib/debug/usr/lib thing just to ship that single file alone (if "attached" so has to be used and preferred)

At least there was this second method.

Offline

#15 2018-07-06 13:34:34

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

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

Well, I assumed you wanted the debugging symbols too.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#16 2018-07-07 12:24:34

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

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

Sure.
But why making two separate packages at this point, if the only thing that would have justified it, is better to be shipped in the normal one anyway?

I'm also sorry for the confusion above, I mixed up PKGDEST with pkgdir, and thought OP was asking about a variable (or function) specifically for what I needed.
Thanks again for the.. care?

Offline

Board footer

Powered by FluxBB