On Wed, Jun 09, 2010 at 10:17:28PM -0700, Gene Auyeung wrote:
On Wed, Jun 9, 2010 at 10:01 PM, Kris Maglione <maglion...@gmail.com> wrote:
On Wed, Jun 09, 2010 at 12:50:06PM -0700, Gene Auyeung wrote:

Hi,

For a while I've been frustrated when I close a surf window, it takes
down the process that created it, along with all windows of that
process.  For clicking a link in gmail will open a new window, and
closing that window sometimes closes the parent window as well.  Today
I had some time to insert printfs into surf.c to find out what's going
on.

Why don't you just use gdb (apart from the fact that surf doesn't build with
debugging information by default)?

Apart from not knowing how to use gdb beyond the basics, surf's code
is clean/simple enough that printing debug statements work.  But yes,
good suggestion.

That's really not the point. gdb would have told you where the program crashed and why in about two seconds in this kind of scenario (assuming you had debugging information, which you hadn't), whereas debug statements would have taken minutes on the low end. Plus, the backtrace probably would have told one of us what was wrong without any further back and forth.

Anyway, it's simple. Add -g to your CFLAGS and LDFLAGS. When you get a core, run:

%gdb $(which surf) surf.core
...
(gdb) bt full

Then you know where, when, and likely why the program crashed. And, if you don't, post it here and someone will tell you.

It might also be profitable to brow beat someone into adding debug flags to the default build flags in hg, along the way...

--
Kris Maglione

Only the educated are free.
        --Epictetus


Reply via email to