Multithreaded debugging.

Multithreaded debugging.
I wish I could tell the debugger that I don't care about breaking on exceptions in the IndyClient thread, but only in the primary thread. I.e. ignore specific thread classes or in some other way instruct the debugger to only do break on exception (or even breakpoints) in the thread(s) of my choice.

Comments

  1. IIRC you have an ignore exception list for the debugger, where you can add TIdExceptionClassNameHere

    ReplyDelete
  2. Those are all in there - and still I get breaks at times - which is weird. The real problem is generic exceptions which are properly handled in other threads - but may need debugging in my "target" thread.

    ReplyDelete
  3. You can select thread in breakpoint properties.

    ReplyDelete
  4. And also pause app in a way that it would pause it when execution is in the selected thread(s). Annoying to pause app and you have no idea where it is, and if you check running thread they all are in somewhere in System.pas etc :( (If you know where thread are looping then it is easy but when something unexpected happens and you would like to find where it wastes it's time :) )

    ReplyDelete
  5. Ondrej Kelle - that is sort of the inverse of the problem.  That is for intentional stop in intentional thread.  I want to prevent unintentional stops in other threads than the one that I am debugging.  I.e. I want EAccessViolation to stop in "my" thread, but be ignored in the other threads.

    Tommi Prami - That too!

    ReplyDelete
  6. How would you tell it the debugger? Via the popup menu of the Thread Status window for Thread Id x for the current session? At the same place for a thread with a specific name, that would survive and be available in the next debugging session? From the code of the debugged application?

    ReplyDelete
  7. Good questions, Uwe Schuster. The most "obvious" option is limiting exception trapping to the main thread. The next alternative would be "Silence exceptions in "this" thread from now on" when breaking on one you don't care about. A fixed config is probably challenging - unless the threads are subclassed and as such remain identifiable by class?

    ReplyDelete
  8. Lars Fosdal Limiting the exception notification to the main thread is quite simple.
    You should go ahead and file a QP. A "Silence exceptions in "this" thread from now on" checkbox in the Debugger Exception Notification dialog should be possible as well, but it could be a little bit confusing, because the existing checkbox "[x] Ignore this exception type" is something global with persistence. I don't think that the debugger knows the class of a thread.

    ReplyDelete

Post a Comment