mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
retry stakc-info-depth a second time.
This commit is contained in:
parent
1ab961febb
commit
6feee575a5
1 changed files with 20 additions and 5 deletions
|
@ -128,14 +128,29 @@ public class Thread extends CObject implements ICDIThread {
|
|||
CommandFactory factory = mi.getCommandFactory();
|
||||
MIStackInfoDepth depth = factory.createMIStackInfoDepth();
|
||||
mi.postCommand(depth);
|
||||
MIStackInfoDepthInfo info = depth.getMIStackInfoDepthInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException("No answer");
|
||||
MIStackInfoDepthInfo info = null;
|
||||
try {
|
||||
// Catch the first exception gdb can recover the second time.
|
||||
info = depth.getMIStackInfoDepthInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException("No answer");
|
||||
}
|
||||
stackdepth = info.getDepth();
|
||||
} catch (MIException e) {
|
||||
// First try fails, retry. gdb patches up the corrupt frame
|
||||
// so retry should give us a frame count that is safe.
|
||||
mi.postCommand(depth);
|
||||
info = depth.getMIStackInfoDepthInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException("No answer");
|
||||
}
|
||||
stackdepth = info.getDepth();
|
||||
if (stackdepth > 0) {
|
||||
stackdepth--;
|
||||
}
|
||||
}
|
||||
stackdepth = info.getDepth();
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
//System.out.println(e);
|
||||
} finally {
|
||||
currentTarget.setCurrentThread(currentThread, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue