Debugging the effect of CTRL-C on a C program

Sysprogs forums Forums VisualGDB Debugging the effect of CTRL-C on a C program

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20150
    RobMeades
    Participant

    I’m trying to debug the effect of SIGINT arriving in my C program (on Linux); my program explicitly handles SIGINT to perform a tidy shutdown. I can send SIGINT to the process being debugged with:

    kill -SIGINT <process_id>

    …however VisualGDB always puts up a dialog box saying that it has broken on the exception, rather than letting my program break on the exception. There’s a tick box in that dialog box saying “always break on this type of exception”, which I untick, but the next time I run the debugger and send a SIGINT the same things happens again and the option is ticked once more. I’ve looked at the list of exceptions Visual Studio offers but they appear to be Windows ones, so that doesn’t help.

    How do I stop VisualGDB breaking on the exception and just let my program handle it so that I can debug what it does?

    • This topic was modified 6 years, 1 month ago by RobMeades.
    #20156
    support
    Keymaster

    Hi,

    Please use the “Signals & Exceptions” button in the GDB Session window. It allows overriding which of the signals are passed to the program.

    Please note that disabling stops on SIGINT may stop breakpoints in your program from working, as they internally rely on catching this signal.

     

    #20167
    RobMeades
    Participant

    I guess you mean the little thunder-bolt I’ve highlighted in a red circle in the tab shown in the attached picture? It’s a bit “beware of the leopard”, could do with sign-posting from somewhere when you have the time.

    Attachments:
    You must be logged in to view attached files.
    #20170
    support
    Keymaster

    Hi,

    Sorry, we didn’t mean to make it confusing. The lightning icon is actually a standard VS icon for events, so we reused it in VisualGDB.

    You can also use the Debug->Exceptions menu (VisualGDB displays Linux signals there), although the VisualGDB-specific window provides more control over the way signals are handled.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.