After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 700148 - FILTER_PATTERNS is working with additional " at the end
FILTER_PATTERNS is working with additional " at the end
Status: RESOLVED DUPLICATE of bug 504305
Product: doxygen
Classification: Other
Component: general
1.8.5
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2013-05-12 08:55 UTC by eckard_klotz
Modified: 2016-01-31 18:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example with one workind and one not working configuration (49.22 KB, application/x-zip-compressed)
2013-05-12 08:55 UTC, eckard_klotz
Details
This is an other example where I use an exe-filter that works without an additional interpreter (143.03 KB, application/x-zip-compressed)
2013-05-20 13:14 UTC, eckard_klotz
Details
Call a perl-filter by using a windows batch-file (193.57 KB, application/x-zip-compressed)
2013-07-03 15:56 UTC, eckard_klotz
Details

Description eckard_klotz 2013-05-12 08:55:56 UTC
Created attachment 243884 [details]
example with one workind and one not working configuration

Hello Dimitri.

Since you asked me to do so, here is my bug-report:

After some tests and referring the archive again I'm sure that the configuration of FILTER_PATTERNS is not working or its usage is not documented completely.

Even if I use
FILTER_PATTERNS = *.m=perl m2cpp.pl
the c-comment files will be analysed but not the matlab-files.

Doxygen gives me the warning that the perl-script "m2cpp.pl can not be opened.
Note, the double-quote " is part of the doxygen warning message and there is no double-quote at the end of the message.

Once a realized that, I tried to insert in the wizard-input as filter-pattern
*.m=perl m2cpp.pl"  (note the double-quote at the end)
This results in the DOXYFILE the line:
FILTER_PATTERNS = "*.m=perl m2cpp.pl\""


And last but not least it works now. All c-files will be analysed like expected, while all m-files will be preprocessed with the filter.

Again an additional double-quote with backslash is needed at the end of the filter-definition:
FILTER_PATTERNS = "pattern=filter\""
in the doxygen-wizard the input is : pattern=filter"


I use doxygen 1.8.3.1 on Windows XP SP3.
 
I hope that the attached example allows you to reproduce the effect. You will see that the only difference of both configurations is the line to define the FILTER_PATTERNS.

Best regards,
              Eckard Klotz.
Comment 1 Dimitri van Heesch 2013-05-18 21:29:27 UTC
One problem is that FILTER_PATTERNS expects an executable as an argument, while you give it an executable (perl) and an argument (m2cpp.pl).

If you would wrap "perl m2cpp.pl" into a batch file (that passes its arguments along) then it should work as expected.
Comment 2 eckard_klotz 2013-05-20 13:14:21 UTC
Created attachment 244769 [details]
This is an other example where I use an exe-filter that works without an additional interpreter
Comment 3 eckard_klotz 2013-05-20 13:15:15 UTC
Hello Dimitri.

I tried it out but I was not able to make it working. Furthermore I have the same effect with an exe-filter as you can see in the second added example.

Even if you think that this is all the wanted behaviour, it may be necessary to add some more examples in the documentation. Especially for those which are not working with unix-filters or those who are using windows may some more background information very useful. Another source of confusion may be the fact that you use for INPUT_FILTER an other kind of value-definition.

Best regards,
                    Eckard Klotz.
Comment 4 eckard_klotz 2013-06-17 17:51:05 UTC
Hello Dimitri

In the meanwhile I updated my doxygen-installation to 1.8.4 and tried out the behaviour of the configuration of  the FILTER_PATTERNS.
It is still the same like described for doxygen 1.8.3.1.

It doesn't matter if the filter is a script where I have to mention the script-interpretor also ( first example  with a perl based filter for matlab) or if the filter is a independent exe-file only ( second example with an exe-fileter for pascal).

You mention that the use of a batch-script is the solution. Is it possible for you to use both examples I added to my bug-report for creating examples how to use both filters with a windows bath-file?
Will this batch-file also be usable for  INPUT_FILTER?

Best regards,
                    Eckard Klotz.
Comment 5 Dimitri van Heesch 2013-07-03 08:53:14 UTC
Hi Eckard,

I tried your example with the following batch file:

--- runm2cpp.pl ------------
perl m2cpp.pl %*
----------------------------

And with the following settings in the config file:

