diff options
author | John Moule | 2018-05-16 17:22:51 +0000 |
---|---|---|
committer | John Moule | 2018-05-29 15:54:59 +0000 |
commit | 93cfa42618151182f0b7baa8d60cf7fa0c8959ef (patch) | |
tree | 74b9ed0d12ece96ed6f73a96cf95340ee814d6fa | |
parent | f65fa5b7c5d60ac6701626b4d05167c26390215f (diff) | |
download | org.eclipse.cdt-93cfa42618151182f0b7baa8d60cf7fa0c8959ef.tar.gz org.eclipse.cdt-93cfa42618151182f0b7baa8d60cf7fa0c8959ef.tar.xz org.eclipse.cdt-93cfa42618151182f0b7baa8d60cf7fa0c8959ef.zip |
Bug 534309: NPE in breakpoint filtering
Guard against NULL oldValues, which is legitimate, in which case use an
empty Map.
Change-Id: I78ac252d3e91d431340320719cb57b32145813f0
Signed-off-by: John Moule <evil_bandit_betamax@yahoo.co.uk>
-rw-r--r-- | dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java index 413117d7463..ea5f3eddb62 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java @@ -24,6 +24,7 @@ package org.eclipse.cdt.dsf.mi.service; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; @@ -981,7 +982,9 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo // in the breakpoint's install count. // Excluding ATTR_DEBUGGER_PATH from the comparison because it has been set just before // "modifyBreakpoint()" was called. - String[] diff = compareAttributes(oldValues.getAttributes(), attributes, new String[] { ATTR_DEBUGGER_PATH }); + // (Bugzilla 534309) Guard against NULL oldValues, which is legitimate, in which case use an empty Map. + String[] diff = compareAttributes(oldValues == null ? Collections.emptyMap() : oldValues.getAttributes(), + attributes,new String[] { ATTR_DEBUGGER_PATH }); if (diff.length != 1 || !diff[0].equals(ICBreakpoint.INSTALL_COUNT)) { attributes.put(ATTR_DEBUGGER_PATH, NULL_STRING); attributes.put(ATTR_THREAD_FILTER, extractThreads(dmc, breakpoint)); |