[PATCH 2/3] gdb: Don't reorder line table entries too much when sorting.

Bernd Edlinger bernd.edlinger@hotmail.de
Sat Dec 28 11:09:00 GMT 2019


On 12/26/19 11:17 PM, Andrew Burgess wrote:
> * Bernd Edlinger <bernd.edlinger@hotmail.de> [2019-12-25 11:19:50 +0000]:
> 
>> Hi,
>>
>> when I tried this patch, git am says this:
>>
>> +foreach p $patterns {
>> +    gdb_test "step" "/\\* $p \\*/" \
>> +	"step to '$p'"
>> +}
>> +
>> -- 
>> 2.14.5
>>
>> Applying: gdb: Don't reorder line table entries too much when sorting.
>> /home/ed/gnu/binutils-gdb/.git/rebase-apply/patch:294: new blank line at EOF.
>> +
>> warning: 1 line adds whitespace errors.
> 
> Thanks, I fixed two whitespace errors in this patch.
> 
>>
>>
>> I just was curious to try this patch series,
>> since this has some overlap with a patch I posted here:
>> https://sourceware.org/ml/gdb-patches/2019-11/msg00792.html
>>
>> we both want to add end_sequence here:
>>> @@ -21330,7 +21331,8 @@ lnp_state_machine::record_line (bool end_sequence)
>>>    else if (m_op_index == 0 || end_sequence)
>>>      {
>>>        fe->included_p = 1;
>>> -      if (m_record_lines_p && (producer_is_codewarrior (m_cu) || m_is_stmt))
>>> +      if (m_record_lines_p
>>> +         && (producer_is_codewarrior (m_cu) || m_is_stmt || end_sequence))
>>>         {
>>>           if (m_last_subfile != m_cu->get_builder ()->get_current_subfile ()
>>>               || end_sequence)
>>
>> I was not sure, if m_is_stmt is ever false when end_sequence is true,
>> but considered that to be safer this way too.
>> Does that actually happen?
> 
> Honestly, I didn't check.  Like you it seemed to make more sense to
> leave things as they are unless I have a good reason to change them.
> 

Neither did I, but when I add an assertion there it is obvious that
it happens rarely with gcc-4.8 but very often with gcc-10.

> Does how I wrote the test for this help you create a test for you
> patch at all?  If I can help in any way I'd be happy to try.
> 

Wow, that's a really impressive work...

I was able to write a test for the step over inline issue,
but it is dependent on the gcc version, gcc-8 or newer generate
debug info where the problem exists, but test itself passes with all
gcc versions as far as I can tell, it does just not prove much
for old gcc versions.

I posted everyting again here:
https://sourceware.org/ml/gdb-patches/2019-12/msg01052.html

In case you want to see.


Thanks
Bernd.



More information about the Gdb-patches mailing list