FILTER_PATTERNS = "*.m=runm2cpp.bat"

And it seemed to work find. You can use the same approach with INPUT_FILTER as well.

In your other example I used the following succesfully:

FILTER_PATTERNS = "*.pas=pas2dox.exe"

Note that I removed the space after =

Also note that you can run doxygen with '-d ExtCmd' option to see how doxygen invokes external commands, and you can use '-d FilterOutput' option to let doxygen dump the output after running it through your filter.

Let me know if this helps locating/fixing the problem.
Comment 6 eckard_klotz 2013-07-03 15:51:02 UTC
Hello Dimitri.

I can confirm that the delete of the space after the = solves the problem with an exe-file. But I'm still not able to solve the perl-problem with a batch-file. The m-file seems to be analysed but instead of the expected function doxygen shows a variable called __pad0__ what is not defined in the analysed file. Actualy there is nothing called __pad0__ in the analysed file.

I attached in my example-zip the shell outputs of doxygen as text-files one with using my first solution with only one " and an other one using the batch-file "m2cpp.bat". I called doxygen with the batch-file "Doxygen.bat" to call it with the option '-d FilterOutput'. 

If I use my " solution the filter output contains only the pseudo c-code. But with the batch-file the filter-ouput contains some additional windows-echos also wich may result in an unvalide code for doxygen. I tested some variants for example a batch-file that contains:

 echo off
 perl m2cpp.pl %*

I tried to change the star behind the % into a number .... all with the same result. Calling the perl-filter with windows-batch (windows xp service-pack 2) results into additional lines in the filter output and in wrong doxygen result.

As fazit I can say the batch-filter will be called and that was not the case with two ". But since the filter output seems to be corrupted doxygen is not able to deliver the wanted results.

Please take a look into my attached archive, perhaps you will find something like the space after the = in my exe-example. Furthermore if you have a running example is it possible for you to add it as attachment to this topic?

Thanks for your help and best regards,
                                       Eckard.
Comment 7 eckard_klotz 2013-07-03 15:56:37 UTC
Created attachment 248327 [details]
Call a perl-filter by using a windows batch-file

The text-file "doxygen_batch.txt" contains the doxygen shell-output with using a bacht-file.
The text-file "doxygen_both.txt" contains the doxygen shell-output with calling the perl-script inside the the doxygen config-file with only one ".

Both text-files contain the filter-output also.
Comment 8 eckard_klotz 2013-09-18 17:45:43 UTC
Hello Dimitri.

Unfortunatly I'm not able to configure Doxygen 1.8.5 in a way that it behaves different compared to teh versions before. After your last comment I added my results. I hope you find some time to check them.

In the case that you finde some errors in my configuration or batch-file, it would be nice if you correct my exmples so that they work and post them again. I assume that I only misunderstood your advise. Thus the posting of working examples would be very helpful. 

Please take a look to the generated files in my example. You will see that something would be generated (that was not the case without useing a batch-file). But the result is not like expected. Please see my post before where I mentioned that a variable __pad0__ was part of the documentation without beeing part of the documented matlab-source.

Best regards,
              Eckard.
Comment 9 Thomas Braun 2014-09-10 09:57:39 UTC
The bug is present in 1.8.7 (on windows) also.

Recipe to reproduce:
* doxgen -g
* Set
FILTER_PATTERNS        = *.cpp="gawk -f test.awk"
in Doxyfile
* create test.awk with
###
{
  print $0
}
###
and test.cpp with
###
/// my class
struct A
{

};
###

Running doxygen -d ExtCmd gives:
...
Preprocessing H:/XXX/test.cpp...
Executing popen(`"gawk -f test.awk" "H:/XXX/test.cpp"`)
gawk: fatal: can't open source file `test.awk H:/XXX/test.cpp' for reading (Invalid argument)
...

With the additional escaped quote
FILTER_PATTERNS        = *.cpp="gawk -f test.awk\""

I get no error as
...
Executing popen(`"gawk -f test.awk"" "H:/XXX/test.cpp"`)
...
works.
Comment 10 albert 2016-01-31 13:36:52 UTC
As far as I can see this is a duplicate of bug_504305
Comment 11 Kevin McBride 2016-01-31 18:12:22 UTC

*** This bug has been marked as a duplicate of bug 504305 ***