mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-09 11:33:20 +02:00
Bug 319307: Remote gdbserver attach does not show thread info right after the attach because of missing stopped event.
This commit is contained in:
parent
0d1338e502
commit
9e3c2bfd51
2 changed files with 26 additions and 2 deletions
|
@ -282,6 +282,25 @@ public class CLIEventProcessor
|
||||||
int type = getSteppingOperationKind(operation);
|
int type = getSteppingOperationKind(operation);
|
||||||
return type != -1;
|
return type != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the operation is a attaching operation.
|
||||||
|
*
|
||||||
|
* @param operation
|
||||||
|
* @return
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
public static boolean isAttachingOperation(String operation) {
|
||||||
|
// Get the command name.
|
||||||
|
int indx = operation.indexOf(' ');
|
||||||
|
if (indx != -1) {
|
||||||
|
operation = operation.substring(0, indx).trim();
|
||||||
|
} else {
|
||||||
|
operation = operation.trim();
|
||||||
|
}
|
||||||
|
/* attach: at, att, atta, attac, attach */
|
||||||
|
return (operation.startsWith("at") && "attach".indexOf(operation) != -1); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isSettingBreakpoint(String operation) {
|
private boolean isSettingBreakpoint(String operation) {
|
||||||
boolean isbreak = false;
|
boolean isbreak = false;
|
||||||
|
|
|
@ -360,7 +360,9 @@ public class MIRunControlEventProcessor
|
||||||
// It is important to limit this to runControl operations (e.g., 'next', 'continue', 'jump')
|
// It is important to limit this to runControl operations (e.g., 'next', 'continue', 'jump')
|
||||||
// There are other CLI commands that we use that could still be sent when the target is considered
|
// There are other CLI commands that we use that could still be sent when the target is considered
|
||||||
// running, due to timing issues.
|
// running, due to timing issues.
|
||||||
if (CLIEventProcessor.isSteppingOperation(((CLICommand<?>)cmd).getOperation())) {
|
boolean isAttachingOperation = CLIEventProcessor.isAttachingOperation(((CLICommand<?>)cmd).getOperation());
|
||||||
|
boolean isSteppingOperation = CLIEventProcessor.isSteppingOperation(((CLICommand<?>)cmd).getOperation());
|
||||||
|
if (isSteppingOperation || isAttachingOperation) {
|
||||||
IRunControl runControl = fServicesTracker.getService(IRunControl.class);
|
IRunControl runControl = fServicesTracker.getService(IRunControl.class);
|
||||||
IMIProcesses procService = fServicesTracker.getService(IMIProcesses.class);
|
IMIProcesses procService = fServicesTracker.getService(IMIProcesses.class);
|
||||||
if (runControl != null && procService != null) {
|
if (runControl != null && procService != null) {
|
||||||
|
@ -369,7 +371,10 @@ public class MIRunControlEventProcessor
|
||||||
IProcessDMContext procDmc = procService.createProcessContext(fControlDmc, groupId);
|
IProcessDMContext procDmc = procService.createProcessContext(fControlDmc, groupId);
|
||||||
IContainerDMContext processContainerDmc = procService.createContainerContext(procDmc, groupId);
|
IContainerDMContext processContainerDmc = procService.createContainerContext(procDmc, groupId);
|
||||||
|
|
||||||
if (runControl.isSuspended(processContainerDmc) == false) {
|
// An attaching operation is debugging a new inferior and always stops it.
|
||||||
|
// We should not check that the container is suspended, because at startup, we are considered
|
||||||
|
// suspended, even though we can get a *stopped event.
|
||||||
|
if (isAttachingOperation || runControl.isSuspended(processContainerDmc) == false) {
|
||||||
MIEvent<?> event = MIStoppedEvent.parse(processContainerDmc, id, rr.getMIResults());
|
MIEvent<?> event = MIStoppedEvent.parse(processContainerDmc, id, rr.getMIResults());
|
||||||
fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties());
|
fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue