Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"11-08-11 - Differences Running in Debugger"

6 Comments -

1 – 6 of 6
Blogger ryg said...

Attaching: I like "while (!IsDebuggerPresent()) Sleep(500);" for this - works even if the Just-in-Time debugging stuff is flaky (as it often is).

November 9, 2011 at 1:17 PM

Blogger Tom Forsyth said...

Don't know if the runtime leak/scribble checking is at compile time or debugger time. But it adds padding to stack & allocation and changes page tables. Indirect effects are of course that it changes alignment, etc.

November 9, 2011 at 9:21 PM

Blogger cbloom said...

Tom - yeah I was thinking about that stuff, but so far as I can tell it's not affected by being in debugger or not (as long as you don't actually trigger one of the checks)

November 9, 2011 at 9:33 PM

Blogger Jonathan said...

I actually find the bit of code on this page useful for causing an attach.

http://www.codeproject.com/Tips/254524/Self-debugger-attach-to-process?display=Print

Because it calls the jit debugger directly it doesn't rely on the OS bringing it up which does seem not to work sometimes.

I skip the last bit that actually stops the process.

November 9, 2011 at 10:47 PM

Blogger Dark Helmet said...

http://stackoverflow.com/questions/6103314/visual-studio-debug-iterators

Just flipping between debug and release can render your binary app incompatible with libs it uses. Annoying...

November 10, 2011 at 5:52 AM

Blogger Philip Taylor said...

There's a paper "Producing Wrong Data Without Doing Anything Obviously Wrong!" showing how factors like the number of bytes of environment variables can alter the stack layout on Unix and significantly affect performance. Don't know if that particular case applies to Windows too.

November 11, 2011 at 12:55 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.