Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 246912

Summary: Remote Call Hierarchy doesn't work on m1a
Product: [Tools] PTP Reporter: Beth Tibbitts <beth>
Component: RDTAssignee: Chris Recoskie <recoskie>
Status: RESOLVED FIXED QA Contact: Greg Watson <g.watson>
Severity: major    
Priority: P3    
Version: 2.1M2   
Target Milestone: 2.1M3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Beth Tibbitts CLA 2008-09-10 15:34:35 EDT
Build ID: eclipse 3.4 PTP 2.1m1a

Steps To Reproduce:
1. Create remote makefile project
2. (It builds ok remotely.  I can run it  - outside eclipse - on remote machine just fine)
3. Edit src file (Remote C/C++ editor)

(I did rebuild the index too. rightMouse on project > Index > Rebuild)



More information:
From editor:
       rightmouse on function name func0, > Call Hierarchy
       Remote Call Hierarchy view opens, with entry for func0
       but there are no callers (no entries under it)

From outline view, tried same thing. same results.

Remote CDT Miner info:

=============== call hierarchy from editor
Getting definitions...
Getting definitions for subject remoteMakefile.cpp
scope: __WORKSPACE_ROOT_SCOPE__
path: rse://192.168.2.2/home/beth/ews/remoteproj0910/remoteMakefile.cpp
offset: 476
length: 0
Getting index
Acquiring read lock
Finished getting definitions.
Getting callers...
Getting callers for subject func0
scope: __WORKSPACE_ROOT_SCOPE__
path: null
Getting index
Acquiring read lock
Finished getting callers.



=================== call hierarchy from outline view
Getting definitions...
Getting definitions for subject func0
scope: __WORKSPACE_ROOT_SCOPE__
path: rse://192.168.2.2/home/beth/ews/remoteproj0910/remoteMakefile.cpp
Getting index
Acquiring read lock
java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
        at org.eclipse.ptp.internal.rdt.core.model.CElement.getResource(CElement.java:115)
        at org.eclipse.cdt.core.index.IndexLocationFactory.getIFL(IndexLocationFactory.java:191)
        at org.eclipse.ptp.internal.rdt.core.index.IndexQueries.elementToName(IndexQueries.java:157)
        at org.eclipse.ptp.internal.rdt.core.miners.CDTMiner.handleGetDefinitions(CDTMiner.java:777)
        at org.eclipse.ptp.internal.rdt.core.miners.CDTMiner.handleCommand(CDTMiner.java:317)
        at org.eclipse.dstore.core.miners.Miner.command(Miner.java:303)
        at org.eclipse.dstore.core.miners.Miner.handle(Miner.java:221)
        at org.eclipse.dstore.core.model.Handler.run(Handler.java:135)
Finished getting definitions.



==================================
Here is my source file:

//===============================================
// Name        : remoteMakefile.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C, Ansi-style
//===============================================

#include <stdio.h>
#include <stdlib.h>

int func3(int,int);
int main(void) {
	puts("Hello Remote World with changes");
	func3(7,9);
	return EXIT_SUCCESS;
}
int func0(int arg){
	puts("hello from func0");
	return 0;
}
int func1(int arg){
	int result = func0(arg);
	return result;
}
int func2(int arg){
	int res1=func0(arg);
	int res2=func1(arg);
	int result = res1+res2;
	return result;
}
int func3(int arg, int argTwo){
	puts("hello from func3");
	func0(arg);
	int foo=func1(argTwo);
	int res=func2(foo);
	return res;

}
Comment 1 Chris Recoskie CLA 2008-09-10 16:04:52 EDT
I do the below error when trying to do call hierarchy from the outline view.  However, otherwise the test case worked for me.  If I stick to the editor, call hierarchy works just fine on your code.  Maybe the build is bad?  I'm working from CVS.

java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
        at org.eclipse.ptp.internal.rdt.core.model.CElement.getResource(CElement
.java:115)
        at org.eclipse.cdt.core.index.IndexLocationFactory.getIFL(IndexLocationF
actory.java:191)
        at org.eclipse.ptp.internal.rdt.core.index.IndexQueries.elementToName(In
dexQueries.java:157)
        at org.eclipse.ptp.internal.rdt.core.miners.CDTMiner.handleGetDefinition
s(CDTMiner.java:777)
        at org.eclipse.ptp.internal.rdt.core.miners.CDTMiner.handleCommand(CDTMi
ner.java:317)
        at org.eclipse.dstore.core.miners.Miner.command(Miner.java:303)
        at org.eclipse.dstore.core.miners.Miner.handle(Miner.java:221)
        at org.eclipse.dstore.core.model.Handler.run(Handler.java:135)
        
        
Comment 2 Chris Recoskie CLA 2008-09-17 12:11:18 EDT
Fixed on HEAD.

IndexQueries.elementToName() was incorrectly trying to access the resources plugin as a part of creating an index location.  I've made a remote version of this API to be used instead.
Comment 3 Beth Tibbitts CLA 2008-09-20 23:06:49 EDT
I'm seeing this again on M3.
No errors in the rdt server console now, but i only get the name of the function
in the call hierarchy window, no callers or callees.

Am I supposed to have to select the entire function name before doing rightMouse then call hierarchy?  It won't work with just rightmouse somewhere in the function name.
Comment 4 Chris Recoskie CLA 2008-09-23 10:56:51 EDT
Did you rebuild the index?  That's still an issue... we should have a bug for that...
Comment 5 Chris Recoskie CLA 2008-09-24 09:05:31 EDT
Works for me, dunno what to tell you other than what I already mentioned.  Marking as fixed again.