简体   繁体   中英

C++ VS2013 Debugger Breakpoint: Not Hit

I have a relatively simple C++ console project that does some calculations and writes an output file. I am trying to determine why the output file does not have the correct output. Instead, I have been struggling with the debugger.

For some reason I cannot add a break point after a certain line in a certain function .

在此输入图像描述

All breakpoints placed after line 1106 up to line 1214 (the end of the function) are not reachable.

在此输入图像描述

EDIT: I have moved the specific code shown in the first image up in the function and it breaks no problem but now I cannot break between line 1079 and the function end. I renamed the function but that made no difference.

When I look at the disassembly, I notice a strange thing at line 1078:

在此输入图像描述

I'm not sure that this makes a difference but the statement after 1078 (line 962) refers to an object named CSVData of type string. The string is created blank but filled at run-time with a large number of characters. I was originally thinking stack overflow (no pun) but the breakpoint is disabled at application start which is long before (10-15 mins) before the CSVData object is populated.

The first thought would be: Use the previous breakpoint instead. However, when I step to the next line, it takes me to a section of code that I know for sure is not executing (It's in another function entirely). It continues jumping around in a predetermined but not source-relevant pattern. Please help me. I'm losing my mind on this one!

I have Google'd this extensively before asking here. I have tried the following things:

  • Deleting all files
  • Creating new Win32 console project and adding only the 5 headers and 5 source files.
  • Resetting Visual Studio settings
  • Disable Optimization
  • Un-check "Require source files to exactly match the original version"
  • Use "Debug" config
  • Use Notepad++ to verify EOL characters

One issue that I thought may have caused this was Intel Parallel Studio Composer XE 2015 for Fortran because it added an inline and optimization option for FPP projects. I have uninstalled and restarted in an attempt to remove any issue from that installation.

Any suggestions will be welcomed. Thanks.

I have met this issue before.
try this:

File->Advanced Save Options->
set 'Line endings' to 'Windows (CR LF)'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM