mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 429157: memory-changed event may not trigger an update for the
proper number of octets Change-Id: If75056bc5d7a752dfa6110affb4bd03e17b2aafa Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com> Reviewed-on: https://git.eclipse.org/r/22573 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
c558463abe
commit
d15325f7bd
1 changed files with 5 additions and 7 deletions
|
@ -96,7 +96,7 @@ public class GDBMemory_7_6 extends GDBMemory_7_0 implements IEventListener {
|
||||||
if ("memory-changed".equals(asyncClass)) { //$NON-NLS-1$
|
if ("memory-changed".equals(asyncClass)) { //$NON-NLS-1$
|
||||||
String groupId = null;
|
String groupId = null;
|
||||||
String addr = null;
|
String addr = null;
|
||||||
int length = 0;
|
int count = 0;
|
||||||
|
|
||||||
MIResult[] results = notifyOutput.getMIResults();
|
MIResult[] results = notifyOutput.getMIResults();
|
||||||
for (int i = 0; i < results.length; i++) {
|
for (int i = 0; i < results.length; i++) {
|
||||||
|
@ -114,10 +114,11 @@ public class GDBMemory_7_6 extends GDBMemory_7_0 implements IEventListener {
|
||||||
if (val instanceof MIConst) {
|
if (val instanceof MIConst) {
|
||||||
try {
|
try {
|
||||||
String lenStr = ((MIConst)val).getString().trim();
|
String lenStr = ((MIConst)val).getString().trim();
|
||||||
|
// count is expected in addressable units
|
||||||
if (lenStr.startsWith("0x")) { //$NON-NLS-1$
|
if (lenStr.startsWith("0x")) { //$NON-NLS-1$
|
||||||
length = Integer.parseInt(lenStr.substring(2), 16);
|
count = Integer.parseInt(lenStr.substring(2), 16);
|
||||||
} else {
|
} else {
|
||||||
length = Integer.parseInt(lenStr);
|
count = Integer.parseInt(lenStr);
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
assert false;
|
assert false;
|
||||||
|
@ -132,7 +133,7 @@ public class GDBMemory_7_6 extends GDBMemory_7_0 implements IEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class);
|
IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class);
|
||||||
if (procService != null && groupId != null && addr != null && length > 0) {
|
if (procService != null && groupId != null && addr != null && count > 0) {
|
||||||
IContainerDMContext containerDmc =
|
IContainerDMContext containerDmc =
|
||||||
procService.createContainerContextFromGroupId(fConnection.getContext(), groupId);
|
procService.createContainerContextFromGroupId(fConnection.getContext(), groupId);
|
||||||
|
|
||||||
|
@ -140,9 +141,6 @@ public class GDBMemory_7_6 extends GDBMemory_7_0 implements IEventListener {
|
||||||
// it send the potential IMemoryChangedEvent as we will send it ourselves (see below).
|
// it send the potential IMemoryChangedEvent as we will send it ourselves (see below).
|
||||||
final IMemoryDMContext memoryDMC = DMContexts.getAncestorOfType(containerDmc, IMemoryDMContext.class);
|
final IMemoryDMContext memoryDMC = DMContexts.getAncestorOfType(containerDmc, IMemoryDMContext.class);
|
||||||
final IAddress address = new Addr64(addr);
|
final IAddress address = new Addr64(addr);
|
||||||
// The length returned by GDB is in bytes, while the memory cache expects
|
|
||||||
// a count of number of addresses of 8 bytes.
|
|
||||||
int count = length/8 + 1;
|
|
||||||
getMemoryCache(memoryDMC).refreshMemory(memoryDMC, address, 0, 1, count, false,
|
getMemoryCache(memoryDMC).refreshMemory(memoryDMC, address, 0, 1, count, false,
|
||||||
new RequestMonitor(getExecutor(), null) {
|
new RequestMonitor(getExecutor(), null) {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue