Search code examples
debugginggdbblackfin

Disable GDB output during user defined commands


Is it possible to disable the output from GDB during user defined commands? I have the following command:

define stepi_to
    if $argc != 1
        printf "usage: stepi_to <address>\n"
    else
        while $pc != $arg0
            stepi
        end
    end
end

Here is an example of the command:

(gdb) stepi
0xef000004 in ?? ()
(gdb) stepi_to 0xef000014
0xef000008 in ?? ()
0xef00000c in ?? ()
0xef000010 in ?? ()
0xef000014 in ?? ()

I'm not interested in the output " in ?? ()".

I have tried to redirect the output via "set logging redirect on", but this isn't working.

Hardware breakpoints (buggy) and Python scripts aren't an option, because it's an embedded system (blackfin) with an old GDB.


Solution

  • Yes, it is possible. I think you just need to set the other "set logging" parameters. In particular I think you probably want:

    (gdb) set logging file /dev/null
    (gdb) set logging redirect on
    (gdb) set logging on