mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[254665] [disassembly] Invalid thread access SWT exception seen in log.
This commit is contained in:
parent
f6e946df29
commit
93595b208c
2 changed files with 11 additions and 12 deletions
|
@ -2428,9 +2428,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
updatePC(PC_UNKNOWN);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
});
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2442,9 +2442,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
updatePC(PC_RUNNING);
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
});
|
||||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ import org.eclipse.jface.text.BadLocationException;
|
|||
*/
|
||||
public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
|
||||
|
||||
/** Maximum width of column (in characters) */
|
||||
private static final int MAXWIDTH= 40;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
|
@ -39,9 +42,13 @@ public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
|
|||
AddressRangePosition pos = doc.getDisassemblyPosition(offset);
|
||||
if (pos instanceof DisassemblyPosition && pos.length > 0 && pos.offset == offset && pos.fValid) {
|
||||
DisassemblyPosition disassPos = (DisassemblyPosition)pos;
|
||||
int length = disassPos.fFunction.length;
|
||||
if (length > MAXWIDTH) {
|
||||
return "..." + new String(disassPos.fFunction, length - MAXWIDTH + 3, MAXWIDTH - 3); //$NON-NLS-1$
|
||||
}
|
||||
return new String(disassPos.fFunction);
|
||||
} else if (pos != null && !pos.fValid) {
|
||||
return DOTS.substring(0, doc.getMaxFunctionLength());
|
||||
return DOTS.substring(0, Math.min(MAXWIDTH, doc.getMaxFunctionLength()));
|
||||
}
|
||||
} catch (BadLocationException e) {
|
||||
// silently ignored
|
||||
|
@ -52,15 +59,7 @@ public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
|
|||
@Override
|
||||
protected int computeNumberOfCharacters() {
|
||||
DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
|
||||
return doc.getMaxFunctionLength();
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.source.IVerticalRulerColumn#getWidth()
|
||||
*/
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return super.getWidth();
|
||||
return Math.min(MAXWIDTH, doc.getMaxFunctionLength());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue