1

I'm trying to use valgrind to debug, but it doesn't show the function names / file:line information, only ???

I can debug all of my binaries with gdb, access variables stored in them set breakpoints the works. So debugging symbols should be OK.

Valgrind doesn't fail on all of my libraries, just some, maybe. I have looked through each and every of them, and all of them have debugging symbols turned on.

What am I missing here?

Being a bit of a newbie, I don't know if there is any way to make GDB to try and get the function / filename:line from an address. Is there some way to do this?

0xbaadf00d
  • 2,535
  • 2
  • 24
  • 46
  • Are you sure you compiled all your libraries with -g or -gX cFlags? – CollioTV Sep 17 '14 at 09:46
  • Yes. I tried putting breakpoints into every file I have, all triggered and i was able to read variables from them. Doesn't this mean that they should work? I did read through the makefiles and they were there too. I rebuilt everything from scratch. – 0xbaadf00d Sep 17 '14 at 09:58
  • Are there any alternate ways to see if a file has debugging symbols in it or not? – 0xbaadf00d Sep 17 '14 at 09:59
  • 1
    For the last question, there's a tool called [`addr2line`](http://linux.die.net/man/1/addr2line) – Mike Seymour Sep 17 '14 at 10:10
  • @justanothercoder, if you list the sections of a binary using something like objdum or readelf, you should be able to see if there is a section for debug symbols. – doron Sep 17 '14 at 10:11
  • A little example can go a long way. – n. m. could be an AI Sep 17 '14 at 10:16
  • I would gladly give an example, but sadly am unable to for reasons I should not explain. Sorry for the mysticism. I'll look into these tools, thanks! – 0xbaadf00d Sep 17 '14 at 10:50
  • Having looked more into things I found this: http://stackoverflow.com/questions/7648642/how-to-use-addr2line-command-in-linux If i know that my memory leak happens at 0x11001145 and cross reference that with the /proc//maps file, I should find out in which library that address is? – 0xbaadf00d Sep 17 '14 at 11:30

0 Answers0