mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 05:25:21 +02:00
[208921] Fix to return arguments and locals for IStack.getLocals().
This commit is contained in:
parent
a8a36358d9
commit
a1242031aa
2 changed files with 30 additions and 3 deletions
|
@ -99,7 +99,7 @@ public interface IStack extends IDMService {
|
|||
void getArguments(IFrameDMContext frameCtx, DataRequestMonitor<IVariableDMContext[]> rm);
|
||||
|
||||
/**
|
||||
* Retrieves variables local to the stack frame.
|
||||
* Retrieves variables local to the stack frame, including arguments.
|
||||
*/
|
||||
void getLocals(IFrameDMContext frameCtx, DataRequestMonitor<IVariableDMContext[]> rm);
|
||||
|
||||
|
|
|
@ -11,13 +11,17 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.dd.mi.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.IAddress;
|
||||
import org.eclipse.cdt.utils.Addr32;
|
||||
import org.eclipse.cdt.utils.Addr64;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.dsf.datamodel.AbstractDMContext;
|
||||
|
@ -512,13 +516,36 @@ public class MIStack extends AbstractDsfService
|
|||
|
||||
|
||||
public void getLocals(final IFrameDMContext frameDmc, final DataRequestMonitor<IVariableDMContext[]> rm) {
|
||||
|
||||
final List<IVariableDMContext> localsList = new ArrayList<IVariableDMContext>();
|
||||
|
||||
final CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleOK() {
|
||||
rm.setData( localsList.toArray(new IVariableDMContext[localsList.size()]) );
|
||||
rm.done();
|
||||
}
|
||||
};
|
||||
countingRm.setDoneCount(2);
|
||||
|
||||
getArguments(
|
||||
frameDmc,
|
||||
new DataRequestMonitor<IVariableDMContext[]>(getExecutor(), countingRm) {
|
||||
@Override
|
||||
protected void handleOK() {
|
||||
localsList.addAll( Arrays.asList(getData()) );
|
||||
countingRm.done();
|
||||
}
|
||||
});
|
||||
|
||||
fRunControl.getCache().execute(
|
||||
new MIStackListLocals(frameDmc, true),
|
||||
new DataRequestMonitor<MIStackListLocalsInfo>(getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleOK() {
|
||||
rm.setData(makeVariableDMCs(frameDmc, MIVariableDMC.Type.LOCAL, getData().getLocals().length));
|
||||
rm.done();
|
||||
localsList.addAll( Arrays.asList(
|
||||
makeVariableDMCs(frameDmc, MIVariableDMC.Type.LOCAL, getData().getLocals().length)) );
|
||||
countingRm.done();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue