nE0sIghT / vortex-overlay

Gentoo Vortex overlay
15 stars 4 forks source link

new s25rttr-9999 ebuild with debug #13

Closed stefson closed 8 years ago

stefson commented 8 years ago

hi there,

I would really like to have a possiblity to properly debug the game as I am trying help the guys by testing. Do you think you could enable it in a helpfull way? It doesn't seem to work by simply adding append-cflags -ggdb to the ebuild though, as there no debug symbols and lines to be found in the output.

You may have to take care of this commit, I am not sure.

https://github.com/Return-To-The-Roots/s25client/commit/2aeb584eb90196e28cedca2e92775193c467fdef

For me it is working to revert it localy, but I am not a programmer and therefore not sure about it.

thank you

nE0sIghT commented 8 years ago

You can add "-ggdb" to your CFLAGS (via make.conf or portage.env) and add FEATURE="split-debug" while building s25rttr.

stefson commented 8 years ago

Right now I have added a useflag called debug and added these lines here

src_configure() {

if use debug; then
    CMAKE_BUILD_TYPE=Debug
    append-cflags -ggdb # -Werror=format-security
fi 

but this is not really working. Well, it does in fact add -ggdb cflags but the output while debugging is not really helpfull as there are no debugging symbols present in the binary.

user ~ $ gdb s25client GNU gdb (Gentoo 7.9.1 vanilla) 7.9.1 Copyright (C) 2015 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-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://bugs.gentoo.org/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from s25client...(no debugging symbols found)...done. (gdb)

stefson commented 8 years ago

Could it be that it is eventually because of the stripping that there are no debug symbols in the binaries? If so, how may I disable it?

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   usr/games/lib64/s25rttr/sound-convert
   usr/games/bin/s25client
   usr/games/lib64/s25rttr/s-c_resample
   usr/games/lib64/s25rttr/video/libvideoSDL.so
   usr/games/lib64/s25rttr/audio/libaudioSDL.so
ecompressdir: bzip2 -9 /usr/share/doc
nE0sIghT commented 8 years ago

You are going wrong non-Gentoo way. You don't need to modify ebuilds for debug support.

Just create file named something like "debug" in /etc/portage/env:

CFLAGS="-O0 -ggdb"
CXXFLAGS="${CFLAGS}"
FEATURES="${FEATURES} splitdebug"

Then create file in /etc/portage/package.env named something like "debug":

games-strategy/s25rttr debug

Then just rebuild s25rttr and you obtain debug symbols for this package.

That is well described in wiki

nE0sIghT commented 8 years ago

I will close that since there is nothing to do with ebuild. If you have some other questions please reopen.