[all-commits] [llvm/llvm-project] bfdd78: Aggregate errors from llvm-dwarfdump --verify (#79...

Kevin Frei via All-commits all-commits at lists.llvm.org
Thu Feb 1 08:47:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bfdd78233fba4623366bbef5631ff0ebab29c42e
      https://github.com/llvm/llvm-project/commit/bfdd78233fba4623366bbef5631ff0ebab29c42e
  Author: Kevin Frei <kevinfrei at users.noreply.github.com>
  Date:   2024-02-01 (Thu, 01 Feb 2024)

  Changed paths:
    M llvm/include/llvm/DebugInfo/DIContext.h
    M llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
    M llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
    M llvm/test/DebugInfo/X86/skeleton-unit-verify.s
    M llvm/test/DebugInfo/dwarfdump-accel.test
    M llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes.yaml
    M llvm/test/tools/llvm-dwarfdump/X86/verify_attr_file_indexes_no_files.yaml
    M llvm/test/tools/llvm-dwarfdump/X86/verify_file_encoding.yaml
    M llvm/test/tools/llvm-dwarfdump/X86/verify_overlapping_cu_ranges.yaml
    M llvm/test/tools/llvm-dwarfdump/X86/verify_parent_zero_length.yaml
    M llvm/test/tools/llvm-dwarfdump/X86/verify_split_cu.s
    M llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

  Log Message:
  -----------
  Aggregate errors from llvm-dwarfdump --verify (#79648)

The amount and format of output from `llvm-dwarfdump --verify` makes it
quite difficult to know if a change to a tool that produces or modifies
DWARF is causing new problems, or is fixing existing problems. This diff
adds a categorized summary of issues found by the DWARF verifier, on by
default, at the bottom of the error output.

The change includes a new `--error-display` option with 4 settings:

* `--error-display=quiet`: Only display if errors occurred, but no
details or summary are printed.
* `--error-display=summary`: Only display the aggregated summary of
errors with no error detail.
* `--error-display=details`: Only display the detailed error messages
with no summary (previous behavior)
* `--error-display=full`: Display both the detailed error messages and
the aggregated summary of errors (the default)

I changed a handful of tests that were failing due to new output, adding
the flag to use the old behavior for all but a couple. For those two I
added the new aggregated output to the expected output of the test.

The `OutputCategoryAggregator` is a pretty simple little class that
@clayborg suggested to allow code to only be run to dump detail if it's
enabled, while still collating counts of the category. Knowing that the
lambda passed in is only conditionally executed is pretty important
(handling errors has to be done *outside* the lambda). I'm happy to move
this somewhere else (and change/improve it) to be more broadly useful if
folks would like.

---------

Co-authored-by: Kevin Frei <freik at meta.com>




More information about the All-commits mailing list