DanHipschman

Dan Hipschman

Email: <dsh@linux.ucla.edu>

Webpage: http://linux.ucla.edu/~dsh

Spring 07

  • Big improvements to widl

Goals for Spring: (1) develop tests for widl ; (2) get widl to generate working proxy / stub code (especially for oaidl.idl); and (3) clean widl up so it looks more like a compiler and maybe more people will want to help work on it. The tests are in dlls/rpcrt4/tests/server*. They could use more coverage, as the focus this spring was more on development than writing testcases. I hope somebody who likes writing tests will add some more in the near future. A lot of progress has been made in generating proxy files. Marshalling of arrays, pointers, unions, and structures is now almost completely working, with tests to back it up. widl still needs more work to generate something working for oaidl_p.c, but at least now it can compile oaidl.idl all the way through and generate something. I haven't been able to drop the generated oaidl_p.c into wine yet, because the IPropertyBag interface was added to oaidl.idl and doesn't have an implementation for one of its local methods, yet. It wouldn't work yet, anyway. dcom.idl also compiles all the way through now, but I haven't tried to test that yet. Some cleanups have been made, especially in the representation of pointers and arrays, but there's a lot more that could be done. Cleanups were second to added functionality. All the checkmarks in the TODO list for 06 were added this spring, except for the one about compiling with -W -Wall. That was done last summer.

TODO

  • Implement writing of complex structures and arrays to the type format string (shouldn't require too much work, the infrastructure is there)
  • Implement writing of padding and alignment codes where needed in the format string, and handle alignment issues in general
  • Write a testcase for interface pointers, and more testcases in general
  • Better error messages ("syntax error" can mean almost anything, and many errors have incorrect line numbers, or no line numbers / context at all)
  • Implement handling for pointer_default attributes

  • Possibly replace the typestring_offset field of type_t with a less fragile system (like some sort of type to offset mapping function?)

  • Represent offsets uniformly as either size_t or unsigned int, add __attribute__((format(printf..))) to print_file etc., fix warnings

  • Possibly fix up handling of attributes in general (it's a little messy as is, but I currently don't have any real idea to make it better)
  • More type fixups in the parser, and in general (e.g., function pointers are a hack right now, pointers to arrays don't exist, and sizeof(int*) is a syntax error)

  • Cleanup dead code, there's a bit

I'm sure there's more basic functionality needed. It would be nice if people filed bug reports for widl. The TODO list is roughly in order of importance (or, my view of it). A note on the type format offsets: I'm not sure if the typestring_offset in type_t is a robust system for caching offsets. I ran into problems with it when trying to implement handling for non-encapsulated unions as top-level function arguments. It may work, but I think it's ugly (I know I introduced it). It would probably be better if the type format string was represented as a more abstract structure, instead of the current system of doing multiple passes through all the types, and storing offsets and state in type_t.

Summer 06

  • Sped up GetTextExtentExPoint

  • Lots of little improvements to widl

TODO

GetTextExtentExPoint

This now runs in linear time, but it could use less memory. If the user doesn't pass in their own array for partial extents, but they do want to know how many characters fit, we allocate a temporary array with the same number of elements as there are characters in the text. Once the given maximum extent has been reached, we don't need this array any more, so it's possible that the array could be much smaller. We could initially allocate a small array and expand it as necessary.

WIDL

First look at RobShearman's TODO list. Mine overlaps and conflicts a little.

  • (./) Get rid of ptr_level so every pointer is represented by a type_t structure.

  • (./) Arrays should be represented by type_t, too.

  • (./) If we can replace var->tname with var->type->name, do it.

  • Implement importlib functionality.

  • Recover from compile errors so we can report more than one at a time.
  • (./) Be able to compile WIDL with -W -Wall

These are mostly cleanup. Some things that are really necessary are:

  • (./) Get proxy generator to use the typegen stuff.

  • (./) Get tests into WIDL

To test WIDL I made a copy of every WIDL generated file used by Wine (mostly headers, but includes some typelibs, too) which were generated by a working version of WIDL. I set up a regression test script that just did a diff on the headers. I tried to make changes in such a way that the generated headers didn't change at all, but if they must, I'd study the diff and make sure everything was as expected. Of course, rebuild Wine with the new headers and maybe do make test in a few important DLLs like oleaut32. I submitted the test script although it wasn't committed (unsurprisingly). Still, you can download it if you work on WIDL and want some basic tests.

You can't test the generated typelib files in this way because they contain a timestamp. dhex is helpful here. You can also examine the typelibs in OLEView and have it generate IDL for the typelibs, which can be compared with diff. If you need a more low-level view than OLEView will give you, try the GAH Annotated Hex viewer. The project contains an MSFT format description file.

I also submitted this WIDL/MIDL conformance test. It depends on Cygwin and having MIDL and the PSDK installed for running on Windows, which is probably why is wasn't accepted. Its usefulness is limited, too, but what it can test is important, so anyone can use it if they like.

Testing that the generated client / server / proxy code actually works as intended would be the best test. RobShearman wrote a great test to test typelib marshalling which I tried to get working. Besides the C++ comments and trailing whitespace which I should have taken out, it crashed on other peoples' machines even though it worked on mine.


CategoryHomepage

DanHipschman (last edited 2007-07-02 18:46:31 by DanHipschman)