[PATCH] D132900: [DWARF] Fix infinite recursion in Type Printer.

Alexander Yermolovich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 13:38:09 PDT 2022


ayermolo added a comment.

Broken case. Stopping recursion after 5 iterations.

  0x0000002a:   DW_TAG_namespace [165] * (0x0000000b)
                  DW_AT_name [DW_FORM_string] ("std")
                  DW_AT_decl_file [DW_FORM_data1] ("/mnt/gvfs/third-party2/libgcc/d1129753c8361ac8e9453c0f4291337a4507ebe6/11.x/platform010/5684a5a/include/c++/11.x/x86_64-facebook-linux/bits/c++config.h")
                  DW_AT_decl_line [DW_FORM_data2] (285)
                  DW_AT_decl_column [DW_FORM_data1] (0x0b)
                  DW_AT_sibling [DW_FORM_ref4]  (cu + 0x10f07 => {0x00010f07})
  0x0000d630:     DW_TAG_class_type [46] * (0x0000002a)
                    DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000ab0d] = "codecvt_base")
                    DW_AT_byte_size [DW_FORM_data1] (0x01)
                    DW_AT_decl_file [DW_FORM_data1] ("/mnt/gvfs/third-party2/libgcc/d1129753c8361ac8e9453c0f4291337a4507ebe6/11.x/platform010/5684a5a/include/c++/11.x/bits/codecvt.h")
                    DW_AT_decl_line [DW_FORM_data1] (49)
                    DW_AT_decl_column [DW_FORM_data1] (0x09)
                    DW_AT_sibling [DW_FORM_ref4]  (cu + 0xd667 => {0x0000d667})
  0x0000d63d:       DW_TAG_enumeration_type [188] * (0x0000d630)
                      DW_AT_name [DW_FORM_strp] ( .debug_str[0x00006ad2] = "result")
                      DW_AT_encoding [DW_FORM_data1]  (DW_ATE_unsigned)
                      DW_AT_byte_size [DW_FORM_data1] (0x04)
                      DW_AT_type [DW_FORM_ref4] (cu + 0x13950 => {0x00013950} "unsigned int")
                      DW_AT_decl_file [DW_FORM_data1] ("/mnt/gvfs/third-party2/libgcc/d1129753c8361ac8e9453c0f4291337a4507ebe6/11.x/platform010/5684a5a/include/c++/11.x/bits/codecvt.h")
                      DW_AT_decl_line [DW_FORM_data1] (52)
                      DW_AT_decl_column [DW_FORM_data1] (0x0a)
                      DW_AT_accessibility [DW_FORM_data1] (DW_ACCESS_public)
  0x0001711e:     DW_TAG_subroutine_type [117] * (0x0001706b)
                    DW_AT_type [DW_FORM_ref4] (cu + 0xd63d => {0x0000d63d} "std::codecvt_base::result")
                    DW_AT_object_pointer [DW_FORM_ref4] (cu + 0x1712b => {0x0001712b})
                    DW_AT_sibling [DW_FORM_ref4]  (cu + 0x1715f => {0x0001715f})
  0x0001712b:       DW_TAG_formal_parameter [2]   (0x0001711e)
                      DW_AT_type [DW_FORM_ref4] (cu + 0x17130 => {0x00017130} "std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (::std::codecvt_base::result (::const _Codecvt ::std::codecvt_base::result (::const _Codecvt ::std::codecvt_base::result (::const _Codecvt ::std::codecvt_base::result (::const _Codecvt ::std::codecvt_base::result (::const _Codecvt *")
  0x00017130:       DW_TAG_pointer_type [10]   (0x0001711e)
                      DW_AT_byte_size [DW_FORM_data1] (0x08)
                      DW_AT_type [DW_FORM_ref4] (cu + 0x17136 => {0x00017136} "std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (std::codecvt_base::result (::std::codecvt_base::result (::const _Codecvt *::std::codecvt_base::result (::const _Codecvt *::std::codecvt_base::result (::const _Codecvt *::std::codecvt_base::result (::const _Codecvt *::std::codecvt_base::result (::const _Codecvt *::const _Codecvt")
  0x00017136:       DW_TAG_const_type [9]   (0x0001711e)
                      DW_AT_type [DW_FORM_ref4] (cu + 0x17106 => {0x00017106} "_Codecvt")

