Science Forums
User Name
Password
Science Social Network
home    members    help/rules    who is online    contact   

Go Back   Science Forums > Physical Sciences Forums > Computer Science
Become a science forums sponsor today
Reply
 
LinkBack Thread Tools
Old 07-29-2007   #1 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



Gdb and make?

The program I'm using uses a makefile to compile (not written by me no idea of how to do this...), now I changed the program a bit around and get a segmentation fault. For this reason I would like to use gdb for debugging, but to have its full functionality (for example line numbers) I would need to compile with g++ with the option -g. Is this right?

So far it seems anyway the fault occurs in the gsl-files so backtrace won't bring much even if I have line numbers, because for it is not the gsl files having a bug, but mine... I just thought having all the symbol tables would give a bit more chances to find the bug...

EDIT: in case the Makefile can be found in the cmbeasy code downloadable from CMBEASY


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 07-31-2007   #2 (permalink)
alexander's Avatar
Resident USSRian

Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member

Latest blog entry:
Open-Source HIDS
 
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
 



Re: Gdb and make?

First try the g++ -ggdb infile -o outfile
Then if there is an error in linking try a -lm option at the end of the line.
And you dont ignore warnings if you get them, use a -Wall option to see all the warnings that come up during your compile, and try really hard to fix them.

and then finally if none of that fixes the issue, try to iterate through your program with gdb, hopefully it will narrow down where the mistake is...


----------------
And remember that great question that Pierre-Simon Laplace and Sir Isaac Newton, Andrei Markov and David Hilbert, Richard Feynman and Enrico Fermi, Albert Einstein and Edmund Halley did not come to ask throughout all of their dedication and work: "Who the hell is IMing me?"


This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Old 08-01-2007   #3 (permalink)
sanctus's Avatar
Resident Diabolist

Hypography Staff Member
Administrator

 



Re: Gdb and make?

Yesterday I went to see one of my profs and that is actually what we did somewhere in the makefile there were some FLAGS defined conaining already -Wall etc and we just added -ggdb. Thanks very much anyway.


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
SpaceShipOne...will they make it? Tormod Space 7 07-28-2007 02:11 PM
Can Man Make Life? NLN Biology 0 06-30-2007 05:11 PM
What you make of these Mathmatics. arkain101 Physics and Mathematics 2 03-09-2007 08:19 PM
Physics. What do you make of this? arkain101 Strange Claims Forum 4 12-26-2005 03:45 AM
A new way to make the blinds see Aki Medical Science 0 12-22-2004 10:43 PM


All times are GMT -8. The time now is 11:36 AM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network