> > Please take a look at the .debug_line info in your object file with > "readelf -wl test.o". I expect you will see negative advances of line > number, at the address where you see repeated source lines. This is > normal. Compilers will emit code corresponding to a single line, at > different locations. This happens even at -O0, particularly around > loops.
Yes, you are right; I did saw negative advancement. something like `advance Address by 6 to 0x36 and Line by -1 to 4`. > > So you should expect this line > for (int i = 0; i < N; ++i) { > to be repeated. > > objdump also shows some context lines before the repeated line. > That's why my_fun appears twice. We could probably fix that. That would be great. Having function head showing multiple times is quite confusing. > You'll also notice repeated source lines after the negative advance of > line number that don't actually corresponded to code at those > locations. In this case > sum += arr[i]; > We can't do much about that.. I see. Anyway, thank you very much for the work and explanation. -- Best Regards Yours faithfully Albert Netymk _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils