Hi,
On 01/04/16 12:08, Bernhard Übelacker wrote:
The test contains 2 tests:
- Simply check the exports of the vbtable sizes for their values.
This test needs some improvements before it can be accepted to wine. The structure sizes are different in 32-bit and 64-bit cases.
- Call constructor and destructor like it is done in Supertux.
This test will need to be rewritten in order to get into wine. You should use vbtable while computing this pointer (you can tests values inside vbtable). The test should also be named differently (e.g. test_virtual_base_func_call).
I tried to add these 8 bytes as an unknown field to basic_istream_* and basic_ostream_* structs. But then I cannot find a way to get the sizes for basic_iostream_* right.
I've tried to find what happens there. It looks like there's a bug in Visual Studio that is described here (sorry I couldn't find it on Microsoft pages): http://stackoverflow.com/questions/14487241/avoiding-an-inheritance-by-domin...
I've tried looking on basic_istream_char class layout (32-bit): void* vbtable 4-byte padding int64 count 4-byte padding int vtordisp = 0 (as described https://msdn.microsoft.com/en-us/library/7sf3txa8%28v=vs.100%29.aspx) basic_ios_char
I've also tried creating following classes and ended with a different layout: class vbase { public: int a; virtual ~vbase() {}; };
class c : virtual public vbase { public: int b; virtual ~c() {}; virtual _Add_vtordisp1() {}; };
c class has following layout (as expected): void *vtable; void *vbtable; int b; void *vtable; int a;
if b is defined as offsetof the layout changes strangely (looks like there's another problem in compiler related to padding): void *vtable; 4-byte padding; void *vbtable; 4-byte padding int64 b void *vtable int a
The difference shows that _Add_vtordisp1 and _Add_vtordisp2 are defined in basic_ios_char class.
I don't understand yet why vtordisp is needed. It's kind of described here (https://msdn.microsoft.com/en-us/library/453x4xdd%28v=vs.100%29.aspx) but I don't understand it yet.
Thanks, Piotr
Hi,
the patch that adds vtordisp field to the class is now in wine. Could you please improve and send your vbtable tests patch?
Thanks, Piotr
Am 06.01.2016 um 11:25 schrieb Piotr Caban:
Hi,
the patch that adds vtordisp field to the class is now in wine. Could you please improve and send your vbtable tests patch?
Thanks, Piotr
Hello Piotr, thank you very much for fixing the issue. I will prepare the tests for submission.
I guess there is nothing against changing the sizes test to a list where the test function iterates on?
Do you want both tests submitted? (The vbtable size test and the ctor/dtor call test)
Should I send similar vbtable sizes tests for the other msvcp versions too?
Kind regards, Bernhard
Hi,
On 01/06/16 13:34, Bernhard Übelacker wrote:
I guess there is nothing against changing the sizes test to a list where the test function iterates on?
It can be done this way.
Do you want both tests submitted? (The vbtable size test and the ctor/dtor call test)
There are already tests for ctor/dtor (see dlls/msvcp90/tests/misc.c:test_virtual_base_dtors). There's no need to duplicate it.
Should I send similar vbtable sizes tests for the other msvcp versions too?
Sure, it's better to have more tests. It may be easier to first get the tests accepted to one dll and then add it to other versions.
Thanks, Piotr