Opened 17 years ago

Last modified 14 years ago

#3589 closed enhancement

New compile-type: release-dbg — at Initial Version

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: MythTV - General Version: head
Severity: medium Keywords:
Cc: cardoe@… Ticket locked: no

Description

The attached patch adds a new compile-type which I've called release-dbg. This is a release compile with debug (-g) and utilising the .gnu_debuglink tag. The objdump man page has the details but essentially what happens is:

  • everything is built with -g
  • after linking all the debug symbols are stripped out of the binary to a .dbg file
  • a .gnu_debuglink tag is added to the binary which points to the .dbg file

This should help analysis of core files and for those instances when you really need to run the release version under gdb.

Caveats:

  • The resulting binaries are a little bit bigger (about 7%) but still not as big as a debug build
  • The optimiser is still on so whilst source level debugging is definitely possible it can be a bit hard to follow sometimes
  • To actually use the .dbg files in gdb you need to copy them to the same location of the binaries. I haven't added any logic to do this during 'make install' partially because not everyone will need them all the time, but mostly because I am lazy.
  • I don't really know what I am doing with gmake - I just hacked this in. I'm sure in its current state this patch breaks other builds (e.g. mac).

Here a little proof that it works:

myth_master mythtv # objdump -e which mythbackend objdump: /usr/local/bin/mythbackend: no recognized debugging information myth_master mythtv # find . -name "*dbg" -type f -exec ln -s pwd/{} /usr/local/bin \; myth_master mythtv # gdb which mythbackend pidof mythbackend GNU gdb 6.6 Copyright (C) 2006 Free Software Foundation, Inc. <...> Loaded symbols for /lib/libnss_files.so.2 0x00002b5e926cc852 in select () from /lib/libc.so.6 (gdb) bt #0 0x00002b5e926cc852 in select () from /lib/libc.so.6 #1 0x00002b5e913ed8e0 in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3 #2 0x00002b5e9144b382 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3 #3 0x00002b5e9144b232 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3 #4 0x0000000000443cfe in main (argc=6, argv=<value optimized out>) at main.cpp:670 #5 0x00002b5e92634134 in libc_start_main () from /lib/libc.so.6 #6 0x0000000000411bb9 in _start () (gdb) frame 4 #4 0x0000000000443cfe in main (argc=6, argv=<value optimized out>) at main.cpp:670 670 a.exec(); (gdb) list 665 } 666 } 667 668 StorageGroup::CheckAllStorageGroupDirs?(); 669 670 a.exec(); 671 672 gContext->LogEntry?("mythbackend", LP_INFO, "MythBackend? exiting", ""); 673 cleanup(); 674 (gdb) [1]+ Stopped gdb which mythbackend pidof mythbackend myth_master mythtv # ls -la /proc/pidof gdb/fd/ total 0 dr-x------ 2 root root 0 Jun 9 16:50 . dr-xr-xr-x 5 root root 0 Jun 9 16:50 .. lrwx------ 1 root root 64 Jun 9 16:50 0 -> /dev/pts/1 lrwx------ 1 root root 64 Jun 9 16:50 1 -> /dev/pts/1 lrwx------ 1 root root 64 Jun 9 16:50 2 -> /dev/pts/1 lr-x------ 1 root root 64 Jun 9 16:50 3 -> pipe:[224917] l-wx------ 1 root root 64 Jun 9 16:50 4 -> pipe:[224917] lr-x------ 1 root root 64 Jun 9 16:50 5 -> /usr/local/bin/mythbackend lr-x------ 1 root root 64 Jun 9 16:50 7 -> /root/Software/mythtv/trunk/mythtv/programs/mythbackend/mythbackend.dbg myth_master mythtv #

Change History (1)

Changed 17 years ago by rd.mora@…

Attachment: patch_release-dbg.diff added

Patch for new "release-dbg" compile-type.

Note: See TracTickets for help on using tickets.