Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Moule2018-05-16 13:22:51 -0400
committerJohn Moule2018-05-29 11:54:59 -0400
commit93cfa42618151182f0b7baa8d60cf7fa0c8959ef (patch)
tree74b9ed0d12ece96ed6f73a96cf95340ee814d6fa /dsf-gdb
parentf65fa5b7c5d60ac6701626b4d05167c26390215f (diff)
downloadorg.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>
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java5
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 413117d746..ea5f3eddb6 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));

Back to the top