0x0001712b: DW_TAG_formal_parameter [2] (0x0001711e)
DW_AT_type [DW_FORM_ref4] (cu + 0x17130 => {0x00017130} “
appendQualifiedName: 17130
appendScopes: 1711e
appendUnqualifiedName: 1711e
appendUnqualifiedNameBefore: 1711e
appendQualifiedNameBefore: d63d
appendScopes: d630
appendScopes: 2a
appendUnqualifiedName: 2a
appendUnqualifiedNameBefore: 2a
stdappendUnqualifiedNameAfter: 2a
::appendUnqualifiedName: d630
appendUnqualifiedNameBefore: d630
codecvt_baseappendTemplateParameters: d630
appendUnqualifiedNameAfter: d630
::appendUnqualifiedNameBefore: d63d
resultappendTemplateParameters: d63d
appendUnqualifiedNameAfter: 1711e
appendUnqualifiedName: 1711e
(
appendQualifiedName: 17130
appendScopes: 1711e
appendUnqualifiedName: 1711e
appendUnqualifiedNameBefore: 1711e
appendQualifiedNameBefore: d63d
appendScopes: d630
appendScopes: 2a
appendUnqualifiedName: 2a
appendUnqualifiedNameBefore: 2a
stdappendUnqualifiedNameAfter: 2a
::appendUnqualifiedName: d630
appendUnqualifiedNameBefore: d630
codecvt_baseappendTemplateParameters: d630
appendUnqualifiedNameAfter: d630
::appendUnqualifiedNameBefore: d63d
resultappendTemplateParameters: d63d
appendUnqualifiedNameAfter: 1711e
appendUnqualifiedName: 1711e
(
appendQualifiedName: 17130
....

0x00017130: DW_TAG_pointer_type [10] (0x0001711e)
DW_AT_byte_size [DW_FORM_data1] (0x08)
DW_AT_type [DW_FORM_ref4] (cu + 0x17136 => {0x00017136} “
appendQualifiedName: 17136
appendScopes: 1711e
appendUnqualifiedName: 1711e
appendUnqualifiedNameBefore: 1711e
appendQualifiedNameBefore: d63d
appendScopes: d630
appendScopes: 2a
appendUnqualifiedName: 2a
appendUnqualifiedNameBefore: 2a
stdappendUnqualifiedNameAfter: 2a
::appendUnqualifiedName: d630
appendUnqualifiedNameBefore: d630
codecvt_baseappendTemplateParameters: d630
appendUnqualifiedNameAfter: d630
::appendUnqualifiedNameBefore: d63d
resultappendTemplateParameters: d63d
appendUnqualifiedNameAfter: 1711e
appendUnqualifiedName: 1711e
(
appendQualifiedName: 17130
appendScopes: 1711e
appendUnqualifiedName: 1711e
appendUnqualifiedNameBefore: 1711e
appendQualifiedNameBefore: d63d
appendScopes: d630
appendScopes: 2a
appendUnqualifiedName: 2a
appendUnqualifiedNameBefore: 2a
stdappendUnqualifiedNameAfter: 2a
::appendUnqualifiedName: d630
appendUnqualifiedNameBefore: d630
codecvt_baseappendTemplateParameters: d630
appendUnqualifiedNameAfter: d630
::appendUnqualifiedNameBefore: d63d
resultappendTemplateParameters: d63d
appendUnqualifiedNameAfter: 1711e
appendUnqualifiedName: 1711e
(
appendQualifiedName: 17130
....


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132900/new/

https://reviews.llvm.org/D132900



More information about the llvm-commits mailing list