diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java index aebdfabd533..22f59702224 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java @@ -129,6 +129,17 @@ public class CLIEventProcessor } } + // Look for an event that indicates a start/restart. This will tell use + // we should reset our thread number counter + // The printout that seems to occur on restarts (and start) is + // [Thread debugging using libthread_db enabled] + // Bug 339456 + pattern = Pattern.compile("^\\[Thread debugging using "); //$NON-NLS-1$ + matcher = pattern.matcher(exec.getCString()); + if (matcher.find()) { + fLastThreadId = 0; + } + // For GDB thread exit events, we won't use the events generated by GDB. This event is // raised in GDBRunControl class by polling and comparing the ExecutionContexts returned by // -thread-list-ids command. This is done as threads reported by exit event are still reported till