1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 01:06:01 +02:00

Fix for bug 82858: NPE when adding global variable to variable view.

This commit is contained in:
Mikhail Khodjaiants 2005-01-19 00:12:14 +00:00
parent 796d57cf24
commit b0fe8a0287
3 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2005-01-18 Mikhail Khodjaiants
Fix for bug 82858: NPE when adding global variable to variable view.
* CDebugTarget.java
* CVariableFactory.java
2005-01-18 Mikhail Khodjaiants
Fix for bug 82800: Make "Resume At Line" action retargettable.
CDebugElement should provide an adapter to ICDebugTarget.

View file

@ -1786,7 +1786,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
public ICGlobalVariable createGlobalVariable( IGlobalVariableDescriptor info ) throws DebugException {
ICDIVariableDescriptor vo = null;
try {
vo = getCDITarget().getGlobalVariableDescriptors(info.getPath().lastSegment(), null, info.getName());
vo = getCDITarget().getGlobalVariableDescriptors( info.getPath().lastSegment(), null, info.getName() );
}
catch( CDIException e ) {
throw new DebugException( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), DebugException.TARGET_REQUEST_FAILED, (vo != null) ? vo.getName() + ": " + e.getMessage() : e.getMessage(), null ) ); //$NON-NLS-1$

View file

@ -34,7 +34,7 @@ public class CVariableFactory {
}
public static IGlobalVariableDescriptor createGlobalVariableDescriptor( final String name, final IPath path ) {
return new IGlobalVariableDescriptor() {
public String getName() {
@ -42,7 +42,7 @@ public class CVariableFactory {
}
public IPath getPath() {
return path;
return ( path != null ) ? path : new Path( "" ); //$NON-NLS-1$
}
public String toString() {
@ -60,7 +60,7 @@ public class CVariableFactory {
return createGlobalVariableDescriptor( var.getElementName(), path );
}
public static IGlobalVariableDescriptor createGlobalVariableDescriptor(ISymbol symbol) {
public static IGlobalVariableDescriptor createGlobalVariableDescriptor( ISymbol symbol ) {
return createGlobalVariableDescriptor( symbol.getName(), symbol.getFilename() );
}