Re: [PATCH v2 1/1] gdb: Introduce new setting to filter out shadowed variables.
Tom Tromey <[email protected]>
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "Stephan" == Stephan Rohr <[email protected]> writes: Stephan> +* New commands Stephan> + Stephan> +set print shadowed on|off Stephan> +show print shadowed Stephan> +This controls the output of the "info locals" command. If the option is 'off' Stephan> +shadowed variables will be omitted in output. The default is to print Stephan> +shadowed variables. Needs a doc review but I think the explanation lines should be indented. Stephan> +/* Option for printing shadowed variables. */ Stephan> + Stephan> +struct shadowed_print_options Stephan> +{ Stephan> + bool print_shadowed = true; I don't really follow why this type is needed. Stephan> print_variable_and_value (print_name, sym, frame, stream, num_tabs, Stephan> - shadow_status); Stephan> + print_shadowed ? shadow_status Stephan> + : var_shadowing::NONE); Lining things up like this isn't really the gdb style; you could break before the "?" instead. Stephan> + if (cb_data.printed_shadowed_variables) Stephan> + gdb_printf (stream, Stephan> + _("Use 'set print shadowed off' " Stephan> + "to hide shadowed variables.\n")); Stephan> + else if (cb_data.omitted_shadowed_variables) Stephan> + gdb_printf (stream, Stephan> + _("Some shadowed variables were omitted, use " Stephan> + "'set print shadowed on' to include them.\n")); I'm slowly trying to transition gdb to using double quotes rather than the current mishmash of quoting styles. Also command names should be styled using command_style. thanks, Tom