- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi folks, I've got a strange one here:
I'm using Win7/VC++ 2008/ Intel C++ compiler 11 plug-in.
I have a project that was working correctly. It runs well, produces the correct output and I can debug it if need be. I thought I'd make some modifications to the class layout and - being cautious - copied the whole project into another folder and started modifying this duplicate version. When I tried to run in debug mode and stop at a breakpoint, to my astonishment the debugger stopped in a function that I wasn't calling. I double-checked that I was indeed building in debug mode and tried again...same behavior. After fussing for an hour or so (which included several restarts of both the computer and VS 2008) I decided to go back to the original unmodified project that was working properly and try that again. Incredibly, this one now behaves the same when debugging even though on Friday everything was working normally and it hadn't been modified since then (other than being copied). When I run the debug version without actually trying to debug it i.e. no breakpoints, etc it runs all the way through and generates the correct output as usual. When trying to run to a breakpoint or the cursor, it stops in sections of the code that it shouldn't be in in the first place and starts hopping around, landing on blank lines, etc. After a lot of head-scratching - > swearing, I've noticed the following pattern which implies there's some sort of graphical error in what is being shown in my code editor window when trying to debug. Consider two functions in my source code, arranged one above the other:
void Func1(int x)
{
if(x == 0) // <- Put a breakpoint at this conditional statement. At runtime this evaluates to false and it will test the next condition.
{
.
.
}
else if(x == 1)
{
.
.
}
}
void Func2(int y)
{
// Some general code, completely unrelated to the code above.
.
.
. // <- When debugging, debugger stops here (call it "line x") even though this code/function is never invoked!
.
.
.
.
. // <- It then jumps here, as though it were executing the "if-else" block in the above function, which I believe it is since it runs fine.
.
}
It seems like the code block being shown in the code editor while I'm trying to step through under the debugger is not the code block that is actually being interrogated by the debugger. This explains the crazy behavior as I try to step through line by line. One other note...if I try to interrogate the value of a variable by hovering the mouse cursor over it, I get nothing. If I add the variable to the watch window I get an error in the watch window warning me the variable is not in the stack frame, or something like that. Has anyone else seen this? Is my project somehow schmutzed-up and, if so, is there a way to force a total "regeneration" to try and get things back to normal? Thanks in advance!
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »