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. how to debug multity threads

how to debug multity threads

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++debugginghelptutorial
4 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.
  • H Offline
    H Offline
    haozl
    wrote on last edited by
    #1

    I have two threads one used to send data to COM1 buffer, the other used to monitor COM1 events. I want to know whether the corresponding event is received when I send a byte in the first thread. so I have to debug the two threads parellely, but how can i ? help me. I am a fish swimming in the sea of c++.

    F 1 Reply Last reply
    0
    • H haozl

      I have two threads one used to send data to COM1 buffer, the other used to monitor COM1 events. I want to know whether the corresponding event is received when I send a byte in the first thread. so I have to debug the two threads parellely, but how can i ? help me. I am a fish swimming in the sea of c++.

      F Offline
      F Offline
      Focht
      wrote on last edited by
      #2

      Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.

      K H 2 Replies Last reply
      0
      • F Focht

        Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.

        K Offline
        K Offline
        KingsGambit
        wrote on last edited by
        #3

        Nice answer

        1 Reply Last reply
        0
        • F Focht

          Hi, set a breakpoint in the appropriate WaitCommEvent() event type result evaluation. This is usually switch( EvtMask) where you determine the type of event. Run the debuggee. When the debugger breaks on the specified event type, simply suspend the other threads. "Debug" -> "Threads" ... "suspend" all by looking at "location" where the functions are listed that each thread executed (before break). By doing this you save yourself from hassle that is when single stepping thru one thread you end up in another thread and so on (of course its multithreaded). Hope this helps. A. Focht.

          H Offline
          H Offline
          haozl
          wrote on last edited by
          #4

          A good answer! thanks a lot. I am a fish swimming in the sea of c++.

          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