The parser shouldn't require any modification to the source, and should work on any Windows source, not only the Wine ones. This means there are basically two approaches:
- write a full C compiler
This isn't happening soon. Definitely not within the coming months and not likely this year and more likely than not neither the coming year.
- use Patrik's Perl stuff to generate the initial info as best as we can and then update it by hand.
IMO #2 is the way to go, because no matter how clever a parser you write it won't be able to extract semantics information; and that would be the main advantage of doing a better relay debugger. Imagine dumping structure contents, flags, following list pointers, etc. We shouldn't limit ourselves to what can be extracted automatically from the source.
Agreed. I can write code if you, Dimitrie or whomever specify the output format...
Of course having an imperfect parser also means we cannot use it for the export info, because unlike relay debugging it needs to be 100% correct. So we either need compiler declspec support,
That will leave us dependent on compilers that support it.
or we need a specialized tool to extract the declspec info in a way that is guaranteed to not miss anything.
This isn't happend soon either. It might not be THAT difficult, however the code need not just work it needs be well structured and organized as well if any reasonable guarantees of correctness can be made.
On Wed, 11 Sep 2002, Patrik Stridvall wrote: [...]
Of course having an imperfect parser also means we cannot use it for the export info, because unlike relay debugging it needs to be 100% correct. So we either need compiler declspec support,
That will leave us dependent on compilers that support it.
I agree that Wine should not depend on hacked compilers. However it would be nice to have anyway for Winelib. There should be an alternative but if it saves 'big' Winelib developpers from having to write huge spec files by hand then it would definitely be a plus.
I'm not saying that you, Patrik, should do it. I just don't want potential contributers to think that this is not something that would be useful to Wine/Winelib.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ The nice thing about meditation is that it makes doing nothing quite respectable -- Paul Dean
Patrik Stridvall ps@leissner.se writes:
Of course having an imperfect parser also means we cannot use it for the export info, because unlike relay debugging it needs to be 100% correct. So we either need compiler declspec support,
That will leave us dependent on compilers that support it.
Well, the idea would be not to depend on compiler support for the __declspec keyword itself, but more to have some clever macro replacements that output stuff in a special ELF section or something like that. This could then hopefully be made to work on most compilers. But I'm not sure if there's a good way to do that at all.
This isn't happend soon either. It might not be THAT difficult, however the code need not just work it needs be well structured and organized as well if any reasonable guarantees of correctness can be made.
I think most of all it needs to be simple. My idea is to run through the preprocessor, find the __declspec, and locate the corresponding function name, or die if there's anything it cannot parse. This should be reasonably foolproof. And IMO it shouldn't be in Perl, it should be part of winebuild.