mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 311059: Process list shown during attach launch with gdb 6.8 has bogus entries
This commit is contained in:
parent
a5e8476af3
commit
3c6b9abcc7
1 changed files with 18 additions and 5 deletions
|
@ -138,11 +138,23 @@ public class GDBProcesses extends MIProcesses {
|
||||||
}
|
}
|
||||||
|
|
||||||
String name = fProcessNames.get(pid);
|
String name = fProcessNames.get(pid);
|
||||||
// If we still don't find the name in our list, return the default name of our program
|
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
|
// Hm. Strange. But if the pid is our inferior's, we can just use the binary name
|
||||||
|
MIInferiorProcess inferior = fGdb.getInferiorProcess();
|
||||||
|
if (inferior != null) {
|
||||||
|
String inferiorPidStr = inferior.getPid();
|
||||||
|
if (inferiorPidStr != null && Integer.parseInt(inferiorPidStr) == pid) {
|
||||||
IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
|
IGDBBackend backend = getServicesTracker().getService(IGDBBackend.class);
|
||||||
name = backend.getProgramPath().lastSegment();
|
name = backend.getProgramPath().lastSegment();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (name == null) {
|
||||||
|
// Should not happen.
|
||||||
|
name = "Unknown name"; //$NON-NLS-1$
|
||||||
|
assert false : "Don't have entry for process ID: " + pid; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
rm.setData(new MIThreadDMData(name, pidStr));
|
rm.setData(new MIThreadDMData(name, pidStr));
|
||||||
rm.done();
|
rm.done();
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,10 +252,11 @@ public class GDBProcesses extends MIProcesses {
|
||||||
rm.setData(null);
|
rm.setData(null);
|
||||||
} else {
|
} else {
|
||||||
fProcessNames.clear();
|
fProcessNames.clear();
|
||||||
for (IProcessInfo procInfo : list.getProcessList()) {
|
IProcessInfo[] procInfos = list.getProcessList();
|
||||||
|
for (IProcessInfo procInfo : procInfos) {
|
||||||
fProcessNames.put(procInfo.getPid(), procInfo.getName());
|
fProcessNames.put(procInfo.getPid(), procInfo.getName());
|
||||||
}
|
}
|
||||||
rm.setData(makeProcessDMCs(controlDmc, list.getProcessList()));
|
rm.setData(makeProcessDMCs(controlDmc, procInfos));
|
||||||
}
|
}
|
||||||
rm.done();
|
rm.done();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue