firefox debug symbols subpackage

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

firefox debug symbols subpackage

Landry Breuil-5
Hi,

on top of what's brewing, with the following diff i can do this:
#pkg_add debug-firefox
$egdb /usr/local/lib/firefox/firefox
Reading symbols from /usr/local/lib/firefox/firefox...Reading symbols from /usr/local/lib/firefox/.debug/firefox.dbg...done.

(gdb) b socket
Function "socket" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (socket) pending.
(gdb) r -P default-default-1 https://dns.google
Starting program: /usr/local/lib/firefox/firefox -P default-default-1 https://dns.google
[New process 85479]

Thread 1 hit Breakpoint 1, socket () at -:3
3       -: No such file or directory.
(gdb) bt
#0  socket () at -:3
#1  0x000003db7806d273 in _xcb_socket (family=1, type=1, proto=0) at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:317
#2  _xcb_open_unix (protocol=<optimized out>, file=0x3daf6035de0 "/tmp/.X11-unix/X0") at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:444
#3  _xcb_open (host=0x3daf6046560 "", protocol=0x0, display=0) at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:299
#4  xcb_connect_to_display_with_auth_info (displayname=<optimized out>, auth=0x0, screenp=0x0) at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_util.c:515
#5  0x000003dbab0274db in _XConnectXCB () from /usr/X11R6/lib/libX11.so.17.0
#6  0x000003dbab014eb3 in XOpenDisplay () from /usr/X11R6/lib/libX11.so.17.0
#7  0x000003db47bcabf5 in _gdk_x11_display_open (display_name=0x1 <error: Cannot access memory at address 0x1>) at gdkdisplay-x11.c:1565
#8  0x000003db47b96ac3 in gdk_display_manager_open_display (manager=<optimized out>, name=0x7f7ffffc0ce1 ":0.0") at gdkdisplaymanager.c:468
#9  0x000003db42df5fc9 in XRE_mainStartup () at /usr/ports/pobj/firefox-70.0.1/firefox-70.0.1/toolkit/xre/nsAppRunner.cpp:3826
#10 0x000003db42dfb995 in XRE_main () at /usr/ports/pobj/firefox-70.0.1/firefox-70.0.1/toolkit/xre/nsAppRunner.cpp:4705
#11 0x000003db42dfbfcb in XRE_main () at /usr/ports/pobj/firefox-70.0.1/firefox-70.0.1/toolkit/xre/nsAppRunner.cpp:4799
#12 0x000003d8b300b753 in do_main () at /usr/ports/pobj/firefox-70.0.1/firefox-70.0.1/browser/app/nsBrowserApp.cpp:218
#13 main () at /usr/ports/pobj/firefox-70.0.1/firefox-70.0.1/browser/app/nsBrowserApp.cpp:300

sometimes egdb blows with an internal error, receives SIGPIPE or SIGABRT or SIGTRAP, but sometimes it works !

90.7M   /usr/ports/packages/amd64/all/debug-firefox-70.0.1.tgz
63.2M   /usr/ports/packages/amd64/all/firefox-70.0.1.tgz

361M    /usr/local/lib/firefox/.debug

Landry

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/mozilla-firefox/Makefile,v
retrieving revision 1.401
diff -u -r1.401 Makefile
--- Makefile    31 Oct 2019 22:52:20 -0000      1.401
+++ Makefile    10 Nov 2019 13:03:30 -0000
@@ -68,6 +68,18 @@
 CONFIGURE_ARGS +=      --with-libclang-path=${LOCALBASE}/lib
 SUBST_VARS +=  LOCALBASE X11BASE
 
+DEBUG_PACKAGES =         -
+DEBUG_CONFIGURE_ARGS +=        --enable-debug-symbols=-ggdb1 \
+                       --disable-install-strip
+DEBUG_FILES =  lib/${MOZILLA_PROJECT}/${MOZILLA_PROJECT} \
+               lib/${MOZILLA_PROJECT}/plugin-container \
+               lib/${MOZILLA_PROJECT}/gtk2/libmozgtk.so.${LIBmozgtk_VERSION} \
+               lib/${MOZILLA_PROJECT}/liblgpllibs.so.${LIBlgpllibs_VERSION} \
+               lib/${MOZILLA_PROJECT}/libmozavcodec.so.${LIBmozavcodec_VERSION} \
+               lib/${MOZILLA_PROJECT}/libmozavutil.so.${LIBmozavutil_VERSION} \
+               lib/${MOZILLA_PROJECT}/libmozgtk.so.${LIBmozgtk_VERSION} \
+               lib/${MOZILLA_PROJECT}/libxul.so.${LIBxul_VERSION}
+
 show-commit:
        @curl -s https://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MOZILLA_VERSION}/SOURCE| awk -F / '/^https:\/\/hg/ {print $$7 }'

Index: pkg/PLIST-debug
===================================================================
RCS file: pkg/PLIST-debug
diff -N pkg/PLIST-debug
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-debug     10 Nov 2019 13:17:00 -0000
@@ -0,0 +1,9 @@
+@comment $OpenBSD$
+lib/${MOZILLA_PROJECT}/.debug/${MOZILLA_PROJECT}.dbg
+lib/${MOZILLA_PROJECT}/.debug/plugin-container.dbg
+lib/${MOZILLA_PROJECT}/gtk2/.debug/libmozgtk.so.${LIBmozgtk_VERSION}.dbg
+lib/${MOZILLA_PROJECT}/.debug/liblgpllibs.so.${LIBlgpllibs_VERSION}.dbg
+lib/${MOZILLA_PROJECT}/.debug/libmozavcodec.so.${LIBmozavcodec_VERSION}.dbg
+lib/${MOZILLA_PROJECT}/.debug/libmozavutil.so.${LIBmozavutil_VERSION}.dbg
+lib/${MOZILLA_PROJECT}/.debug/libmozgtk.so.${LIBmozgtk_VERSION}.dbg
+lib/${MOZILLA_PROJECT}/.debug/libxul.so.${LIBxul_VERSION}.dbg