Jump to content
  • Advertisement
Sign in to follow this  
NIm

debugging

This topic is 4856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Occasionally, usually when I do a partial compile with make, gdb doesn't have symbol tables, and I get a memory address instaead of a line number. here is my makefile:
yarl: main.o mapgen.o mersenne.o
	g++ -onimrl -lncurses -lefence main.o mapgen.o mersenne.o

main.o: nimrl.cpp nimrl.h
	g++ -c -ggdb -omain.o nimrl.cpp

magpgen.o: mapgen.cpp nimrl.h
	g++ -c -ggdb -omapgen.o mapgen.cpp

mersenne.o: mersenne.cpp
	g++ -c -ggdb -omersenne.o mersenne.cpp

clean:
	rm -rf *.o nimrl



I noticed that if I do a make clean before make, it works correctly. but if I do that, I might as well be using a script! Thanks in advance [Edited by - NIm on July 25, 2005 8:23:50 PM]

Share this post


Link to post
Share on other sites
Advertisement

g++ -onimrl -lncurses -lefence main.o mapgen.o mersenne.o



g++, version 3.3.5

[Edited by - NIm on July 26, 2005 9:31:58 PM]

Share this post


Link to post
Share on other sites
g++ isn't a linker. g++ will call a linker when you ask it to link files like that. To find out what linker g++ is calling try using g++ -Xlinker --version

Share this post


Link to post
Share on other sites
ld version 2.15. sorry.

something else I noticed was that as my code is now, it segfaults and there's no line number info, but make clean, make and it doesn't even segfault, but there is line number info.

[Edited by - NIm on July 26, 2005 10:52:31 PM]

Share this post


Link to post
Share on other sites
Sounds like you've missed a dependency or so in the makefile. That's often the problem when you get different results from partial makes compared to complete makes.

Share this post


Link to post
Share on other sites
I've done somehting else wrong, cause now no line number info is in at all. the following command compiles debug info in

g++ -lncurses -onimrl nimrl.cpp mapgen.cpp mersenne.cpp


[Edited by - NIm on July 27, 2005 9:49:22 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!