file [Solved] This may be an error in C++ Reverser.

6 years 7 months ago #1451 by bill.white
I am trying to evaluate the C++ Designer and C++ Reverser tools by reverse engineering my large C++ code base. The code base is about 15M lines of code, including sparse and misleading comments. The particular product I am interested in is about 1.5M lines of code, but it references the rest. I'm trying to reverse just a small part of the 1.5M part, but I get the following error message.

javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 771; columnNumber: 718; The element type "association-end" must be terminated by the matching end-tag "</association-end>".]

This doesn't seem like a C++ parser error message. It seems like an error message in the XML files you are writing.

It would be difficult for me to send you the code, though I could try to recreate this bug if I knew what exact C++ code was causing it. Is there a way for me to see the XML files that are being produced by the reverser, and then figure out if I can create a reproducer for this problem, and also change my code to work around it.

Thanks.

Please Log in or Create an account to join the conversation.

6 years 7 months ago #1452 by bill.white
This seems to be what's causing the problem. A definition of this form is apparently not legal in Modelio C++.

typedef struct tdtaggedtype_tag {
double chunk[100];
} tdtaggedtype;

This is legal C/C++ code. Unfortunately, my project is very old, and was converted from pre-ANSI C to ANSI C to C++, though not completely. In pre-ANSI C this kind of typedef was required in some cases. My project is littered with this paradigm. There are hundreds of these kinds of definitions. Changing them all would be very difficult and time consuming.

The XML which is produced for this seems to be:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<reversed-data xmlns=" www.modeliosoft.com/rev-modele.xsd ">
<model>
<group name = "file:/local/billw/src/modelio/examples/typedef/tdtag.h">
<class name="tdtaggedtype_tag" id="n2" visibility="VisibilityUndefined" is-abstract="false">
<stereotype stereotype-type="CxxClass"/>
<tagged-value tag-type="Cxx.Struct"/>
<attribute name="chunk" id="n3" visibility="Public" multiplicity="100" is-class="false">
<tagged-value tag-type="Cxx.Decoration.NoAuto"/>
<base-type>double</base-type>
<tagged-value tag-type="Cxx.Container"/>
<tag-parameter>array</tag-parameter>
<tag-parameter><![CDATA100]></tag-parameter>
!!!-->> </tagged-value> <<--!!!
</attribute>
</class>
<data-type name="tdtaggedtype" id="n4" visibility="VisibilityUndefined"><tagged-value tag-type="Cxx.TypeExpr"><tag-parameter><![CDATA[typedef struct tdtaggedtype_tag tdtaggedtype;]]></tag-parameter></tagged-value><stereotype stereotype-type="CxxDataType"/></data-type>
</group>
</model>
<report-list>
</report-list>
</reversed-data>

(I have indented it somewhat and added an indication of the flawed XML.) There seems to be an empty element with tag <tagged-value> which is then ended with an end-tag. Of course, this causes a XML parser to fail.

I believe this is a CXXReverser bug. Of course it's very possible that our typedef-to-struct hackiness will work even after the bug is fixed.

Is this the right forum for this kind of a report? Is there a bug reporting mechanism? I haven't read the Modelio documentation in great detail.

Thanks.

Please Log in or Create an account to join the conversation.

6 years 7 months ago #1457 by chm

bill.white wrote: I believe this is a CXXReverser bug. Of course it's very possible that our typedef-to-struct hackiness will work even after the bug is fixed.

Is this the right forum for this kind of a report? Is there a bug reporting mechanism? I haven't read the Modelio documentation in great detail.


It is indeed a bug from CxxReverser, it should never end with that kind of xml related error.

You were right to report your error in the forum, this issue is now registered in our internal bug tracker. (However, the 'Extensions' section should be more fit for to discuss about modules)

Thank you for reporting it with that many details, I think it should be enough for us to do something about it.

Please Log in or Create an account to join the conversation.

6 years 7 months ago #1494 by cde
Hi Bill,

A new version of the Cxx Reverser module (3.2.04) fixing your issue has been released and is available for download on the Modelio Store .



Best regards,
cde

Please Log in or Create an account to join the conversation.

Moderators: tmachmebr
Time to create page: 0.040 seconds
^ Back to Top