1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fixed 178485. Breakpoints can disappear from the disassembler view if they're set on the first or last line in the view.

This commit is contained in:
John Cortell 2007-03-21 06:05:36 +00:00
parent 671996ba37
commit c0c96c265c

View file

@ -145,7 +145,16 @@ public class DisassemblyAnnotationModel extends AnnotationModel {
try { try {
start = fDocument.getLineOffset( instrNumber - 1 ); start = fDocument.getLineOffset( instrNumber - 1 );
if ( start > -1 ) { if ( start > -1 ) {
return new Position( start, document.getLineLength( instrNumber - 1 ) ); // Avoid the document boundaries; see bugzilla 178485
int lineLen = document.getLineLength(instrNumber - 1);
if (start == 0) {
start++;
lineLen--;
}
if (start + lineLen == document.getLength()) {
lineLen--;
}
return new Position( start, lineLen );
} }
} }
catch( BadLocationException e ) { catch( BadLocationException e ) {