Disable print pretty in gdb

I'm aware that we can enable pretty printing in gdb set print pretty. But is there an unset? I sometimes would like to toggle it. I couldn't find any documentation of it not any answers in Stackoverflow.

3

2 Answers

For newer versions of gdb ( currently using gdb 9.1 ) this did not work any longer. We have to use:

> disable pretty-printer 

See gdb doc

2

Use

set print pretty off 

From documentation:

set print pretty on
Cause GDB to print structures in an indented format with one member per line, like this:

$1 = { next = 0x0, flags = { sweet = 1, sour = 1 }, meat = 0x54 "Pork" } 

set print pretty off
Cause GDB to print structures in a compact format, like this:

$1 = {next = 0x0, flags = {sweet = 1, sour = 1}, \ meat = 0x54 "Pork"} 

This is the default format.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like