mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Fix for bug 82858: NPE when adding global variable to variable view.
This commit is contained in:
parent
796d57cf24
commit
b0fe8a0287
3 changed files with 9 additions and 4 deletions
|
@ -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
|
2005-01-18 Mikhail Khodjaiants
|
||||||
Fix for bug 82800: Make "Resume At Line" action retargettable.
|
Fix for bug 82800: Make "Resume At Line" action retargettable.
|
||||||
CDebugElement should provide an adapter to ICDebugTarget.
|
CDebugElement should provide an adapter to ICDebugTarget.
|
||||||
|
|
|
@ -1786,7 +1786,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
|
||||||
public ICGlobalVariable createGlobalVariable( IGlobalVariableDescriptor info ) throws DebugException {
|
public ICGlobalVariable createGlobalVariable( IGlobalVariableDescriptor info ) throws DebugException {
|
||||||
ICDIVariableDescriptor vo = null;
|
ICDIVariableDescriptor vo = null;
|
||||||
try {
|
try {
|
||||||
vo = getCDITarget().getGlobalVariableDescriptors(info.getPath().lastSegment(), null, info.getName());
|
vo = getCDITarget().getGlobalVariableDescriptors( info.getPath().lastSegment(), null, info.getName() );
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
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$
|
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$
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class CVariableFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IGlobalVariableDescriptor createGlobalVariableDescriptor( final String name, final IPath path ) {
|
public static IGlobalVariableDescriptor createGlobalVariableDescriptor( final String name, final IPath path ) {
|
||||||
|
|
||||||
return new IGlobalVariableDescriptor() {
|
return new IGlobalVariableDescriptor() {
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -42,7 +42,7 @@ public class CVariableFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getPath() {
|
public IPath getPath() {
|
||||||
return path;
|
return ( path != null ) ? path : new Path( "" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -60,7 +60,7 @@ public class CVariableFactory {
|
||||||
return createGlobalVariableDescriptor( var.getElementName(), path );
|
return createGlobalVariableDescriptor( var.getElementName(), path );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IGlobalVariableDescriptor createGlobalVariableDescriptor(ISymbol symbol) {
|
public static IGlobalVariableDescriptor createGlobalVariableDescriptor( ISymbol symbol ) {
|
||||||
return createGlobalVariableDescriptor( symbol.getName(), symbol.getFilename() );
|
return createGlobalVariableDescriptor( symbol.getName(), symbol.getFilename() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue