[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] About detecting pragma
|
Georges,
So run it in the Eclipse debugger and you will know exactly where it's coming from.
In fact, in the breakpoints view of the debugger, the "J!" icon at the top lets you trap Exceptions.
So type in ArrayIndexOutOfBoundsException or something close when you "Add Java exception breakpoint"
and it will stop whenever it's about to throw that exception in your code.
If this doesn't make sense, ask!
...Beth
Beth Tibbitts (859) 243-4981 (TL 545-4981)
High Productivity Tools / Parallel Tools http://eclipse.org/ptp
IBM T.J.Watson Research Center
Mailing Address: IBM Corp., 745 West New Circle Road, Lexington, KY 40511
"Georges Bossert" ---11/04/2008 03:51:56 PM---Hello everyone, I’m still working on the detection of pragmas into source files and i would like to show you my source code, s
"Georges Bossert" <gbossert@xxxxxxxxx>
Sent by: ptp-dev-bounces@xxxxxxxxxxx
11/04/2008 03:51 PM
Please respond to
Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx> |
|
|
Hello everyone,
I’m still working on the detection of pragmas into source files and i would like to show you my source code, since I face a new problem.
This is the source code :
// If we haven't already worked on this file
if (!visitedFiles.contains(_expression_.getContainingFilename())) {
// Get all the preprocessor statements in the current file
IASTPreprocessorStatement[] ppps = (IASTPreprocessorStatement[])_expression_.getTranslationUnit().getAllPreprocessorStatements();
for (int i=0; i<ppps.length; i++) {
IASTPreprocessorStatement pps = ppps[i];
if (pps instanceof IASTPreprocessorPragmaStatement) {
// Now we verify its a hmpp pragma
if (pps.getRawSignature().startsWith(NEW_PREFIXE_PRAGMA)) {
String artifactName = pps.getRawSignature().substring(NEW_PREFIXE_PRAGMA.length());
// Generate the Source Info linked with our pragma
SourceInfo sourceInfo = new SourceInfo();
sourceInfo.setStartingLine(pps.getFileLocation().getStartingLineNumber());
sourceInfo.setStart(pps.getFileLocation().getNodeOffset());
sourceInfo.setEnd(pps.getFileLocation().getNodeOffset() + pps.getFileLocation().getNodeLength());
sourceInfo.setConstructType(Artifact.PRAGMA);
// Creation of this Artifact
Artifact artifact = new Artifact(filename, pps.getFileLocation().getStartingLineNumber(), 1, artifactName, "NEW ARTIFACT", sourceInfo);
// Adding our Artifact to scanReturn
scanReturn.addArtifact(artifact);
System.out.println("Artifact : "+artifact);
nb_pragma++;
}
}
}
visitedFiles.add(_expression_.getContainingFilename());
}
And it works !!
But I have this error when executing this.
I have a java.lang.ArrayIndexOutOfBoundsException and I don’t know where it’s coming from but I’m quite sure it’s coming from this function.
I have already faced this ?
Thanks in advance for your help.
Georges Bossert
+33 (0)6.03.57.53.88
gbossert@xxxxxxxxx
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev


