[Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects.
authorCarlosAlbertoEnciso <carlos.alberto.enciso@gmail.com>
Tue, 15 Jun 2021 05:52:50 +0000 (06:52 +0100)
committerCarlosAlbertoEnciso <carlos.alberto.enciso@gmail.com>
Tue, 15 Jun 2021 05:53:21 +0000 (06:53 +0100)
commitd0a5d8611935b548e1ec546b49201d47ac0a762c
tree1283a05eb4ac62f72a8e102b4ba8709a7b44aa50
parent68c161090ef6fe83218af6f627170ae56e5800b1
[Debug-Info][CodeView] Fix GUID string generation for MSVC generated objects.

This patch is to address https://bugs.llvm.org/show_bug.cgi?id=50459.
  YAML:455:28: error: GUID strings are 38 characters long

The valid format for a GUID is {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
where X is a hex digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F).
The length of the individual components must be: 8, 4, 4, 4, 12.

For some cases, the converted string generated by obj2yaml, does not
comply with those lengths. yaml2obj checks that the GUID string must
be 38 characters including the dashes and braces.

Reviewed By: amccarth

Differential Revision: https://reviews.llvm.org/D103089
15 files changed:
llvm/lib/DebugInfo/CodeView/Formatters.cpp
llvm/test/tools/obj2yaml/COFF/Inputs/test-1.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/Inputs/test-2.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/Inputs/test-3.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/Inputs/test-4.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/Inputs/test-5.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/Inputs/test-6.o [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-1.test [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-2.test [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-3.test [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-4.test [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-5.test [new file with mode: 0755]
llvm/test/tools/obj2yaml/COFF/test-6.test [new file with mode: 0755]
llvm/unittests/DebugInfo/CodeView/CMakeLists.txt
llvm/unittests/DebugInfo/CodeView/GUIDFormatTest.cpp [new file with mode: 0755]