re:Windows VS/C++ and exiting with debuggable/traceable output
-
What would be some good ways to exit a C++ program in a way that captures a trace or dump on the way out? Would that dump be human readable or would it somehow load into the VS system and be viewed that way?
-
What would be some good ways to exit a C++ program in a way that captures a trace or dump on the way out? Would that dump be human readable or would it somehow load into the VS system and be viewed that way?
I'm not sure i understand what you mean but check this[^], maybe it can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
-
I'm not sure i understand what you mean but check this[^], maybe it can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
In my program I have a main thread and many subordinate threads. I use waitformultipleobjects for communication between them. If the main thread is spending too much time doing something (maybe stuck in a loop) then the subordinate threads back up. When one of the subordinate threads gets backed up it's coded to cause a programmatic exit(). Prior to the exit I want to get a snapshot of what's going on so I get try to figure out what the main thread was doing at that time.
-
In my program I have a main thread and many subordinate threads. I use waitformultipleobjects for communication between them. If the main thread is spending too much time doing something (maybe stuck in a loop) then the subordinate threads back up. When one of the subordinate threads gets backed up it's coded to cause a programmatic exit(). Prior to the exit I want to get a snapshot of what's going on so I get try to figure out what the main thread was doing at that time.
There is a function MiniDumpWriteDump[^] in the Dbghelp.dll. if you call that function it will create a dump file for you. Later you can analyze this dump using WinDbg.
nave [My Articles] [My Blog]
-
In my program I have a main thread and many subordinate threads. I use waitformultipleobjects for communication between them. If the main thread is spending too much time doing something (maybe stuck in a loop) then the subordinate threads back up. When one of the subordinate threads gets backed up it's coded to cause a programmatic exit(). Prior to the exit I want to get a snapshot of what's going on so I get try to figure out what the main thread was doing at that time.
Aside of creating that minidump, if possible you could simply create a debug build, place a breakpoint at that exit call (or whatever location suits you) and run it with a debugger, then when it hits the breakpoint you can look around call stacks, memory and whatnot.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
-
Aside of creating that minidump, if possible you could simply create a debug build, place a breakpoint at that exit call (or whatever location suits you) and run it with a debugger, then when it hits the breakpoint you can look around call stacks, memory and whatnot.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > "It doesn't work, fix it" does not qualify as a bug report. < > Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
Hey guys, thanks for your feedback. I'll try out these suggestions.