This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Simplify string table dumpers.
ClosedPublic

Authored by Higuoxing on Sep 1 2020, 1:43 AM.

Details

Summary

This patch adds a helper function DumpStrSection to simplify codes.
Besides, nonprintable chars in debug_str and debug_str.dwo sections
are printed as escaped chars.

Diff Detail

Event Timeline

Higuoxing created this revision.Sep 1 2020, 1:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2020, 1:43 AM
Higuoxing requested review of this revision.Sep 1 2020, 1:43 AM

After this patch, the dumpers of debug_str, debug_str.dwo and debug_line_str sections are exactly the same one. Can we merge tests into a single file?

I would suggest merging debug-str.yaml and debug-str-dwo.yaml. The only difference is the section name. You could even show that both are dumped if in the same input file.

I think keeping .debug_line_str separate is still wise, because it uses a different switch to get dumped. I don't feel strongly about it though, so am happy if others think it should be merged into a single test. I don't have an answer about what to do about the duplicate coverage of the escaping stuff.

llvm/test/tools/llvm-dwarfdump/debug-str.yaml
0–1

My same comments apply here as in D86916.

Higuoxing updated this revision to Diff 289131.Sep 1 2020, 4:14 AM
Higuoxing marked an inline comment as done.

Address comments.

Thanks!

Higuoxing updated this revision to Diff 289132.Sep 1 2020, 4:15 AM

rm llvm/test/tools/llvm-dwarfdump/debug-str-dwo.yaml

jhenderson accepted this revision.Sep 1 2020, 4:46 AM

LGTM.

llvm/test/tools/llvm-dwarfdump/debug-str.yaml
1–3
This revision is now accepted and ready to land.Sep 1 2020, 4:46 AM
Higuoxing updated this revision to Diff 289141.Sep 1 2020, 5:26 AM
Higuoxing marked an inline comment as done.

Address comments.

llvm/test/tools/llvm-dwarfdump/debug-str.yaml
1–3

Thanks!

This revision was automatically updated to reflect the committed changes.