I start gdb in emacs with 'gdb' command. Is there a way to hide certain lines from being shown in gud buffer? For example, when I do C-c C-c on a running program, I see the following in the buffer:

Program received signal SIGINT, Interrupt.
0x0000555555555182 in main (argc=1, argv=0x7fffffffdf58) at test.cpp:6
6     for ( i=0;i<2000000000;++i){

Is there any way I can configure emacs to show a shorter string instead, for example "Interrupt test.cpp:6"?

  • Sure, I modified the question. Oct 31, 2020 at 7:56

1 Answer 1


One idea is to add advice for gud-gdbmi-marker-filter arguments:

(defun my_filter (string)
  "Filter out certain messages from GDB-MI."
   ; (message (nth 0 string))
  (if (string-match  "pattern"
        (nth 0 string))
           (list nil) string)))

(advice-add 'gud-gdbmi-marker-filter :filter-args 'my_filter)

pattern here is regualr expression for what needs to be filtered. I think I had some glitches with it, and after all I didn't need this, but I hope this may help somebody else in future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.