Firefox with debug symbols - WITH_DEBUG doesn't work

Status
Not open for further replies.
Installed Firefox:
Code:
> cd /usr/ports/www/firefox
> grep WITH_DEBUG *
Makefile,v:.if defined(WITH_DEBUG)
Makefile,v:CONFIGURE_ENV+=		WITH_DEBUG=yes
Makefile,v:.endif # defined(WITH_DEBUG)
Makefile,v:* Enable basic optimizations if WITH_DEBUG is not specified
distinfo,v:* Enable basic optimizations if WITH_DEBUG is not specified
pkg-descr,v:* Enable basic optimizations if WITH_DEBUG is not specified
pkg-message,v:* Enable basic optimizations if WITH_DEBUG is not specified
> make WITH_DEBUG install
Code:
(gdb) run
Starting program: /usr/local/lib/firefox3/firefox-bin 
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging 
symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...[New LWP 100178]

Why it simply doesn't work?
 
You shouldn't have files that end in ,v in a port's directory. How did you get the ports tree?
 
There's no way to get e.g. pkg-descr,v using the default supfile. Like I said elsewhere: time to cut your losses and start over.
 
What tag did you use in your ports-supfile?

You've probably used cvs which isn't correct. It should be . (dot).

This probably explains all the problems you've been having. I'm surprised things even compiled.
 
Code:
...
*default host=cvsup.uk.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
...
Copied from share/examples.
 
That looks good. But the files in /usr/ports/www/firefox/ should NOT end in ,v. I don't know what went wrong but I think it's best to clear /usr/ports/ and csup again.
 
