Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. re:Windows VS/C++ and exiting with debuggable/traceable output

re:Windows VS/C++ and exiting with debuggable/traceable output

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiodebuggingquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alan Kurlansky
    wrote on last edited by
    #1

    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?

    C 1 Reply Last reply
    0
    • A Alan Kurlansky

      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?

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      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. <

      A 1 Reply Last reply
      0
      • C Code o mat

        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. <

        A Offline
        A Offline
        Alan Kurlansky
        wrote on last edited by
        #3

        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.

        N C 2 Replies Last reply
        0
        • A Alan Kurlansky

          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.

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          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]

          1 Reply Last reply
          0
          • A Alan Kurlansky

            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.

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            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. <

            A 1 Reply Last reply
            0
            • C Code o mat

              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. <

              A Offline
              A Offline
              Alan Kurlansky
              wrote on last edited by
              #6

              Hey guys, thanks for your feedback. I'll try out these suggestions.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups