This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Update source location for PRE inserted stmt
> No, there is nothing natural (and this can even be wrong). The statements
> must have the source location corresponding to the source construct they are
> generated for, which may be totally different from that of the insertion
> point. Yes, that can generate jumpiness in GDB, but this is far better that
> breaking the coverage info by giving the same source location to instructions
> that have different coverage status.
For the unittest I provided, setting the inserted stmt with
* break the coverage
* increase jumpiness in gdb
Setting location to UNKNOWN_LOCATION is like setting it to random
because compiler may put this stmt as the entry point of a BB (as in
the unittest). Thus setting deterministic locations for inserted stmt
will improve debugability and reduce jumpiness.
> Eric Botcazou