[ABANDONED] Pressing Ctrl+C should generate a SIGINT signal rather than SIGTRAP

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] Pressing Ctrl+C should generate a SIGINT signal rather than SIGTRAP

    Hi,
    I'm using the J-Link GDB server to debug a STM32F401CC. I started my gdb client and connected to the server. When I press Ctrl+C, it generates a SIGTRAP signal. However, it seems that a SIGINT signal is more appropriate, as the behaviour with gdb and any ordinary x86 executable on PC. This also leads to compability issues with IDEs such as CLion, for example forum.segger.com/index.php/Thr…ing-breakpoints-on-Linux/

    I believe a returning SIGINT is more a appropriate choice.
  • Hello,

    Where do you hit "Ctrl + c"?
    What window is active at that point?
    The keystrokes are send to the active window which should be the GDB client in your case, so GDBServer does not get these keystrokes.
    If I am getting you wrong:
    Can you please re-explain what exactly(!) you are doing (or post a video)?


    BR
    Alex
  • SEGGER - Alex wrote:

    Hello,

    Where do you hit "Ctrl + c"?
    What window is active at that point?
    The keystrokes are send to the active window which should be the GDB client in your case, so GDBServer does not get these keystrokes.
    If I am getting you wrong:
    Can you please re-explain what exactly(!) you are doing (or post a video)?


    BR
    Alex
    Hi Alex,
    I've recorded two videos to demonstrate the problem.

    drive.google.com/drive/folders…SqrQOW_Kn-GxXa_9b1bM7t5Pg

    In JLinkGDB.mp4, I started the JLink GDB server with

    Source Code

    1. JLinkGDBServerCLExe -device STM32F401CC -if SWD -singlerun -strict -speed 4000
    and then connected to it as the video. I then pressed Ctrl+C to interrupt the execution.

    In NormalGDB.mp4, a.out is a simple infinite loop program. If you press Ctrl+C in gdb, a SIGINT is sent, instead of SIGTRAP in JLinkGDB's case.


    To sum up, in JLinkGDB, if you press Ctrl+C, a SIGTRAP is returned. In normal GDB, if you press Ctrl+C, a SIGINT is received. The difference is the the cause to the CLion problem. I believe SIGINT is the normal behaviour.

    The post was edited 1 time, last by t123yh ().