Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 67876 Details for
Bug 187910
Scanner discovery does not support compiler paths
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
A patch for scanner discovery to support full compiler paths
DiscoveryCompilerPathSupport.txt (text/plain), 2.97 KB, created by
Gerhard Schaber
on 2007-05-18 17:13:19 EDT
(
hide
)
Description:
A patch for scanner discovery to support full compiler paths
Filename:
MIME Type:
Creator:
Gerhard Schaber
Created:
2007-05-18 17:13:19 EDT
Size:
2.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.make.core >Index: src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java,v >retrieving revision 1.17 >diff -u -r1.17 GCCPerFileBOPConsoleParser.java >--- src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java 18 May 2007 15:01:30 -0000 1.17 >+++ src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCPerFileBOPConsoleParser.java 18 May 2007 21:06:44 -0000 >@@ -83,13 +83,8 @@ > for (compilerInvocationIndex=0; compilerInvocationIndex<split.size(); compilerInvocationIndex++) { > String command = (String)split.get(compilerInvocationIndex); > // verify that it is compiler invocation >- int cii2 = -1; >- for (int cii = 0; cii < compilerInvocation.length; ++cii) { >- cii2 = command.indexOf(compilerInvocation[cii]); >- if (cii2 >= 0) >- break; >- } >- if (cii2 >= 0) >+ int idx = lastIndexOfCompilerCommand(command); >+ if (idx >= 0) > break; > } > if (compilerInvocationIndex >= split.size()) { >@@ -180,6 +175,17 @@ > return rc; > } > >+ private int lastIndexOfCompilerCommand(String command) { >+ int cii2 = -1; >+ for (int cii = 0; cii < compilerInvocation.length; ++cii) { >+ cii2 = command.lastIndexOf(compilerInvocation[cii]); >+ if (cii2 >= 0) { >+ break; >+ } >+ } >+ return cii2; >+ } >+ > /** > * Splits and unquotes all compiler command segments; supports build command such as > * sh -c 'gcc -g -O0 -I"includemath" -I "include abc" -Iincludeprint -c impl/testmath.c' >@@ -297,8 +303,21 @@ > break; > } > } >- if (startPos >= 0 && endPos >= 0 && startPos >= compilerInvocationIndex) { >- split.add(line.substring(startPos, endPos)); >+ if (startPos >= 0 && endPos >= 0) { >+ String cmdFragment = line.substring(startPos, endPos); >+ if (startPos >= compilerInvocationIndex) { // the compiler name or one of its options >+ split.add(cmdFragment); >+ } >+ else if (endPos > compilerInvocationIndex) { >+ // compiler name is found within another command fragment--we have to check, whether this >+ // is a valid compiler invocation (e.g., C:/Programs/gcc/gcc.exe) or only a part >+ // of a command that contains by chance the compiler name (e.g., cat testgccsettings.txt) >+ int idx = lastIndexOfCompilerCommand(cmdFragment); >+ if (idx == 0 || >+ (idx > 0 && (cmdFragment.charAt(idx-1) == '\\' || cmdFragment.charAt(idx-1) == '/'))) { >+ split.add(cmdFragment); >+ } >+ } > } > } > return split;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 187910
: 67876