VS2008调试WEC7应用程序-当前不会出现断点.此功能当前未加载可执行代码 [英] VS2008 Debug WEC7 Application - Breakpoint will not currently be hit. No executable code is currently loaded at this function

查看:163
本文介绍了VS2008调试WEC7应用程序-当前不会出现断点.此功能当前未加载可执行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将C ++ Win32控制台应用程序移植到WEC7.修复一些构建和链接错误后,我能够创建在目标上运行的可执行文件.但是我无法使用Visual Studio调试该应用程序,因为没有断点,尽管已明确执行了相应的行.

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.

为了进一步调查我的问题,我创建了2个新项目:

To further investigate my problem I created 2 new projects:

  1. Win32项目

  1. Win32 project

Win32 Smart Device项目

Win32 Smart Device project

两者都包含以下代码:

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

这时我可以调试两个项目,一个在Windows 7的笔记本上运行,另一个在WEC7的目标上运行.现在,我已将平台解决方案从项目1(Win32项目)更改为我的目标:

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:

  • 从Win32平台复制的设置

  • copied settings from Win32 platform

将调试信息格式从4设置为/Zi(不知道4的来源)

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

添加了一些WEC7预处理器定义

added some WEC7 Preprocessor Definitions

将程序部署到目标,并且工作正常(计数器已打印在控制台中),与项目2没什么不同

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

试图调试程序,但计数器和printf处的断点未命中

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

我检查了以下设置:

  • 解决方案配置设置为调试

  • Solution Configuration set to Debug

优化已禁用

将生成调试信息"设置为是"

Generate Debug Info set to Yes

比较了项目1(我的转换后的"版本)和项目2(Win32 Smart Device项目)之间的链接器命令行,但是它们是相同的->更新:实际上,它们在以下位置并不相同全部.不知道我第一次比较什么,但是在更新设置后,它可以正常工作.

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.

我已经安装了以下Visual Studio更新:

I have installed the following Visual Studio Updates:

  • SP1

  • SP1

用于Visual Studio 2008 SP1的Windows Embedded Compact 7 ATL更新( http://support .microsoft.com/kb/2483802/de )

Windows Embedded Compact 7 ATL Update for Visual Studio 2008 SP1 (http://support.microsoft.com/kb/2483802/de)

用于Windows Embedded Compact 7的Visual Studio 2008更新 ( http://support.microsoft.com/kb/2483802/de )

Visual Studio 2008 update for Windows Embedded Compact 7 (http://support.microsoft.com/kb/2483802/de)

我需要更改特定设置吗?还是我需要改变方法?

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

我基本上已经完成了基于模型的软件设计(Mathworks Embedded Coder,dSPACE Targetlink),所以我不熟悉Visual Studio和WEC7的特定特性.非常感谢您的帮助.

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.

推荐答案

这解决了我的问题:

  1. 我为WCE平台创建了一个新项目(使用模板),并检查调试是否可行.
  2. 然后,我通过在项目属性中比较编译器和链接器的命令行"来检查我的实际项目中应使用哪些选项.

存在一些差异,在我清理它们之后,我的项目运行良好.

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

Thx @brightstar

Thx @brightstar

这篇关于VS2008调试WEC7应用程序-当前不会出现断点.此功能当前未加载可执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