debug info for global variables when optimising

I see that llvm-gcc now has some support for generating debug info
when optimising - thanks!

However, it still doesn't generate debug info for global variables
when optimising. Is there any reason for this? With the attached
patch, the whole test suite passes for me with TEST=ipodbgopt.

Thanks,
Jay.

patch.globaldebug (609 Bytes)

Hi Jay,

The Debug Info work is still ongoing. And there are going to be still
more fundamental changes in the near future. However, Devang, the
person leading the effort, is on vacation now. And I don't think he's
ready for this to be enabled just yet. At least, not in top of tree.

-bw

I see that llvm-gcc now has some support for generating debug info
when optimising - thanks!

However, it still doesn't generate debug info for global variables
when optimising. Is there any reason for this? With the attached
patch, the whole test suite passes for me with TEST=ipodbgopt.

The reason is given in the comment your patch deletes. Having debug info affect the codegen is pretty bad, because you get situations where a bug goes away when you turn on debug info, and you can't debug it.

TEST=ipodbgopt currently runs through -strip-debug-declare immediately, which would hide such cases. Try it with that flag removed and I bet you'll see some failures.

patch.globaldebug (609 Bytes)

TEST=ipodbgopt currently runs through -strip-debug-declare immediately,
which would hide such cases. Try it with that flag removed and I bet you'll
see some failures.

Yes, thanks, I hadn't noticed the -strip-debug-declare.

Incidentally I only "see" the failures because some "TEST-FAIL"
messages whizz up and off the screen. The actual "make TEST=ipodbgopt"
command completes successfully. Is that intentional?

Thanks,
Jay.

Yes, AFAIK I'm the only one ever to use ipodbgopt, and that was adequate for my needs. Feel free to enhance.