On Thu, Nov 1, 2012 at 4:16 PM, Dehao Chen <de...@google.com> wrote:
> On Thu, Nov 1, 2012 at 4:07 PM, Xinliang David Li <davi...@google.com> wrote:
>> 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.
>
> I don't see why debug info would be worse if we add something like
> -fdiscard-moved-insn-debug-locations, as long as it is not turned on
> by default. Any thoughts?
>
>>>
>>
>> Or have a common umbrella option to guard all changes that improves DOC.
>
> Is it like -Og approach as Ian mentioned? Yes, we can sacrifice some
> performance (maybe 5%?) to get more accurate source level profile. But
> if we plan to use AutoFDOed binary to collect AutoFDO profile, it'll
> suffer the same debug problem again...

No not the same as -Og -- DOC means debugging for fully optimized code.

David


>
> Thanks,
> Dehao
>
>>
>> David
>>
>>
>>
>>> Ian

Reply via email to