1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 337927: Invalid assert when fetching process information

This commit is contained in:
Marc Khouzam 2011-02-23 02:04:56 +00:00
parent 3974422239
commit 35b59fe446
2 changed files with 8 additions and 5 deletions

View file

@ -172,14 +172,14 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
}
}
if (name == null) {
// Should not happen.
// This could happen if a process has terminated but the
// debug session is not terminated because the preference
// to keep GDB running has been selected.
name = "Unknown name"; //$NON-NLS-1$
// Until bug 305385 is fixed, the above code will not work, so we assume we
// are looking for our own process
// assert false : "Don't have entry for process ID: " + pid; //$NON-NLS-1$
name = fBackend.getProgramPath().lastSegment();
}
rm.setData(new MIThreadDMData(name, pidStr));

View file

@ -654,9 +654,12 @@ public class GDBProcesses_7_0 extends AbstractDsfService
} else {
name = fDebuggedProcessesAndNames.get(id);
if (name == null) {
// We don't have the name in our map. Should not happen.
// We don't have the name in our map. This could happen
// if a process has terminated but the
// debug session is not terminated because the preference
// to keep GDB running has been selected or because there
// are other processes part of that session.
name = "Unknown name"; //$NON-NLS-1$
assert false : "Don't have entry for process ID: " + id; //$NON-NLS-1$
} else if (name.length() == 0) {
// Probably will not happen, but just in case...use the
// binary file name (absolute path)