One Man's Notes

Monday, November 28, 2016

c++ Pause Hack

A Snippet to use to make something pause until a debugger can attach to it.

void pauseForTest()
{
FILE *fin = 0;
do {
if (fin)
fclose(fin);
::Sleep(2000);
fin = fopen("C:\\delme\\pause.txt", "r");
} while (fin);
}

Posted by Solx at 11:15 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: c++, debugging-native
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Links

  • Crusader Kings How To

Labels

.NET ant antrun apt AWS batch-windows bean c++ Chrome cmd cygwin debugging-native docker dynamodb FAQ fiddler Hibernate http http-debugging IIS Intellij-IDEA java jvm Linux Linux-installer linux-setup maven networking node.js postgreSQL python S3 socat spring SQL-Server ssh trick Ubuntu Ubuntu-installer vi vim VirtualBox Windows Windows-Administration

About Me

Solx
View my complete profile

Blog Archive

  • ►  2017 (14)
    • ►  December (1)
    • ►  October (1)
    • ►  September (1)
    • ►  June (3)
    • ►  April (1)
    • ►  March (5)
    • ►  February (1)
    • ►  January (1)
  • ▼  2016 (21)
    • ▼  November (1)
      • c++ Pause Hack
    • ►  October (1)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (3)
    • ►  February (4)
    • ►  January (6)
  • ►  2015 (30)
    • ►  December (2)
    • ►  October (1)
    • ►  September (4)
    • ►  August (23)
Ethereal theme. Powered by Blogger.