Visual Studio - 调试器断点移动并且不再命中他们应该到达的行 [英] Visual Studio - Debugger Breakpoints Move and no longer hit the lines they are supposed to

查看:32
本文介绍了Visual Studio - 调试器断点移动并且不再命中他们应该到达的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我在 Visual Studio 中的一个程序中看到了一个奇怪的功能.VS 允许我在文件中的某些点放置断点,但是在调试模式下它会将这些断点移动到空格和注释中.

Currently I'm seeing an oddity in functions in one of my programs in visual studio is acting. VS allows me to put break points at certain points in the file, but then in debug mode it moves these break points to spaces and comments.

我已经尝试过的事情:

  1. 删除了 PDB 文件并重新构建.
  2. 删除了 EXE 文件并重新构建.
  3. 重建整个项目.(清理,重建)
  4. 检查优化是否关闭.
  5. 检查调试路径是否与构建输出路径相同.
  6. 选中要求源文件与原始版本完全匹配"标志.

如果我的代码有一些奇怪的地方导致这里是它发生的函数:

In case there is simply something odd with my code causing this here is the function it happens in:

bool BManager::Record(string _strFile)
{
   bool bSuccess = false;
   CBitmap * bitmap = new CBitmap();
   HBITMAP  handle = NULL;
   HPALETTE hPalette = NULL;
   //LoadBitmapFromBMPFile( (LPTSTR)_strFile.c_str(), &handle, &hPalette);
   ofstream out;
   out.open(_strFile.c_str());

   handle = (HBITMAP)LoadImage(NULL, (LPTSTR)_strFile.c_str(), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);

   bitmap->FromHandle(handle);
   bSuccess = ImageBitmap_Record(bitmap);
   delete bitmap;
   bitmap = NULL;
   CloseHandle(handle);
   return bSuccess;
}

有什么想法吗?

推荐答案

我发现行尾可能会导致这样的问题.一旦我不小心将一些行从 windows 风格的马车改成了 linux 风格的马车,调试点就不再打线了.我为解决这个问题所做的是使用 notepad++ 来修复 EOL

I found end-of-line could cause the problem like this. Once I changed some lines from the windows style carriage to linux style carriage by accident, the debugging point no longer hit the line. What I did to solve the problem was using notepad++ to fix EOL

这篇关于Visual Studio - 调试器断点移动并且不再命中他们应该到达的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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