From 323cc9f222a673408007ea7a910e692cc6bbb4c1 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Mon, 9 May 2011 02:27:39 +0000 Subject: [PATCH] Bug 339456: Thread created event with wrong id after restart for GDB < 7.0 --- .../cdt/dsf/mi/service/command/CLIEventProcessor.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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