r236059 - Debug Info: Represent local anonymous unions as anonymous unions

Adrian Prantl aprantl at apple.com
Wed Apr 29 10:48:53 PDT 2015


> On Apr 29, 2015, at 10:04 AM, Eric Christopher <echristo at gmail.com> wrote:
> 
> 
> 
> On Wed, Apr 29, 2015 at 9:58 AM Eric Christopher <echristo at gmail.com <mailto:echristo at gmail.com>> wrote:
> On Wed, Apr 29, 2015 at 8:20 AM Adrian Prantl <aprantl at apple.com <mailto:aprantl at apple.com>> wrote:
> 
> > On Apr 28, 2015, at 6:26 PM, David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> wrote:
> 
> > Could you revert & I'll look into getting you a reduced test case/demonstration of the issue? (can you run GDB 7.5? Perhaps a simple test case would demonstrate the issue if you're lucky, otherwise I can reduce one from the failing test case)
> 
> I reverted the commit in r236110. I probably won’t need a reduction — my guess from the log is that gdb expects a local variable to be present.
> 
> My suggestion is to emit local artificial shadow variables and then weaken the Verifier to not verify artificial variables. In a next step, we could use the new debugger tuning target feature to make the artificial local variables and the weakened verifier a gdb-specific behavior, file a bug against gdb, and eventually remove it altogether.
> 
> 
> FWIW I don't want to use the "tuning" parameters to also affect correctness.
> 
> OK. Dave and I debated this a little in person, here's a proposal:
> 
> by default it will have the gdb specific behavior, but if you're tuning for lldb (or any other debugger I guess?) it won't be there.
> 
> Thoughts?

I think it’s a fair assumption that many debuggers won’t deal very well with anonymous local variables, from that perspective this is the right decision.
(Nitpick: If it is only needed for GDB then it doesn’t seem right to make it the global default, because tuning for gdb will be the default on all non-lldb/sce platforms anyway.)

I really want to push towards making the debug info handling stricter, so I’m unhappy about having the frontend willfully emit broken IR at the moment. But, I also haven’t found a way to emit the local shadow variables in a way that makes the verifier happy and isn’t entirely gross in other respects. I’ll keep looking for a better way to emit this without having to relax the verifier.

-- adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150429/c3d8f37c/attachment.html>


More information about the cfe-commits mailing list