0

When I use g++ with -g on, AMD CodeAnalyst shows no Symbol information, and Very Sleepy crashes. However, if I compile it without debug information, Very Sleepy runs but of course, no symbols.

I tried to use MSVC and it works perfectly fine, all symbols are there. However I don't want to use it. I wonder why g++ has such an issue.

I use g++ version 4.7.2, VC10 MSVC compiler, CodeAnalyst 3.4.1037.838, Very Sleepy 0.82. Pretty much everything is up to date.

Thanks!

Edit: I created a hello world project

void hede()
{
    while(1);
}

int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    hede();
    return 0;
}

Very sleepy crashes and CodeAnalyst still have no symbols. I suspect a bug here? enter image description here

Halil
  • 2,076
  • 1
  • 22
  • 30
  • Don't you need `-pg` for profiling? – chris Dec 10 '12 at 19:37
  • Most profilers say -g is enough. I tried -pg as well but the same result. – Halil Dec 10 '12 at 19:43
  • Do you turn off optimization? It makes much more debug info, and I remember that for some options it is not even guaranteed to work reliably with -g. Try gdb or perf, do they show symbols? – queen3 Dec 10 '12 at 19:49
  • Do you use g++ on linux or windows? VerySleepy is win-only, right? – queen3 Dec 10 '12 at 19:56
  • @queen3 optimization level is -O0. GDB shows symbols, no problem with that. I use Windows btw. Does MSVC work with Linux? – Halil Dec 10 '12 at 20:00
  • No MSVC does not, but first I thought you are cross-compiling (and profiling). I wonder if -g on win generates .pdb files. See here: http://www.bytetalk.net/2010/07/how-to-generate-seperate-g-symbol-file.html – queen3 Dec 10 '12 at 20:12

1 Answers1

0

Do you generate .pdb files? See http://www.bytetalk.net/2010/07/how-to-generate-seperate-g-symbol-file.html

queen3
  • 15,333
  • 8
  • 64
  • 119
  • I now tried. `Reading symbols from c:\Users\HalilCan\workspace\UCT\Debug\uct.exe...Reading symbols from c:\Users\HalilCan\workspace\UCT\Debug\uct.debug...done.` Didn't help. Very sleepy still crashes, CodeAnalyst have no symbols. – Halil Dec 10 '12 at 20:29