llvm-project/llvm/test/tools
Pavel Labath ced45978a2 Recommit "[DWARFDebugLine] Avoid dumping prologue members we did not parse"
The patch was reverted in 69da40033 because of test failures on windows.
The problem was the unpredictable order of some of the error messages,
which I've tried to strenghten in that patch.

It turns out this is not possible to do in verbose mode because there
the data is being writted as it is being parsed. No amount of flushing
(as I've done in the non-verbose mode) will help that. Indeed, even
without any buffering the warning messages can end in the middle of a
line in non-verbose mode.

In this patch, I have reverted the changes which tested the relative
position of the warning message, except for the messages about
unsupported initial length, which are the ones I really wanted to test,
and which do come out reasonably.

The original commit message was:

This patch if motivated by D74560, specifically the subthread about what
to print upon encountering reserved initial length values.

If the debug_line prologue has an unsupported version, we skip parsing
the rest of the data. If we encounter an reserved initial length field,
we don't even parse the version. However, we still print out all members
(with value 0) in the dump function.

This patch introduces early exits in the Prologue::dump function so that
we print only the fields that were parsed successfully. In case of an
unsupported version, we skip printing all subsequent prologue fields --
because we don't even know if this version has those fields. In case of a
reserved unit length, we don't print anything -- if the very first field
of the prologue is invalid, it's hard to say if we even have a prologue
to begin with.

Note that the user will still be able to see the invalid/reserved
initial length value in the error message. I've modified (reordered)
debug_line_invalid.test to show that the error message comes straight
after the debug_line offset. I've also added some flush() calls to the
dumping code to ensure this is the case in all situations (without that,
the warnings could get out of sync if the output was not a terminal -- I
guess this is why std::iostreams have the tie() function).

Reviewers: jhenderson, ikudrin, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75043
2020-02-26 16:42:25 +01:00
..
UpdateTestChecks Move update_cc_test_checks.py tests to clang 2020-02-14 14:39:55 +00:00
dsymutil [dsymutil] Fix double relocation of DW_AT_call_return_pc 2020-02-13 17:42:48 -08:00
gold Restore "[LTO/WPD] Enable aggressive WPD under LTO option" 2020-01-27 07:55:05 -08:00
llc Address redirect issue on Windows. 2020-01-16 15:07:50 -05:00
llvm-ar Make quick-append.test resilient to running in paths with '1.o' in the name 2020-02-03 11:35:24 +01:00
llvm-as
llvm-cfi-verify
llvm-config
llvm-cov [llvm-cov] Add support for -skip-functions to lcov 2020-01-22 12:49:00 -08:00
llvm-cvtres [COFF] Add a ResourceSectionRef method for getting resource contents 2019-08-30 06:55:49 +00:00
llvm-cxxdump [llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator> 2019-10-21 11:06:38 +00:00
llvm-cxxfilt [llvm-cxxfilt] Correctly demangle COFF import thunk 2019-12-16 09:50:04 -08:00
llvm-cxxmap Fix non-portable GNU diff option 2019-10-23 11:19:01 -04:00
llvm-diff
llvm-dlltool [llvm-ar] Improve tool selection heuristic 2019-12-10 17:32:50 -08:00
llvm-dwarfdump Recommit "[DWARFDebugLine] Avoid dumping prologue members we did not parse" 2020-02-26 16:42:25 +01:00
llvm-dwp [DebugInfo] Pass linux triple to tests requiring ELF. 2020-02-19 10:41:40 +01:00
llvm-elfabi [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
llvm-exegesis [llvm-exegesis] Exploring X86::OperandType::OPERAND_COND_CODE 2020-02-12 21:33:52 +03:00
llvm-extract [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
llvm-gsymutil Add a llvm-gsymutil tool that can convert object files to GSYM and perform lookups. 2020-02-25 21:11:05 -08:00
llvm-ifs [llvm] llvm-ifs: Support for handling empty IFS and merging weak+strong symbols. 2019-12-05 12:56:37 -05:00
llvm-isel-fuzzer
llvm-lib Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
llvm-lipo [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
llvm-lit
llvm-locstats Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
llvm-lto
llvm-lto2 Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
llvm-mc
llvm-mca [X86] Increase latency of port5 masked compares and kshift/kadd/kunpck instructions in SKX scheduler model 2020-02-16 16:59:37 -08:00
llvm-ml Reland "[ms] [llvm-ml] Improve data support, adding names and complex initializers." 2020-02-24 16:40:25 -05:00
llvm-modextract
llvm-mt
llvm-nm [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
llvm-objcopy [yaml2obj] - Automatically assign sh_addr for allocatable sections. 2020-02-22 14:43:54 +03:00
llvm-objdump [DebugInfo] Fix printing CIE offsets in EH FDEs. 2020-02-25 17:10:29 +07:00
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbutil
llvm-profdata [llvm-profdata] Fix hint message since argument format has changed 2020-01-20 20:57:03 +08:00
llvm-ranlib [llvm-ranlib][test] Fix rwx- after a4f3847f3d 2020-02-14 19:41:55 -08:00
llvm-rc [llvm-readobj] Print the resource type textually for .res files 2019-08-29 08:59:31 +00:00
llvm-readobj [yaml2obj] - Automatically assign sh_addr for allocatable sections. 2020-02-22 14:43:54 +03:00
llvm-size [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
llvm-split
llvm-strings [llvm-strings][test] Merge two closely related tests 2019-09-02 11:42:30 +00:00
llvm-symbolizer Print discriminators when printing .debug_line in GNU style. 2020-01-29 12:22:12 -08:00
llvm-xray [xray] add --no-demangle cli opt for llvm-xray extract to output mangled names 2020-01-16 16:37:00 -08:00
lto
obj2yaml [yaml2obj] - Automatically assign sh_addr for allocatable sections. 2020-02-22 14:43:54 +03:00
opt-viewer
sancov Revert 374629 "[sancov] Accommodate sancov and coverage report server for use under Windows" 2019-10-12 05:23:43 +00:00
sanstats [test] Use yaml2obj -o %t instead of > %t 2020-01-21 17:20:18 -08:00
yaml2obj [yaml2obj] - Address post commit comments for D74764 2020-02-25 13:26:46 +03:00