llvm-project/llvm/test/tools/llvm-dwarfdump/X86
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
..
Inputs [DebugInfo] Add checks for v2 directory and file name table terminators 2020-02-12 14:49:22 +00:00
DW_AT_object_pointer.s
apple-names-die-offset-data.s
apple-names-die-offset-ref.s
apple_names_verify_data.s
apple_names_verify_form.s
apple_names_verify_num_atoms.s
apple_types_verify_tag.s
archive.test
brief.s DebugInfo: Allow dumping macinfo and macinfo.dwo from the same file 2020-01-31 12:47:50 -08:00
callsite-invalid.s [DebugInfo] Add support for DWARF5 call site-related attributes 2018-10-05 20:37:17 +00:00
debug-abbrev.s [test][llvm-dwarfdump] Add missing testing for some --debug-* options 2019-12-11 13:42:54 +00:00
debug-line-dw-lne-end-sequence.s [DebugInfo] Fix verbose printing of rows added via DW_LNE_end_sequence 2019-12-19 12:54:04 +00:00
debug-line-dw-lns-copy.s [DWARF] Set discriminator to 0 for DW_LNS_copy 2019-04-11 02:02:44 +00:00
debug-line.s DWARFDebugLine.cpp: Format unknown line number standard opcodes 2020-01-15 10:45:50 -05:00
debug-names-find-dwo.s [DebugInfo][test] Fix section flags/type to avoid warning/error in the future 2020-02-18 20:51:41 -08:00
debug-names-find.s
debug-names-many-tu.s [DWARF] Fix dump of local/foreign TU lists in .debug_names 2019-04-29 08:55:10 +00:00
debug-names-misaligned.s
debug-names-multi-find.s
debug-names-verify-abbrev-duplicate.s
debug-names-verify-abbrev-forms.s
debug-names-verify-abbrev-short.s
debug-names-verify-buckets.s
debug-names-verify-completeness.s [DWARFVerifier] Use the new location list api 2019-11-22 10:08:39 +01:00
debug-names-verify-cu-lists.s
debug-names-verify-entries.s
debug-names-verify-no-buckets.s
debug-names-verify-short1.s
debug-names-verify-short2.s
debug-names-verify-short3.s
debug-names-verify-unhashed-names.s
debug-names-verify-wrong-hash.s
debug-verify-object.s Revert "Revert "DebugInfo: reduce DIE range verification on object files"" 2018-10-28 22:30:48 +00:00
debug_addr.s
debug_addr_64bit_address.s
debug_addr_absent.s
debug_addr_address_size_mismatch.s [DebugInfo] Use "an address table" in diagnostic messages of DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_address_size_not_multiple.s [DebugInfo] Simplify DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_dwarf4.s [DebugInfo] Do not dump header field for pre-DWARFv5 address tables. 2020-02-12 13:33:00 +07:00
debug_addr_dwarf64.s [DebugInfo] Add support for DWARF64 into DWARFDebugAddr. 2020-02-12 13:33:01 +07:00
debug_addr_empty.s
debug_addr_invalid_addr_size.s [DebugInfo] Refine error messages in DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_rela.s [DebugInfo] Fix reading addresses in DWARFDebugAddr. 2020-02-12 13:32:59 +07:00
debug_addr_reserved_length.s [DebugInfo] Add support for DWARF64 into DWARFDebugAddr. 2020-02-12 13:33:01 +07:00
debug_addr_segment_selector.s [DebugInfo] Use "an address table" in diagnostic messages of DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_small_length_field.s [DebugInfo] Refine error messages in DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_too_small_for_extended_length_field.s [DebugInfo] Add support for DWARF64 into DWARFDebugAddr. 2020-02-12 13:33:01 +07:00
debug_addr_too_small_for_length_field.s [DebugInfo] Use "an address table" in diagnostic messages of DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_too_small_for_section.s [DebugInfo] Refine error messages in DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_addr_unsupported_version.s [DebugInfo] Simplify DWARFDebugAddr. 2020-02-12 13:33:00 +07:00
debug_aranges-error.s [DWARF] Return Error from DWARFDebugArangeSet::extract(). 2020-01-23 12:41:05 +07:00
debug_expr_convert.s [DebugInfo] Prep llvm-dwarfdump for typed DW5 ops. 2019-02-21 08:20:24 +00:00
debug_frame_GNU_args_size.s [DebugInfo] Fix printing CIE offsets in EH FDEs. 2020-02-25 17:10:29 +07:00
debug_frame_offset.test [DebugInfo] Fix printing CIE offsets in EH FDEs. 2020-02-25 17:10:29 +07:00
debug_info_addrx.s DebugInfo: Don't use implicit zero addr_base 2019-12-18 16:28:19 -08:00
debug_info_min_dwarf64.s [DWARF] Fix DWARFUnit::getDebugInfoSize() for 64-bit DWARF. 2019-08-20 09:50:44 +00:00
debug_info_offset.test
debug_line_invalid.test Recommit "[DWARFDebugLine] Avoid dumping prologue members we did not parse" 2020-02-26 16:42:25 +01:00
debug_line_offset.test
debug_loc-OP_addr.s DWARFDebugLoc(v4): Add an incremental parsing function 2019-11-15 13:38:00 +01:00
debug_loc_OP_GNU_entry_value.s [DWARF] Handle the DW_OP_entry_value operand 2019-06-27 13:52:34 +00:00
debug_loc_OP_entry_value.s [DWARF] Handle the DW_OP_entry_value operand 2019-06-27 13:52:34 +00:00
debug_loc_base_address.s DWARFDebugLoc(v4): Add an incremental parsing function 2019-11-15 13:38:00 +01:00
debug_loc_dwo.s [DebugInfo][test] Fix section flags/type to avoid warning/error in the future 2020-02-18 20:51:41 -08:00
debug_loc_offset.test DWARFDebugLoc(v4): Add an incremental parsing function 2019-11-15 13:38:00 +01:00
debug_loclists.s [DWARFDebugLoclists] Add support for other DW_LLE encodings 2019-12-04 10:38:21 +01:00
debug_loclists_multiple.s DWARFDebugLoclists: stricter base address handling 2019-11-14 10:01:48 +01:00
debug_loclists_startx_length.s DWARFDebugLoclists: add location list "interpretation" logic 2019-11-12 10:40:13 +01:00
debug_rnglists.s llvm-dwarfdump: Support RLE_addressx and RLE_startx_length in .debug_rnglists 2018-10-20 06:16:25 +00:00
debug_rnglists_dwarf64.s [DWARF] Support DWARF64 in DWARFListTableHeader. 2019-09-05 06:49:05 +00:00
debug_rnglists_empty.s
debug_rnglists_invalid.s [DWARF] Support DWARF64 in DWARFListTableHeader. 2019-09-05 06:49:05 +00:00
debug_rnglists_reserved_length.s [DWARF] Support DWARF64 in DWARFListTableHeader. 2019-09-05 06:49:05 +00:00
debug_tls_relocs.s [llvm-dwarfdump] - Do not error out on R_X86_64_DTPOFF64/R_X86_64_DTPOFF32 relocations. 2018-12-18 12:15:01 +00:00
debug_type_offset.test
debugloc.s DWARFDebugLoc(v4): Add an incremental parsing function 2019-11-15 13:38:00 +01:00
diff.test
dw_op_regval_type.s Add dwarfdump support for DW_OP_regval_type. 2020-01-29 10:02:23 -08:00
eh-frame-return-address-reg.s [DebugInfo][test] Fix section flags/type to avoid warning/error in the future 2020-02-18 20:51:41 -08:00
empty-CU.s
enum.s [dwarfdump] Add flag to limit the number of parents DIEs 2019-05-24 21:11:28 +00:00
exprloc.s DebugInfo: Support dumping any exprloc as an expression 2019-12-23 19:18:47 -08:00
find.test
form.test
formclass2.s [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets. 2019-03-05 23:47:22 +00:00
formclass4.s [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets. 2019-03-05 23:47:22 +00:00
gnu_call_site.s
invalid_abstract_origin.s
lit.local.cfg
locstats.ll Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
lookup.s
multiple-sections.test
name.test llvm-dwarfdump: Extend --name to also search DW_AT_linkage_name. 2018-10-09 20:51:33 +00:00
no_apple_names_verify.s
no_debug_addr.s [llvm/DWARF] Return section offset from DWARFUnit::get{Loc,Rng}listOffset 2019-12-05 12:35:09 +01:00
prettyprint_types.s llvm-dwarfdump: Improve/fix pretty printing of array dimensions 2018-12-19 19:34:24 +00:00
statistics-base-address.s [llvm-dwarfdump][Statistics] Unify coverage statistic computation 2019-12-08 15:46:49 +03:00
statistics-dwo.test [llvm-dwarfdump][Statistics] Unify coverage statistic computation 2019-12-08 15:46:49 +03:00
statistics-v3.test [llvm-dwarfdump][Statistics] Unify coverage statistic computation 2019-12-08 15:46:49 +03:00
statistics.ll [llvm-dwarfdump][Statistics] Distinguish parameters with same name or w/o a name 2020-01-28 20:52:20 +02:00
stats-dbg-callsite-info.ll Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
stats-inlining-multi-cu.ll lvm-dwarfdump: Stop counting out-of-line subprogram in the "inlined functions" statistic. 2019-02-08 00:51:33 +00:00
stats-inlining-single-cu.ll lvm-dwarfdump: Stop counting out-of-line subprogram in the "inlined functions" statistic. 2019-02-08 00:51:33 +00:00
stats-mulitple-cu-out-of-line.ll [llvm-dwarfdump][Statistics] Count more than one conrete out-of-line instances of a function 2020-01-28 20:52:19 +02:00
stats-multiple-cu-members.ll [llvm-dwarfdump][Statistics] Make calculations of vars in global scope more accurate 2020-01-28 20:52:20 +02:00
stats-multiple-cu-same-name.ll [llvm-dwarfdump][Statistics] Distinguish functions/variables with same name across different CUs 2020-01-28 19:50:46 +02:00
stripped.test
typeunit-name.s [DebugInfo][test] Fix section flags/type to avoid warning/error in the future 2020-02-18 20:51:41 -08:00
typeunit-v4-dwarf64.s [DWARF] Fix reading 64-bit DWARF type units. 2019-08-20 12:52:32 +00:00
typeunit-v5-dwarf64.s [DWARF] Fix reading 64-bit DWARF type units. 2019-08-20 12:52:32 +00:00
valid-call-site-GNU-extensions.ll Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
verbose.test [DebugInfo]Print correct value for special opcode address increment 2019-02-06 10:31:50 +00:00
verify_broken_exprloc.s
verify_compatible_tags.s [dwarfdump] Verify compatibility of attribute TAGs. 2018-09-21 07:49:29 +00:00
verify_debug_abbrev.s [DebugInfo][test] Fix section flags/type to avoid warning/error in the future 2020-02-18 20:51:41 -08:00
verify_debug_info.s [dwarfdump] Remove bogus verifier error 2019-04-03 19:57:13 +00:00
verify_debug_info2.s llvm-dwarfdump: Dump the section name/number for addr attributes 2018-12-22 20:34:58 +00:00
verify_die_ranges.s
verify_no_linkage_name.s
verify_strings.s [DWARF v5] Verifier: Add checks for DW_FORM_strx* forms. 2018-11-03 00:27:35 +00:00
verify_unit_header_chain.s