On Thu, Nov 1, 2012 at 3:57 PM, Ian Lance Taylor <i...@google.com> wrote: > On Thu, Nov 1, 2012 at 10:00 AM, Dehao Chen <de...@google.com> wrote: >> >> I see your point. How about we guard these changes with a flag, say >> -gless-jumpy, so that people can always choose between better coverage >> and less jumpy gdb behavior (it's also important for some other >> clients like AutoFDO). I will have a series of patches to follow soon >> that can be guarded by this flag. > > This feels to me like an attempt to address the problem in the wrong > place. It seems to me that it would be better to do one of: > > * Use -Og and ensure that -Og does not move the code around. > Presumably this would lead to worse runtime performance and better > performance in the debugger. > > * Add heuristics to the debugger to jump around less. > > * Add a new debug facility to mark the statement as attached to a > particular source location, but moved relative to other source > locations. Add facilities to the debugger to take that into account. > > That said, I suppose I can imagine a mode like you suggest. It > shouldn't be a -g option, it should be a -f option, like > -fdiscard-moved-insn-debug-locations or something. That would be > along the lines of -fno-var-tracking: we generate worse debug info > upon user request. >
Or have a common umbrella option to guard all changes that improves DOC. David > Ian