Code:
> sudo mv /usr/ports /usr/ports-bak
> sudo csup /etc/ports-supfile && cd /usr/ports/*/firefox && ll
-rw-r--r--  1 root  wheel  3802 Oct 28 12:46 Makefile
-rw-r--r--  1 root  wheel  8676 Jan 10  2009 Makefile.webplugins
-rw-r--r--  1 root  wheel   225 Oct 28 12:46 distinfo
drwxr-xr-x  2 root  wheel  1536 Nov  5 15:33 files
-rw-r--r--  1 root  wheel   329 Feb  7  2010 pkg-descr
-rw-r--r--  1 root  wheel  1535 Feb  7  2010 pkg-message
> grep WITH_DEBUG *
>
No more Makefile,v:)
WITH_DEBUG should work now?

Following methods:
http://developer.mozilla.org/en/Building_Firefox_with_Debug_Symbols
are already included in WITH_DEBUG? Because grep still returns empty files when looking for WITH_DEBUG inside Makefile.
 
The mozilla link is for adding debug symbols to Firefox 4.
 
kenorb said:
Code:
*default host=cvsup.uk.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
Copied for share/examples.

It's an incomplete copy of /usr/share/examples/cvsup/ports-supfile, missing all the comments and the last two working lines.
 
Note, you don't have to install firefox to debug it.
Code:
$ make WITH_DEBUG= || make DEBUG_FLAGS=-g # the latter still defines -DNDEBUG
$ cd $(make -V WRKSRC)/dist/bin
$ LD_LIBRARY_PATH=$PWD gdb ./firefox-bin
 
luna said:
Note, you don't have to install firefox to debug it.
Code:
$ make WITH_DEBUG= || make DEBUG_FLAGS=-g # the latter still defines -DNDEBUG
$ cd $(make -V WRKSRC)/dist/bin
$ LD_LIBRARY_PATH=$PWD gdb ./firefox-bin

Sure, but the problem is that Firefox is not compiled with debug symbols at all.

BTW.
Code:
> cd $(make -V WRKSRC ) /dist/bin
Illegal variable name.
> LD_LIBRARY_PATH=$PWD gdb ./firefox-bin
LD_LIBRARY_PATH=/usr/ports/www/firefox: Command not found.
Probably it's for bash? I'm using tcsh.
Version for tcsh:
Code:
cd /usr/ports/www/firefox
cd `make -V WRKSRC`/browser/app
setenv LD_LIBRARY_PATH $PWD && gdb ./firefox-bin
 
Strict to the topic, if Makefile doesn't contain special WITH_DEBUG variable, it's a ports bug?
 
With lack of responses, so here is the solution:

1.9.x branch
Code:
setenv MOZ_DEBUG_SYMBOLS 1 || export MOZ_DEBUG_SYMBOLS=1
setenv CFLAGS "-g -gfull" || export CFLAGS="-g -gfull"
setenv CXXFLAGS "-g -gfull" || export CXXFLAGS="-g -gfull"
cd /usr/ports/www/firefox && make
cd `make -V WRKSRC`/browser/app
setenv LD_LIBRARY_PATH $PWD || export LD_LIBRARY_PATH=$PWD
gdb ./firefox-bin

Newer than 1.9.x branch
Code:
setenv MOZ_DEBUG_SYMBOLS 1 || export MOZ_DEBUG_SYMBOLS=1
setenv CFLAGS "-gdwarf-2" || export CFLAGS="-gdwarf-2"
setenv CXXFLAGS "-gdwarf-2" || export CXXFLAGS="-gdwarf-2"
cd /usr/ports/www/firefox && make
cd `make -V WRKSRC`/browser/app
setenv LD_LIBRARY_PATH $PWD || export LD_LIBRARY_PATH=$PWD
gdb ./firefox-bin

My question is:
Why does it have to be so complicated?
Why WITH_DEBUG simply doesn't work (proof in #14)?

Anyway, reported the bug here:
http://www.freebsd.org/cgi/query-pr.cgi?pr=152043

My solution could be to add in Makefile:
1.9.x branch:
Code:
.if defined(WITH_DEBUG)
WITH_LOGGING= yes
CONFIGURE_ENV+= WITH_DEBUG=yes
CONFIGURE_ENV+= MOZ_DEBUG_SYMBOLS=1
CONFIGURE_ENV+= CFLAGS "-g -gfull"
CONFIGURE_ENV+= CXXFLAGS "-g -gfull"
.endif # defined(WITH_DEBUG)

Newer versions:
Code:
.if defined(WITH_DEBUG)
WITH_LOGGING= yes
CONFIGURE_ENV+= WITH_DEBUG=yes
CONFIGURE_ENV+= MOZ_DEBUG_SYMBOLS=1
CONFIGURE_ENV+= CFLAGS="-gdwarf-2"
CONFIGURE_ENV+= CXXFLAGS="-gdwarf-2"
.endif # defined(WITH_DEBUG)
But I haven't tested it.

Anyway after compiling with debug symbols, I've got another problem:
Code:
> ./firefox-bin
Error: Platform version '' is not compatible with
minVersion >= @GRE_MILESTONE@
maxVersion <= @GRE_MILESTONE@
 
kenorb said:
Sure, but the problem is that Firefox is not compiled with debug symbols at all.
It is. See WITH_DEBUG ifdef in Mk/bsd.port.mk and in Mk/bsd.gecko.mk. DEBUG_FLAGS is also used in /usr/share/mk/bsd.own.mk to leave STRIP undefined/empty.
kenorb said:
Anyway after compiling with debug symbols, I've got another problem:
Code:
> ./firefox-bin
Error: Platform version '' is not compatible with
minVersion >= @GRE_MILESTONE@
maxVersion <= @GRE_MILESTONE@
Try to cd to WRKSRC/dist/bin before running ./firefox-bin.
 
This topic has been closed. Issues as technical or detailed as this should not be discussed in general user-oriented forums like The FreeBSD Forums. These forums are intended for end-user support with installing and/or running FreeBSD and/or applications from the ports tree, not for routinely resolving low-level problems with the operating system or add-on applications. Developers and port maintainers usually do not spend much time here, and we routinely refer technically detailed questions to them.

Consider opening this topic elsewhere, e.g.:

In the case of the FreeBSD base system:

1) by posting to one of the relevant mailing lists
2) by opening a bug report

In the case of ported applications:

1) by contacting the port maintainer (run make maintainer in the port directory)
2) by opening a bug report
 
Status
Not open for further replies.
Back
Top