mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bugzillas 306829 & 305129.
Randy
This commit is contained in:
parent
dc598d5a5d
commit
5a2bd63d5e
3 changed files with 17 additions and 8 deletions
|
@ -374,12 +374,15 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getAddressSpacePrefix()
|
private String getAddressSpacePrefix()
|
||||||
|
{
|
||||||
|
if(fGotoAddressSpaceControl.isVisible())
|
||||||
{
|
{
|
||||||
String prefixes[] = (String[]) fGotoAddressSpaceControl.getData(KEY_ADDRESS_SPACE_PREFIXES);
|
String prefixes[] = (String[]) fGotoAddressSpaceControl.getData(KEY_ADDRESS_SPACE_PREFIXES);
|
||||||
if(prefixes.length > 0)
|
if(prefixes != null && prefixes.length > 0)
|
||||||
{
|
{
|
||||||
return prefixes[fGotoAddressSpaceControl.getSelectionIndex()];
|
return prefixes[fGotoAddressSpaceControl.getSelectionIndex()];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class BufferedMemoryWriter
|
||||||
byte[] dataRemainder = new byte[data.length - length];
|
byte[] dataRemainder = new byte[data.length - length];
|
||||||
System.arraycopy(data, length, dataRemainder, 0, data.length - length);
|
System.arraycopy(data, length, dataRemainder, 0, data.length - length);
|
||||||
data = dataRemainder;
|
data = dataRemainder;
|
||||||
address = fBufferStart.add(BigInteger.valueOf(length));
|
address = address.add(BigInteger.valueOf(length));
|
||||||
}
|
}
|
||||||
else if(fBufferStart.add(BigInteger.valueOf(fBufferPosition)).compareTo(address) != 0)
|
else if(fBufferStart.add(BigInteger.valueOf(fBufferPosition)).compareTo(address) != 0)
|
||||||
{
|
{
|
||||||
|
@ -51,15 +51,15 @@ public class BufferedMemoryWriter
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int availableBufferLength = fBuffer.length - fBufferPosition;
|
int availableBufferLength = fBuffer.length - fBufferPosition;
|
||||||
int length = data.length <= fBuffer.length - availableBufferLength
|
int length = data.length <= availableBufferLength
|
||||||
? data.length : fBuffer.length - availableBufferLength;
|
? data.length : availableBufferLength;
|
||||||
System.arraycopy(data, 0, fBuffer, fBufferPosition, length);
|
System.arraycopy(data, 0, fBuffer, fBufferPosition, length);
|
||||||
fBufferPosition += length;
|
fBufferPosition += length;
|
||||||
|
|
||||||
byte[] dataRemainder = new byte[data.length - length];
|
byte[] dataRemainder = new byte[data.length - length];
|
||||||
System.arraycopy(data, length, dataRemainder, 0, data.length - length);
|
System.arraycopy(data, length, dataRemainder, 0, data.length - length);
|
||||||
data = dataRemainder;
|
data = dataRemainder;
|
||||||
address = fBufferStart.add(BigInteger.valueOf(length));
|
address = address.add(BigInteger.valueOf(length));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fBufferPosition == fBuffer.length)
|
if(fBufferPosition == fBuffer.length)
|
||||||
|
|
|
@ -349,7 +349,13 @@ public class SRecordImporter implements IMemoryImporter {
|
||||||
addressSize = 2;
|
addressSize = 2;
|
||||||
else if("S2".equals(recordType)) //$NON-NLS-1$
|
else if("S2".equals(recordType)) //$NON-NLS-1$
|
||||||
addressSize = 3;
|
addressSize = 3;
|
||||||
|
else if("S0".equals(recordType) || "S5".equals(recordType) ||"S7".equals(recordType) ||
|
||||||
|
"S8".equals(recordType) || "S9".equals(recordType) ) //$NON-NLS-1$
|
||||||
|
{ // ignore S0, S5, S7, S8 and S9 records
|
||||||
|
line = reader.readLine();
|
||||||
|
lineNo++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
recordAddress = new BigInteger(line.substring(position, position + addressSize * 2), 16);
|
recordAddress = new BigInteger(line.substring(position, position + addressSize * 2), 16);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue