aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/error.cc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2024-10-18 21:51:35 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2024-10-18 21:51:35 -0400
commit2ca19d43fb5d7598c4a6fa9bfbfaf6dea4ea7c33 (patch)
tree801be4b4fba7215ad3db681c8d5d615a54d62f20 /gcc/fortran/error.cc
parentd277ded292d7e9eeaa0b8bce6782c4cd6b32d2c0 (diff)
downloadgcc-2ca19d43fb5d7598c4a6fa9bfbfaf6dea4ea7c33.zip
gcc-2ca19d43fb5d7598c4a6fa9bfbfaf6dea4ea7c33.tar.gz
gcc-2ca19d43fb5d7598c4a6fa9bfbfaf6dea4ea7c33.tar.bz2
diagnostics: add debug dump functions
This commit expands on r15-3973-g4c7a58ac2617e2, which added debug "dump" member functiosn to pretty_printer and output_buffer. This followup adds "dump" member functions to diagnostic_context and diagnostic_format, extends the existing dump functions and adds indentation to make it much easier to see the various relationships between context, format, printer, etc. Hence you can now do: (gdb) call global_dc->dump () and get a useful summary of what the diagnostic subsystem is doing; for example: (gdb) call global_dc->dump() diagnostic_context: counts: output format: sarif_output_format printer: m_show_color: false m_url_format: bel m_buffer: m_formatted_obstack current object: length 0: m_chunk_obstack current object: length 0: pp_formatted_chunks: depth 0 0: TEXT("Function ")] 1: BEGIN_QUOTE, TEXT("program"), END_QUOTE] 2: TEXT(" requires an argument list at ")] 3: TEXT("(1)")] showing the counts of all diagnostic kind that are non-zero (none yet), that we have a sarif output format, and the printer is part-way through formatting a string. gcc/ChangeLog: * diagnostic-format-json.cc (json_output_format::dump): New. * diagnostic-format-sarif.cc (sarif_output_format::dump): New. (sarif_file_output_format::dump): New. * diagnostic-format-text.cc (diagnostic_text_output_format::dump): New. * diagnostic-format-text.h (diagnostic_text_output_format::dump): New decl. * diagnostic-format.h (diagnostic_output_format::dump): New decls. * diagnostic.cc (diagnostic_context::dump): New. (diagnostic_output_format::dump): New. * diagnostic.h (diagnostic_context::dump): New decls. * pretty-print-format-impl.h (pp_formatted_chunks::dump): Add "indent" param. * pretty-print.cc (bytes_per_hexdump_line): New constant. (print_hexdump_line): New. (print_hexdump): New. (output_buffer::dump): Add "indent" param and use it. Add hexdump of current object in m_formatted_obstack and m_chunk_obstack. (pp_formatted_chunks::dump): Add "indent" param and use it. (pretty_printer::dump): Likewise. Add dumping of m_show_color and m_url_format. * pretty-print.h (output_buffer::dump): Add "indent" param. (pretty_printer::dump): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_xhtml_format.c (xhtml_output_format::dump): New. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/fortran/error.cc')
0 files changed, 0 insertions, 0 deletions