Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied: CDT_1_1 Fix PR 36909 and NPE in the debugger

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.173
diff -u -r1.173 ChangeLog
--- ChangeLog	23 Apr 2003 17:51:24 -0000	1.173
+++ ChangeLog	29 Apr 2003 20:20:28 -0000
@@ -1,3 +1,11 @@
+2003-04-25 Mikhail Khodjaiants
+	Fix for bug 36909
+	* DisassemblyManager.java: check if the address of a stack frame is not 0;
+
+2003-04-23 Mikhail Khodjaiants
+	Check for null pointer in 'isCharacter' and 'isCharPointer'.
+	* CValue.java
+
 2003-04-23 Mikhail Khodjaiants
 	Throw DebugException when getSignals() fails.
 	* CSignalManager.java
Index: src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java,v
retrieving revision 1.19
diff -u -r1.19 CStackFrame.java
--- src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java	7 Apr 2003 22:36:57 -0000	1.19
+++ src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java	29 Apr 2003 20:20:28 -0000
@@ -208,13 +208,14 @@
 	{
 		ICDILocation location = getCDIStackFrame().getLocation();
 		String name = new String();
-		if ( location.getFunction() != null )
+		if ( location.getFunction() != null && location.getFunction().trim().length() > 0 )
 			name += location.getFunction() + "() ";
-		if ( location.getFile() != null )
+		if ( location.getFile() != null && location.getFile().trim().length() > 0 )
+		{
 			name += "at " + location.getFile() + ":" ;
-		if ( location.getLineNumber() != 0 )
-			name += location.getLineNumber();
-			
+			if ( location.getLineNumber() != 0 )
+				name += location.getLineNumber();
+		}			
 		return name.toString();
 	}
 
Index: src/org/eclipse/cdt/debug/internal/core/model/CValue.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CValue.java,v
retrieving revision 1.20
diff -u -r1.20 CValue.java
--- src/org/eclipse/cdt/debug/internal/core/model/CValue.java	21 Apr 2003 15:07:19 -0000	1.20
+++ src/org/eclipse/cdt/debug/internal/core/model/CValue.java	29 Apr 2003 20:20:28 -0000
@@ -284,9 +284,10 @@
 	
 	public boolean isCharPointer()
 	{
-		String value = getUnderlyingValueString().trim();
+		String value = getUnderlyingValueString();
 		if ( value != null )
 		{
+			value = value.trim();
 			return ( value.startsWith( "0x" ) && value.indexOf( ' ' ) != -1 );
 		}
 		return false;
@@ -294,10 +295,10 @@
 
 	public boolean isCharacter()
 	{
-		String value = getUnderlyingValueString().trim();
+		String value = getUnderlyingValueString();
 		if ( value != null )
 		{
-			return ( value.endsWith( "\'" ) );
+			return ( value.trim().endsWith( "\'" ) );
 		}
 		return false;
 	}
Index: src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java,v
retrieving revision 1.8
diff -u -r1.8 DisassemblyManager.java
--- src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java	10 Jan 2003 19:36:42 -0000	1.8
+++ src/org/eclipse/cdt/debug/internal/core/sourcelookup/DisassemblyManager.java	29 Apr 2003 20:20:28 -0000
@@ -102,14 +102,17 @@
 		if ( frameInfo != null )
 		{
 			long address = frameInfo.getAddress();
-			if ( getDisassemblyStorage() != null && getDisassemblyStorage().containsAddress( address ) )
+			if ( address != 0 )
 			{
-				storage = getDisassemblyStorage();
+				if ( getDisassemblyStorage() != null && getDisassemblyStorage().containsAddress( address ) )
+				{
+					storage = getDisassemblyStorage();
+				}
+				else
+				{
+					storage = loadDisassemblyStorage( frameInfo );
+				}			
 			}
-			else
-			{
-				storage = loadDisassemblyStorage( frameInfo );
-			}			
 		}
 		return storage;
 	}



Back to the top