1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 09:55:29 +02:00

Bug 317226: Disassembly view throws NPE when debugging with CDI. Fix also NPE when getting frame address

This commit is contained in:
Teodor Madan 2010-06-18 16:11:44 +00:00
parent 931bdcb29a
commit bb9485981f

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
import java.math.BigInteger;
import org.eclipse.cdt.core.IAddress;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
@ -99,7 +100,12 @@ public class CDIDisassemblyRetrieval implements IDisassemblyRetrieval {
Runnable op= new Runnable() {
public void run() {
if (stackFrame instanceof ICStackFrame) {
addressRequest.setAddress(((ICStackFrame)stackFrame).getAddress().getValue());
IAddress address = ((ICStackFrame)stackFrame).getAddress();
if (address != null ) {
addressRequest.setAddress(address.getValue());
} else {
addressRequest.setStatus(new Status(IStatus.ERROR, CDebugUIPlugin.getUniqueIdentifier(), "Internal error: Cannot retrieve frame address")); //$NON-NLS-1$
}
} else {
addressRequest.cancel();
}