diff --git a/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/DebuggingControlAction.java b/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/DebuggingControlAction.java index 8ca525e..b0ec83a 100644 --- a/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/DebuggingControlAction.java +++ b/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/DebuggingControlAction.java @@ -180,7 +180,7 @@ Value methodExecution = callInstanceMethod(vm, thread, methodName, (ObjectReference)threadInstance); Scanner scanner = new Scanner(System.in); - // curMethodExecution�̍ŏI�X�e�[�g�����g���擾 + // curMethodExecution�̎w�肵���X�e�[�g�����g���擾 methodName = "getStatements"; Value statements = callInstanceMethod(vm, thread, methodName, (ObjectReference)methodExecution); methodName = "size"; @@ -190,7 +190,7 @@ Value statementOrder = vm.mirrorOf((order >= 0 && order < statementsSize) ? order : statementsSize - 1); methodName = "get"; Value statement = callInstanceMethod(vm, thread, methodName, (ObjectReference)statements, statementOrder); - + // �G�C���A�X�����ɗp����objId��tp���擾 String packageName = "org.ntlab.traceCollector.tracer.trace"; String className = "TraceJSON"; @@ -201,19 +201,37 @@ methodName = "getTracePoint"; Value tp = callInstanceMethod(vm, thread, methodName, (ObjectReference)methodExecution, statementOrder); - // �X�^�[�g�ƂȂ�G�C���A�X�𐶐� + // �X�^�[�g�ƂȂ�G�C���A�X�𐶐�����getObjectFlow�����s methodName = "getAlias"; - Value alias = callStaticMethod(vm, thread, packageName, className, methodName, valueObjId, tp, occurrenceEXP); + Value startAlias = callStaticMethod(vm, thread, packageName, className, methodName, valueObjId, tp, occurrenceEXP); methodName = "toString"; - Value str = callInstanceMethod(vm, thread, methodName, (ObjectReference)alias); + Value str = callInstanceMethod(vm, thread, methodName, (ObjectReference)startAlias); printValue("", "", str, true); + methodName = "getObjectFlow"; + Value aliasLists = callStaticMethod(vm, thread, packageName, className, methodName, startAlias); System.out.println(); - // getObjectFlow�����s - methodName = "getObjectFlow"; - Value result = callStaticMethod(vm, thread, packageName, className, methodName, alias); - System.out.println(); - System.out.println(result); + // �擾�������X�g�̒��g�����[�v�ʼn񂵂Ȃ���m�F��, �‚��łɓ��Y�\�[�X�t�@�C����Ώ�Eclipse�ŊJ�����Ă݂� + methodName = "size"; + int aliasListsSize = ((IntegerValue)callInstanceMethod(vm, thread, methodName, (ObjectReference)aliasLists)).value(); + for (int i = 0; i < aliasListsSize; i++) { + System.out.println("---------------------------------------------"); + System.out.println("���X�g" + i); + methodName = "get"; + Value aliasList = callInstanceMethod(vm, thread, methodName,(ObjectReference)aliasLists, vm.mirrorOf(i)); + methodName = "size"; + int aliasListSize = ((IntegerValue)callInstanceMethod(vm, thread, methodName, (ObjectReference)aliasList)).value(); + for (int j = 0; j < aliasListSize; j++) { + methodName = "get"; + Value alias = callInstanceMethod(vm, thread, methodName, (ObjectReference)aliasList, vm.mirrorOf(j)); + methodName = "toString"; + Value str2 = callInstanceMethod(vm, thread, methodName, (ObjectReference)alias); + printValue("", "", str2, true); + methodName = "getMethodExecution"; + Value aliasMethodExecution = callInstanceMethod(vm ,thread, methodName, (ObjectReference)alias); + openSrcFileOfMethodExecution(vm, thread, aliasMethodExecution); + } + } } /** @@ -621,7 +639,6 @@ IEditorPart editor = JavaUI.openInEditor(type); if (!type.isLocal() && !type.isMember()) { JavaUI.revealInEditor(editor, (IJavaElement)method); - System.out.println("JavaUI.revealInEditor() ���Ăяo������!"); } } } catch (PartInitException | JavaModelException e) { @@ -657,11 +674,9 @@ try { StringBuilder jdtMethodSignature = new StringBuilder(); jdtMethodSignature.append((method.isConstructor()) ? (fqcn + "(") : (fqcn + "." + method.getElementName() + "(")); - System.out.println(jdtMethodSignature); if (methodSignature.contains(jdtMethodSignature)) { // ������v���Ă����ꍇ�Ɍ���A�������X�g����������ł���v���邩�ǂ����𔻒� (�I�[�o�[���[�h�ɂ��딻��������) - jdtMethodSignature.append(String.join(",", parseFQCNParameters(type, method)) + ")"); // �S�����̃V�O�l�`�������S���薼�ɕϊ�����,�ŋ�؂��������� - System.out.println(jdtMethodSignature); + jdtMethodSignature.append(String.join(",", parseFQCNParameters(type, method)) + ")"); // �S�����̃V�O�l�`�������S����N���X���ɕϊ�����,�ŋ�؂��������� return methodSignature.contains(jdtMethodSignature); } } catch (JavaModelException e) { @@ -671,11 +686,10 @@ } /** - * IMethod����擾�ł���S�����̃V�O�l�`�������S���薼�ɒu�������Ċi�[�������X�g��Ԃ� + * IMethod����擾�ł���S�����̃V�O�l�`�������S����N���X���ɒu�������Ċi�[�������X�g��Ԃ� * @param type * @param method * @return - * @throws JavaModelException */ private List parseFQCNParameters(IType type, IMethod method) throws JavaModelException { List parameters = new ArrayList<>(); @@ -692,7 +706,11 @@ } String[][] resolveType = type.resolveType(readableTypeSplit[0]); // �p�b�P�[�W���ƃN���X���̑g�ݍ��킹���擾 if (resolveType != null) { - readableTypeSplit[0] = (resolveType[0][0] + "." + resolveType[0][1]); // ���S���薼 + if (resolveType[0][0].isEmpty()) { + readableTypeSplit[0] = (resolveType[0][1]); // �f�t�H���g�p�b�P�[�W�̏ꍇ�̓p�b�P�[�W����.�͓���Ȃ� + } else { + readableTypeSplit[0] = (resolveType[0][0] + "." + resolveType[0][1]); // ���S����N���X�� + } } parameters.add(readableTypeSplit[0] + readableTypeSplit[1]); }