debugger: follow on to GP-601, fix for Threads

This commit is contained in:
d-millar 2021-04-12 19:33:28 +00:00
parent 25170eced2
commit 2d0743b785
3 changed files with 16 additions and 2 deletions

View file

@ -52,7 +52,7 @@ public interface DbgModelTargetActiveScope extends DbgModelTargetObject, TargetA
while (cur != null) {
if (cur instanceof DbgModelSelectableObject) {
DbgModelSelectableObject sel = (DbgModelSelectableObject) cur;
System.err.println("requestActivation " + obj);
//System.err.println("requestActivation " + obj);
return sel.setActive();
}
if (cur instanceof DbgModelTargetObject) {

View file

@ -61,7 +61,7 @@ public interface DbgModelTargetFocusScope extends DbgModelTargetObject, TargetFo
while (cur != null) {
if (cur instanceof DbgModelSelectableObject) {
DbgModelSelectableObject sel = (DbgModelSelectableObject) cur;
System.err.println("requestFocus " + obj);
//System.err.println("requestFocus " + obj);
setFocus(sel);
return AsyncUtils.NIL;
}

View file

@ -117,6 +117,7 @@ public class TraceObjectManager {
this::attributesChangedBreakpointLocation);
putAttributesHandler(TargetRegister.class, this::attributesChangedRegister);
putAttributesHandler(TargetStackFrame.class, this::attributesChangedStackFrame);
putAttributesHandler(TargetThread.class, this::attributesChangedThread);
putRemHandler(TargetProcess.class, this::removeProcess);
putRemHandler(TargetThread.class, this::removeThread);
@ -515,6 +516,19 @@ public class TraceObjectManager {
}
}
public void attributesChangedThread(TargetObject thread, Map<String, ?> added) {
if (added.containsKey(TargetObject.DISPLAY_ATTRIBUTE_NAME)) {
ManagedThreadRecorder rec = recorder.getThreadRecorderForSuccessor(thread);
if (rec != null) {
String name = (String) added.get(TargetObject.DISPLAY_ATTRIBUTE_NAME);
try (UndoableTransaction tid =
UndoableTransaction.start(rec.getTrace(), "Renamed thread", true)) {
rec.getTraceThread().setName(name);
}
}
}
}
public void elementsChangedBreakpointLocationContainer(TargetObject locationContainer,
Map<String, ?> added) {
TargetObject x = findThreadOrProcess(locationContainer);