Fix line_table::find_address when the address is the last entry#25
Fix line_table::find_address when the address is the last entry#25boyou wants to merge 1 commit intoaclements:masterfrom
Conversation
aclements
left a comment
There was a problem hiding this comment.
According to the DWARF spec, "Every line number program sequence must end with a
DW_LNE_end_sequence instruction which creates a row whose address is that of the byte
after the last target machine instruction of the sequence." That suggests that, in standards-conforming DWARF, this new code should never trigger because the last entry will always have end_sequence set. Do you have a binary that doesn't satisfy this? What was it built with?
Of course, it's good to follow Postel's law. :) I'm fine with this change as long as we're sure that's what's going on and the new code is commented with something like "Standards-conforming DWARF should always end with an end_sequence, but some tools omit this. Pretend there's an end_sequence one byte past the last entry."
|
@aclements , I'm not sure this is about non standard conforming binaries. For the sample program if I compile with ` IIUC, 0x004004fa corresponds to line 10 (the ending brace for the Without the change, Does it mean the end sequence is missing, or do I get anything wrong? |
|
I'm not sure how to interpret that line number table dump you pasted. It looks like it's already been rather processed, which makes it hard to tell what's going on at a low level. The "ET" on the last line suggests there is an |
If this extra check is missing, in case the last valid entry in the line table matches the given address,
endwill still be returned.