Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] compute_reverse_lookup_indices line state question

Hello guys,

In the function "compute_reverse_lookup_indices" of dwarfcache.c we've gotten this piece of code:

> for (i = 0; i < Unit->mStatesCnt; i++) {
>         LineNumbersState * s1 = Unit->mStates + i;
>         while (i + 1 < Unit->mStatesCnt) {
>             LineNumbersState * s2 = s1 + 1;
>             if (s1->mFile != s2->mFile ||
>                 s1->mLine != s2->mLine || s1->mColumn != s2->mColumn ||
>                 s1->mFlags != s2->mFlags || s1->mISA != s2->mISA ||
> s1->mOpIndex != s2->mOpIndex || s1->mDiscriminator != s2->mDiscriminator) break; > memmove(s2, s2 + 1, sizeof(LineNumbersState) * (Unit->mStatesCnt - i - 2));
>             Unit->mStatesCnt--;
>         }
>         Unit->mStatesIndex[i] = s1;
>     }

In the Dwarf4 documentation I read:

> (...) matrix (...) We shrink it with two techniques. First, we delete from the matrix each row whose file, line, source > column and discriminator information is identical with that of its predecessors. Any deleted row would never be the
> beginning of a source statement.

I am not sure how it should be done if you've got the following sequence (of LineNumberState-s):
A
A
B
A

The algorithm in the function practically translates it to:
A
B
A

Is this behavior okay? Technically, the first A is a predecessor of the second A, is it not?

Thanks,
Samuel



Back to the top