30 views
in Embedded Wizard Studio by

Hi Embedded wizard team.

 

I recently migrated from v9.30 to v11.0.

After the migration, there was a partial problem.

I am attaching two files for my question.

Please download using the below link.

https://hantas-my.sharepoint.com/:u:/g/personal/hochul_yoo_hantas_kr/EbRy2q25dFxJhPR8uhJ871oBG_l519mk6wWBOL2dPk992Q?e=AgFcU3

https://hantas-my.sharepoint.com/:u:/g/personal/hochul_yoo_hantas_kr/EXpAeRqRyPpDidGgsI_NX4kBVEr-U62AZt_Wb1ldDGQeMA?e=5shAVq

The ew slot method.chora file is the chora code.

The Page.c is the generated code based on the above chora code.

The chora code matches the PageOperationWithoutJob_CloseBackupDataManager function at line 34660 in the page.c file.

Let's compare the files generated in v9.30 with those generated in v11.0.

In v11.0 the curly braces are omitted.

In my execution environment, omitting the curly braces is causing the problem.

Below is the gdb log of the code generated in v11.0.

In line.34667, the condition of the if statement is false.

So I was expecting to go to the else statement. (Page.c 34740)

However, unexpectedly, it moves to line.34842 and the function ends.

Breakpoint 1, PageOperationWithoutJob_CloseBackupDataManager (_this=0x3e8f300 <EwMemory+61860456>,
    sender=0x3e7b6d0 <EwMemory+61779512>) at ../GeneratedCode/Page.c:34662
warning: Source file is more recent than executable.
34662   {
(gdb) n
34667     ApplicationDeviceClass_SoundTap( EwGetAutoObject( &ApplicationDevice, ApplicationDeviceClass ));
(gdb) n
34662   {
(gdb) n
34667     ApplicationDeviceClass_SoundTap( EwGetAutoObject( &ApplicationDevice, ApplicationDeviceClass ));
(gdb) n
34669     no_tools = ApplicationDeviceClass_GetRegtoolsLen( EwGetAutoObject( &ApplicationDevice,
(gdb) n
34673     if ( sender == ((XObject)&_this->BackupDataManager->OK ))
(gdb) n
34669     no_tools = ApplicationDeviceClass_GetRegtoolsLen( EwGetAutoObject( &ApplicationDevice,
(gdb) n
34673     if ( sender == ((XObject)&_this->BackupDataManager->OK ))
(gdb) n
34675       CoreGroup_OnSetEnabled((CoreGroup)&_this->BackupDataManager->OK, 0 );
(gdb) n
34677       if ( _this->BackupDataManager->Timer500ms.Enabled == 1 )
(gdb) n
34842   }
(gdb)

I can't understand why this is happening.

Can you give me some advice or tips?

My development environment is as follows.

---------------------------------------------
Target system                                i.MX 6 Software fbdev
Color format                                 RGBA8888
MemoryPool address                           0x00390898
MemoryPool size                              67108864 bytes
Framebuffer address                          0xB640C000
Off-screen buffer                            used
Display size                                 1280 x 800
Framebuffer size                             1280 x 800
EwScreenSize                                 1280 x 800
Graphics accelerator                         none
Warp function support                        enabled
Vector graphics support                      enabled
Bidirectional text support                   enabled
Gradients support                            enabled
Compression support                          enabled
Index8 bitmap resource format                enabled
RGB565 bitmap resource format                enabled
Native bitmap resource format                enabled
Native destination bitmap support            enabled
Operating system                             Embedded Linux
Toolchain                                    GCC
C-Compiler version                           4.8.1
Build date and time                          Sep  6 2021, 10:45:54
Runtime Environment (RTE) version            11.00
Graphics Engine (GFX) version                11.00
Max surface cache size                       4194304 bytes
Glyph cache size                             512 x 512
Max issue tasks                              8192
Surface rotation                             0
---------------------------------------------

Thanks.

Best regards.

 

2 Answers

0 votes
by

 

I seem to have found the cause of the problem.

Please see the post in the link below.

https://stackoverflow.com/questions/11734604/if-block-without-curly-braces-makes-subsequent-else-if-nested

In EW v11.0, as the curly braces were omitted, the if, else pair was corrupted against my intention.


In chora code, if/else pair is ...

     if (BackupDataManager.Timer500ms.Enabled == true)

     else 

But In generated code, if/else pair is ...

     if ( ApplicationDeviceClass_GetTdxToolConn( EwGetAutoObject( &ApplicationDevice, ApplicationDeviceClass ), tdx ) == 1 )

     else 


This affects the overall part of my code. so I can't trust the generated code.

Is there any way to solve it?

0 votes
by
Checked the EW 11.01 update.

Thanks.
by
Hello Hantas,

is the issue solved with 11.00.01?

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...