Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] DSF disassembly view NPE

Hi,

While upgrading our IDE from Galileo to Helios, I noticed a NPE crop
up on starting the disassembly view. A trivial change fixed the issue
- I've copied the diff below:

--- orig/plugins/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java
      2010-10-12 10:48:57.667296000 -0700
+++ new/plugins/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java
    2010-10-12 14:22:33.089508000 -0700
@@ -200,7 +200,9 @@
                                        position=
createPositionFromSourceLine((IFile) marker.getResource(),
lineNumber);
                                } else if (breakpoint instanceof
ICLineBreakpoint) {
                                        ICLineBreakpoint cBreakpoint=
(ICLineBreakpoint) breakpoint;
-                                       position=
createPositionFromSourceLine(cBreakpoint.getFileName(), lineNumber);
+                                        String fName =
cBreakpoint.getFileName();
+                                        if (fName != null)
+                                           position=
createPositionFromSourceLine(fName, lineNumber);
                                        if (position == null) {
                                                position=
createPositionFromAddress(decodeAddress(cBreakpoint.getAddress()));
                                        }


cBreakpoint.getFileName() returns null if it cannot find the file
name, and createPositionFromSourceLine barfs if null is passed as
first argument.

/Siva
-- 
In the end, everything is a gag.
           Charlie Chaplin


Back to the top