VS2008 Debug WEC7 Application - Breakpoint will no

2019-09-04 06:13发布

I have to port a C++ Win32 console application to WEC7. After I fixed some build and link errors I was able to create an executable that runs on the target. But I could not debug that application with Visual Studio, because the breakpoints were not hit, although the corresponding lines were definitly executed.

To further investigate my problem I created 2 new projects:

  1. Win32 project

  2. Win32 Smart Device project

Both include the following code:

#include "stdio.h"
void main(void)
{
    int i=0;
    while(1)
    {
        printf("i=%d\n",i);
        i++;
    }
}

At this point I can debug both projects, one running on my notebook at Windows 7 and one running at my target on WEC7. Now I have changed the platform solution from project 1 (Win32 project) to my target:

  • copied settings from Win32 platform

  • set Debug Information Format from 4 to /Zi (no idea where the 4 came from)

  • added some WEC7 Preprocessor Definitions

  • deployed the programm to the target and it works fine (the counter is printed in the console), no difference to project 2

  • tried to debug the program, but the breakpoints at the counter and the printf were not hit

I checked the following settings:

  • Solution Configuration set to Debug

  • Optimization is Disabled

  • Generate Debug Info set to Yes

  • compared the command line of the linker between project 1 (my "converted" version) and project 2 (Win32 Smart Device project), but they are identical -> Update: Actually they were not identical at all. Don't know what I compared the first time, but after I updated the settings it worked fine.

I have installed the following Visual Studio Updates:

Do I need to change a specific setting? Or do I need to change my approach?

I have mostly done model based software design (Mathworks Embedded Coder, dSPACE Targetlink), so I not familiar with Visual Studio and WEC7 specific characteristics. I would very much appreciate any help.

2条回答
手持菜刀,她持情操
2楼-- · 2019-09-04 06:35

This solved my Problem:

  1. I created a new project (using template) for WCE platform and checked if debugging works.
  2. Then I checked which options should be used in my actual project by comparing 'Commmand Line' for Compiler and Linker in project properties.

There were several differences and after I cleaned them up, my project worked fine.

Thx @brightstar

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-09-04 06:55

There are several Updates for VS2008 to make it Debug on Windows Embedded Compact 7. Did you install them?

For example there is http://www.microsoft.com/en-us/download/details.aspx?id=11935

查看更多
登录 后发表回答