1

I have set of a .gdbinit file to run commands each time gdb is called. These commands output a lot of stuff in the shell, and it's becoming annoying.

Can I prevent commands inside .gdbinit to print to the shell?

0

3 Answers 3

3

Use set logging redirect on:

This is an example:

host: srv2-x64rh5-02, OS: Linux 2.6.18-238.el5>more .gdbinit
set logging redirect on
set logging file /dev/null
set logging on
file a.out
b main
commands
bt
info args
c
end
help
r
set logging off
quit
Sign up to request clarification or add additional context in comments.

Comments

0

Building on the other answer, I have these in my .gdbinit file that I use in other definitions and the cmd prompt:

define output_off
    set logging file /dev/null
    set logging redirect on
    set logging on
end

define output_on
    set logging off
end

Comments

-1

Yep, all of information, that have to output in the shell, you can prevent in .gdbinit You can look at example of ./gdbinit from this guy http://reverse.put.as/

1 Comment

Could you please provide a more specific link?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.