mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 123745: Disassembly view can get into endless loop.
This commit is contained in:
parent
e4b95eaf7d
commit
ecb9f13ea8
2 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-01-15 Mikhail Khodjaiants
|
||||
Bug 123745: Disassembly view can get into endless loop.
|
||||
* DisassemblyBlock.java
|
||||
|
||||
2006-01-04 Mikhail Khodjaiants
|
||||
Bug 118900: Display libraries loaded in post-mortem debug.
|
||||
* CDebugTarget.java
|
||||
|
|
|
@ -163,7 +163,7 @@ public class DisassemblyBlock implements IDisassemblyBlock, IAdaptable {
|
|||
element = ((ICSourceLocator)locator).findSourceElement( fileName );
|
||||
}
|
||||
fSourceElement = element;
|
||||
File file= null;
|
||||
File file = null;
|
||||
if ( element instanceof IFile ) {
|
||||
file = ((IFile)element).getLocation().toFile();
|
||||
}
|
||||
|
@ -180,16 +180,21 @@ public class DisassemblyBlock implements IDisassemblyBlock, IAdaptable {
|
|||
}
|
||||
for ( int i = 0; i < result.length; ++i ) {
|
||||
String text = null;
|
||||
boolean failed = false;
|
||||
int lineNumber = mi[i].getLineNumber();
|
||||
if ( reader != null ) {
|
||||
while( reader.getLineNumber() + 1 < lineNumber ) {
|
||||
try {
|
||||
reader.readLine();
|
||||
if ( reader.readLine() == null ) {
|
||||
// break if the end of file is reached (see bug #123745)
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch( IOException e ) {
|
||||
}
|
||||
}
|
||||
if ( reader.getLineNumber() + 1 == lineNumber ) {
|
||||
if ( !failed && reader.getLineNumber() + 1 == lineNumber ) {
|
||||
try {
|
||||
text = reader.readLine() + '\n';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue